Wt examples
3.3.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 WORD_WIDGET_H_ 00009 #define WORD_WIDGET_H_ 00010 00011 #include <Wt/WContainerWidget> 00012 00013 class WordWidget : public Wt::WContainerWidget 00014 { 00015 public: 00016 WordWidget(Wt::WContainerWidget *parent = 0); 00017 00018 std::wstring word() const { return word_; } 00019 00020 void init(const std::wstring &word); 00021 bool guess(wchar_t c); 00022 00023 bool won(); 00024 00025 private: 00026 std::vector<Wt::WText *> wordLetters_; 00027 std::wstring word_; 00028 00029 unsigned displayedLetters_; 00030 }; 00031 00032 #endif //WORD_WIDGET_H_