Wt examples
3.3.0
|
00001 // This may look like C code, but it's really -*- C++ -*- 00002 /* 00003 * Copyright (C) 2011 Emweb bvba, Heverlee, Belgium 00004 * 00005 * See the LICENSE file for terms of use. 00006 */ 00007 00008 #ifndef IMAGES_WIDGET_H_ 00009 #define IMAGES_WIDGET_H_ 00010 00011 #include <vector> 00012 00013 #include <Wt/WContainerWidget> 00014 00015 class ImagesWidget : public Wt::WContainerWidget 00016 { 00017 public: 00018 static const int HURRAY; 00019 00020 ImagesWidget(int maxGuesses, Wt::WContainerWidget *parent = 0); 00021 00022 /* 00023 * 0 - maxGuesses: corresponds to 0 up to maxGuesses guesses 00024 * HURRAY: when won 00025 */ 00026 void showImage(int index); 00027 int currentImage() const { return image_; } 00028 00029 private: 00030 std::vector<Wt::WImage *> images_; 00031 int image_; 00032 00033 Wt::WImage *image(int index) const; 00034 }; 00035 00036 #endif // IMAGES_WIDGET_H_