Wt examples  4.11.1
Loading...
Searching...
No Matches
ImagesWidget.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 IMAGES_WIDGET_H_
9#define IMAGES_WIDGET_H_
10
11#include <Wt/WContainerWidget.h>
12
13#include <vector>
14
15class ImagesWidget : public Wt::WContainerWidget
16{
17public:
18 static const int HURRAY;
19
20 explicit ImagesWidget(int maxGuesses);
21
22 /*
23 * 0 - maxGuesses: corresponds to 0 up to maxGuesses guesses
24 * HURRAY: when won
25 */
26 void showImage(int index);
27 int currentImage() const { return image_; }
28
29private:
30 std::vector<Wt::WImage*> images_;
31 int image_;
32
33 Wt::WImage *image(int index) const;
34};
35
36#endif // IMAGES_WIDGET_H_
int currentImage() const
Wt::WImage * image(int index) const
void showImage(int index)
static const int HURRAY
std::vector< Wt::WImage * > images_
ImagesWidget(int maxGuesses)