Wt examples  4.10.3
Loading...
Searching...
No Matches
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.h>
11
12using namespace Wt;
13
14namespace Wt {
15 class WImage;
16}
17
22
36class IconPair : public WCompositeWidget
37{
38public:
44 IconPair(const std::string icon1URI, const std::string icon2URI,
45 bool clickIsSwitch = true);
46
53 void setState(int num);
54
59 int state() const;
60
63 WImage *icon1() const { return icon1_; }
64
67 WImage *icon2() const { return icon2_; }
68
71 void showIcon1();
72
75 void showIcon2();
76
77private:
78 WContainerWidget *impl_;
79
82
85
86public:
91
96
97private:
100
102 void undoShowIcon1();
103
105 void undoShowIcon2();
106};
107
110#endif // ICONPAIR_H_
Wt::Auth::Dbo::UserDatabase< AuthInfo > UserDatabase
Definition Session.h:22
An icon pair (identical to WIconPair)
Definition IconPair.h:37
WImage * icon2_
Second icon.
Definition IconPair.h:84
int state() const
Get the current state.
Definition IconPair.C:61
WContainerWidget * impl_
Definition IconPair.h:78
EventSignal< WMouseEvent > * icon2Clicked
Signal emitted when clicked while in state 1 (icon 2 is shown).
Definition IconPair.h:95
WImage * icon1() const
Get the first icon image.
Definition IconPair.h:63
void undoShowIcon2()
Undo function for prelearning showIcon2()
Definition IconPair.C:83
void setState(int num)
Set which icon should be visible.
Definition IconPair.C:50
WImage * icon1_
First icon.
Definition IconPair.h:81
void showIcon2()
Set state to 1 (show icon 2).
Definition IconPair.C:72
void undoShowIcon1()
Undo function for prelearning showIcon1()
Definition IconPair.C:78
WImage * icon2() const
Get the second icon image.
Definition IconPair.h:67
EventSignal< WMouseEvent > * icon1Clicked
Signal emitted when clicked while in state 0 (icon 1 is shown).
Definition IconPair.h:90
int previousState_
Undo state for prelearning stateless showIcon1() and showIcon2() slots.
Definition IconPair.h:99
void showIcon1()
Set state to 0 (show icon 1).
Definition IconPair.C:66