Wt examples  3.7.1
IconPair.h
Go to the documentation of this file.
1 // This may look like C code, but it's really -*- C++ -*-
2 /*
3  * Copyright (C) 2008 Emweb bv, Herent, Belgium.
4  *
5  * See the LICENSE file for terms of use.
6  */
7 #ifndef ICONPAIR_H_
8 #define ICONPAIR_H_
9 
10 #include <Wt/WCompositeWidget>
11 
12 namespace Wt {
13  class WImage;
14 }
15 
20 
35 {
36 public:
42  IconPair(const std::string icon1URI, const std::string icon2URI,
43  bool clickIsSwitch = true, Wt::WContainerWidget *parent = 0);
44 
51  void setState(int num);
52 
57  int state() const;
58 
61  Wt::WImage *icon1() const { return icon1_; }
62 
65  Wt::WImage *icon2() const { return icon2_; }
66 
69  void showIcon1();
70 
73  void showIcon2();
74 
75 private:
77 
80 
83 
84 public:
89 
94 
95 private:
98 
100  void undoShowIcon1();
101 
103  void undoShowIcon2();
104 };
105 
108 #endif // ICONPAIR_H_
An icon pair (identical to WIconPair)
Definition: IconPair.h:34
Wt::WImage * icon1() const
Get the first icon image.
Definition: IconPair.h:61
Wt::WContainerWidget * impl_
Definition: IconPair.h:76
Wt::WImage * icon2() const
Get the second icon image.
Definition: IconPair.h:65
int previousState_
Undo state for prelearning stateless showIcon1() and showIcon2() slots.
Definition: IconPair.h:97
Wt::EventSignal< Wt::WMouseEvent > & icon1Clicked
Signal emitted when clicked while in state 0 (icon 1 is shown).
Definition: IconPair.h:88
Wt::EventSignal< Wt::WMouseEvent > & icon2Clicked
Signal emitted when clicked while in state 1 (icon 2 is shown).
Definition: IconPair.h:93
Wt::WImage * icon2_
Second icon.
Definition: IconPair.h:82
Wt::WImage * icon1_
First icon.
Definition: IconPair.h:79

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