Wt examples
4.11.3
hangman
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
15
class
WordWidget
;
16
class
ImagesWidget
;
17
class
LettersWidget
;
18
19
class
HangmanWidget
:
public
Wt::WContainerWidget
20
{
21
public
:
22
explicit
HangmanWidget
(
const
std::string &name);
23
24
Wt::Signal<int>
&
scoreUpdated
() {
return
scoreUpdated_
; }
25
26
private
:
27
Wt::WText
*
title_
=
nullptr
;
28
29
WordWidget
*
word_
=
nullptr
;
30
ImagesWidget
*
images_
=
nullptr
;
31
LettersWidget
*
letters_
=
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_
HangmanWidget
Definition:
HangmanWidget.h:20
HangmanWidget::name_
std::string name_
Definition:
HangmanWidget.h:39
HangmanWidget::badGuesses_
int badGuesses_
Definition:
HangmanWidget.h:41
HangmanWidget::registerGuess
void registerGuess(char c)
Definition:
HangmanWidget.C:72
HangmanWidget::scoreUpdated
Wt::Signal< int > & scoreUpdated()
Definition:
HangmanWidget.h:24
HangmanWidget::letters_
LettersWidget * letters_
Definition:
HangmanWidget.h:31
HangmanWidget::statusText_
Wt::WText * statusText_
Definition:
HangmanWidget.h:33
HangmanWidget::language_
Wt::WComboBox * language_
Definition:
HangmanWidget.h:34
HangmanWidget::newGame
void newGame()
Definition:
HangmanWidget.C:53
HangmanWidget::images_
ImagesWidget * images_
Definition:
HangmanWidget.h:30
HangmanWidget::title_
Wt::WText * title_
Definition:
HangmanWidget.h:27
HangmanWidget::HangmanWidget
HangmanWidget(const std::string &name)
Definition:
HangmanWidget.C:27
HangmanWidget::scoreUpdated_
Wt::Signal< int > scoreUpdated_
Definition:
HangmanWidget.h:37
HangmanWidget::word_
WordWidget * word_
Definition:
HangmanWidget.h:29
HangmanWidget::newGameButton_
Wt::WPushButton * newGameButton_
Definition:
HangmanWidget.h:35
ImagesWidget
Definition:
ImagesWidget.h:16
LettersWidget
Definition:
LettersWidget.h:20
WordWidget
Definition:
WordWidget.h:14
Wt::Signal
Wt::WComboBox
Wt::WContainerWidget
Wt::WPushButton
Wt::WText
Generated on Wed Feb 19 2025 for
the C++ Web Toolkit (Wt)
by
1.9.1