Wt examples
4.9.0
|
An icon pair (identical to WIconPair) More...
#include <IconPair.h>
Public Member Functions | |
IconPair (const std::string icon1URI, const std::string icon2URI, bool clickIsSwitch=true) | |
Construct a two-state icon widget. More... | |
void | setState (int num) |
Set which icon should be visible. More... | |
int | state () const |
Get the current state. More... | |
WImage * | icon1 () const |
Get the first icon image. More... | |
WImage * | icon2 () const |
Get the second icon image. More... | |
void | showIcon1 () |
Set state to 0 (show icon 1). More... | |
void | showIcon2 () |
Set state to 1 (show icon 2). More... | |
Public Attributes | |
EventSignal< WMouseEvent > * | icon1Clicked |
Signal emitted when clicked while in state 0 (icon 1 is shown). More... | |
EventSignal< WMouseEvent > * | icon2Clicked |
Signal emitted when clicked while in state 1 (icon 2 is shown). More... | |
Private Member Functions | |
void | undoShowIcon1 () |
Undo function for prelearning showIcon1() More... | |
void | undoShowIcon2 () |
Undo function for prelearning showIcon2() More... | |
Private Attributes | |
WContainerWidget * | impl_ |
WImage * | icon1_ |
First icon. More... | |
WImage * | icon2_ |
Second icon. More... | |
int | previousState_ |
Undo state for prelearning stateless showIcon1() and showIcon2() slots. More... | |
An icon pair (identical to WIconPair)
This widget manages two images, only one of which is shown at a single time.
The widget may also react to click events, by changing state.
This widget is part of the Wt treelist example, where it is used to represent the expand/collapse icons, and the corresponding map open/close icon.
Definition at line 36 of file IconPair.h.
IconPair::IconPair | ( | const std::string | icon1URI, |
const std::string | icon2URI, | ||
bool | clickIsSwitch = true |
||
) |
Construct a two-state icon widget.
The constructor takes the URI of the two icons. When clickIsSwitch is set true, clicking on the icon will switch state.
Definition at line 14 of file IconPair.C.
|
inline |
|
inline |
void IconPair::setState | ( | int | num | ) |
void IconPair::showIcon1 | ( | ) |
Set state to 0 (show icon 1).
Definition at line 66 of file IconPair.C.
void IconPair::showIcon2 | ( | ) |
Set state to 1 (show icon 2).
Definition at line 72 of file IconPair.C.
int IconPair::state | ( | ) | const |
|
private |
Undo function for prelearning showIcon1()
Definition at line 78 of file IconPair.C.
|
private |
Undo function for prelearning showIcon2()
Definition at line 83 of file IconPair.C.
|
private |
First icon.
Definition at line 81 of file IconPair.h.
EventSignal<WMouseEvent>* IconPair::icon1Clicked |
Signal emitted when clicked while in state 0 (icon 1 is shown).
Definition at line 90 of file IconPair.h.
|
private |
Second icon.
Definition at line 84 of file IconPair.h.
EventSignal<WMouseEvent>* IconPair::icon2Clicked |
Signal emitted when clicked while in state 1 (icon 2 is shown).
Definition at line 95 of file IconPair.h.
|
private |
Definition at line 78 of file IconPair.h.
|
private |
Undo state for prelearning stateless showIcon1() and showIcon2() slots.
Definition at line 99 of file IconPair.h.