Wt examples
3.2.3
|
00001 // This may look like C code, but it's really -*- C++ -*- 00002 /* 00003 * Copyright (C) 2011 Emweb bvba, Heverlee, Belgium 00004 * 00005 * See the LICENSE file for terms of use. 00006 */ 00007 00008 #ifndef HANGMAN_WIDGET_H_ 00009 #define HANGMAN_WIDGET_H_ 00010 00011 #include <vector> 00012 00013 #include <Wt/WContainerWidget> 00014 00015 #include "Dictionary.h" 00016 00017 class Session; 00018 class WordWidget; 00019 class ImagesWidget; 00020 class LettersWidget; 00021 00022 class HangmanWidget: public Wt::WContainerWidget 00023 { 00024 public: 00025 HangmanWidget(const std::string &name, Wt::WContainerWidget *parent = 0); 00026 00027 Wt::Signal<int>& scoreUpdated() { return scoreUpdated_; } 00028 00029 private: 00030 Wt::WText *title_; 00031 00032 WordWidget *word_; 00033 ImagesWidget *images_; 00034 LettersWidget *letters_; 00035 00036 Wt::WText *statusText_; 00037 Wt::WComboBox *language_; 00038 Wt::WPushButton *newGameButton_; 00039 00040 Wt::Signal<int> scoreUpdated_; 00041 00042 std::string name_; 00043 Dictionary dictionary_; 00044 00045 int badGuesses_; 00046 00047 void registerGuess(char c); 00048 00049 void newGame(); 00050 }; 00051 00052 #endif //HANGMAN_WIDGET_H_