|
Wt examples
3.3.5
|
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 class Session; 00016 class WordWidget; 00017 class ImagesWidget; 00018 class LettersWidget; 00019 00020 class HangmanWidget: public Wt::WContainerWidget 00021 { 00022 public: 00023 HangmanWidget(const std::string &name, Wt::WContainerWidget *parent = 0); 00024 00025 Wt::Signal<int>& scoreUpdated() { return scoreUpdated_; } 00026 00027 private: 00028 Wt::WText *title_; 00029 00030 WordWidget *word_; 00031 ImagesWidget *images_; 00032 LettersWidget *letters_; 00033 00034 Wt::WText *statusText_; 00035 Wt::WComboBox *language_; 00036 Wt::WPushButton *newGameButton_; 00037 00038 Wt::Signal<int> scoreUpdated_; 00039 00040 std::string name_; 00041 00042 int badGuesses_; 00043 00044 void registerGuess(char c); 00045 00046 void newGame(); 00047 }; 00048 00049 #endif //HANGMAN_WIDGET_H_
1.7.6.1