Wt examples 3.3.12
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 bvba, Kessel-Lo, 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
12namespace Wt {
13 class WImage;
14}
15
20
35{
36public:
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
75private:
77
80
83
84public:
89
94
95private:
98
100 void undoShowIcon1();
101
103 void undoShowIcon2();
104};
105
108#endif // ICONPAIR_H_
An icon pair (identical to WIconPair)
Definition IconPair.h:35
int state() const
Get the current state.
Definition IconPair.C:52
void undoShowIcon2()
Undo function for prelearning showIcon2()
Definition IconPair.C:74
void setState(int num)
Set which icon should be visible.
Definition IconPair.C:41
Wt::WImage * icon2_
Second icon.
Definition IconPair.h:82
void showIcon2()
Set state to 1 (show icon 2).
Definition IconPair.C:63
Wt::WImage * icon1() const
Get the first icon image.
Definition IconPair.h:61
void undoShowIcon1()
Undo function for prelearning showIcon1()
Definition IconPair.C:69
Wt::WImage * icon2() const
Get the second icon image.
Definition IconPair.h:65
Wt::EventSignal< Wt::WMouseEvent > & icon2Clicked
Signal emitted when clicked while in state 1 (icon 2 is shown).
Definition IconPair.h:93
int previousState_
Undo state for prelearning stateless showIcon1() and showIcon2() slots.
Definition IconPair.h:97
Wt::WContainerWidget * impl_
Definition IconPair.h:76
void showIcon1()
Set state to 0 (show icon 1).
Definition IconPair.C:57
Wt::EventSignal< Wt::WMouseEvent > & icon1Clicked
Signal emitted when clicked while in state 0 (icon 1 is shown).
Definition IconPair.h:88
Wt::WImage * icon1_
First icon.
Definition IconPair.h:79
WWidget * parent() const

Generated on Fri May 17 2024 for the C++ Web Toolkit (Wt) by doxygen 1.9.8