Wt examples
3.7.1
public-git
wt
examples
hangman
WordWidget.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 WORD_WIDGET_H_
9
#define WORD_WIDGET_H_
10
11
#include <Wt/WContainerWidget>
12
13
class
WordWidget
:
public
Wt::WContainerWidget
14
{
15
public
:
16
WordWidget
(
Wt::WContainerWidget
*
parent
= 0);
17
18
std::wstring
word
()
const
{
return
word_
; }
19
20
void
init
(
const
std::wstring &
word
);
21
bool
guess
(
wchar_t
c);
22
23
bool
won
();
24
25
private
:
26
std::vector<Wt::WText *>
wordLetters_
;
27
std::wstring
word_
;
28
29
unsigned
displayedLetters_
;
30
};
31
32
#endif //WORD_WIDGET_H_
WordWidget::wordLetters_
std::vector< Wt::WText * > wordLetters_
Definition:
WordWidget.h:26
WordWidget::word
std::wstring word() const
Definition:
WordWidget.h:18
WordWidget
Definition:
WordWidget.h:13
WordWidget::word_
std::wstring word_
Definition:
WordWidget.h:27
WordWidget::init
void init(const std::wstring &word)
Definition:
WordWidget.C:19
WordWidget::guess
bool guess(wchar_t c)
Definition:
WordWidget.C:32
WordWidget::won
bool won()
Definition:
WordWidget.C:47
Wt::WWidget::parent
WWidget * parent() const
WordWidget::displayedLetters_
unsigned displayedLetters_
Definition:
WordWidget.h:29
Wt::WContainerWidget
WordWidget::WordWidget
WordWidget(Wt::WContainerWidget *parent=0)
Definition:
WordWidget.C:13
Generated on Tue Dec 15 2020 for
the C++ Web Toolkit (Wt)
by
1.8.13