Wt examples
4.2.2
builddir
build
BUILD
wt-4.2.2
examples
treelist
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
12
using namespace
Wt
;
13
14
namespace
Wt
{
15
class
WImage
;
16
}
17
22
36
class
IconPair
:
public
WCompositeWidget
37
{
38
public
:
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
77
private
:
78
WContainerWidget
*
impl_
;
79
81
WImage
*
icon1_
;
82
84
WImage
*
icon2_
;
85
86
public
:
90
EventSignal<WMouseEvent>
*
icon1Clicked
;
91
95
EventSignal<WMouseEvent>
*
icon2Clicked
;
96
97
private
:
99
int
previousState_
;
100
102
void
undoShowIcon1();
103
105
void
undoShowIcon2();
106
};
107
110
#endif // ICONPAIR_H_
Wt
IconPair::icon1
WImage * icon1() const
Get the first icon image.
Definition:
IconPair.h:63
IconPair::icon1_
WImage * icon1_
First icon.
Definition:
IconPair.h:81
Wt::WContainerWidget
IconPair::icon2_
WImage * icon2_
Second icon.
Definition:
IconPair.h:84
IconPair::previousState_
int previousState_
Undo state for prelearning stateless showIcon1() and showIcon2() slots.
Definition:
IconPair.h:99
IconPair::icon1Clicked
EventSignal< WMouseEvent > * icon1Clicked
Signal emitted when clicked while in state 0 (icon 1 is shown).
Definition:
IconPair.h:90
Wt::WImage
IconPair
An icon pair (identical to WIconPair)
Definition:
IconPair.h:36
Wt::EventSignal< WMouseEvent >
IconPair::impl_
WContainerWidget * impl_
Definition:
IconPair.h:78
IconPair::icon2
WImage * icon2() const
Get the second icon image.
Definition:
IconPair.h:67
IconPair::icon2Clicked
EventSignal< WMouseEvent > * icon2Clicked
Signal emitted when clicked while in state 1 (icon 2 is shown).
Definition:
IconPair.h:95
Wt::WCompositeWidget
Generated on Fri Mar 20 2020 for
the C++ Web Toolkit (Wt)
by
1.8.17