Wt examples  4.11.1
Loading...
Searching...
No Matches
HangmanWidget.h
Go to the documentation of this file.
1// This may look like C code, but it's really -*- C++ -*-
2/*
3 * Copyright (C) 2011 Emweb bv, Herent, Belgium
4 *
5 * See the LICENSE file for terms of use.
6 */
7
8#ifndef HANGMAN_WIDGET_H_
9#define HANGMAN_WIDGET_H_
10
11#include <Wt/WContainerWidget.h>
12
13#include <vector>
14
15class WordWidget;
16class ImagesWidget;
17class LettersWidget;
18
19class HangmanWidget : public Wt::WContainerWidget
20{
21public:
22 explicit HangmanWidget(const std::string &name);
23
24 Wt::Signal<int>& scoreUpdated() { return scoreUpdated_; }
25
26private:
27 Wt::WText *title_ = nullptr;
28
29 WordWidget *word_ = nullptr;
32
33 Wt::WText *statusText_ = nullptr;
34 Wt::WComboBox *language_ = nullptr;
35 Wt::WPushButton *newGameButton_ = nullptr;
36
37 Wt::Signal<int> scoreUpdated_;
38
39 std::string name_;
40
41 int badGuesses_ = 0;
42
43 void registerGuess(char c);
44
45 void newGame();
46};
47
48#endif //HANGMAN_WIDGET_H_
std::string name_
void registerGuess(char c)
LettersWidget * letters_
Wt::WText * statusText_
Wt::WComboBox * language_
ImagesWidget * images_
Wt::Signal< int > & scoreUpdated()
Wt::WText * title_
HangmanWidget(const std::string &name)
Wt::Signal< int > scoreUpdated_
WordWidget * word_
Wt::WPushButton * newGameButton_