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