Wt examples  3.7.1
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>
14 
16 {
17 public:
18  static const int HURRAY;
19 
20  ImagesWidget(int maxGuesses, Wt::WContainerWidget *parent = 0);
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 
29 private:
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
Definition: ImagesWidget.h:27
void showImage(int index)
Definition: ImagesWidget.C:38
std::vector< Wt::WImage * > images_
Definition: ImagesWidget.h:30
static const int HURRAY
Definition: ImagesWidget.h:18
Wt::WImage * image(int index) const
Definition: ImagesWidget.C:45
WWidget * parent() const
ImagesWidget(int maxGuesses, Wt::WContainerWidget *parent=0)
Definition: ImagesWidget.C:15

Generated on Tue Dec 15 2020 for the C++ Web Toolkit (Wt) by doxygen 1.8.13