Wt examples
3.2.0
|
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, 00026 Wt::WContainerWidget *parent = 0); 00027 00028 Wt::Signal<int>& updateScore() { return updateScore_; } 00029 00030 private: 00031 Wt::WText *title_; 00032 00033 WordWidget *word_; 00034 ImagesWidget *images_; 00035 LettersWidget *letters_; 00036 00037 Wt::WText *statusText_; 00038 Wt::WComboBox *language_; 00039 Wt::WPushButton *newGameButton_; 00040 00041 Wt::Signal<int> updateScore_; 00042 00043 std::string name_; 00044 Dictionary dictionary_; 00045 00046 void registerGuess(char c); 00047 00048 void newGame(); 00049 }; 00050 00051 #endif //HANGMAN_WIDGET_H_