-
Notifications
You must be signed in to change notification settings - Fork 15
/
pm_switch.h
50 lines (36 loc) · 945 Bytes
/
pm_switch.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
* File : pm_switch.h
* COPYRIGHT (C) 2012-2017, Shanghai Real-Thread Technology Co., Ltd
*
* Change Logs:
* Date Author Notes
* 2017-11-05 realthread the first version
*/
#pragma once
#include <pm_image.h>
#include <pm_widget.h>
#include <sigslot.h>
namespace Persimmon
{
class Switch : public Widget
{
public:
Switch(Image* on, Image* off, bool status = false);
virtual ~Switch();
bool getStatus()
{
return on;
}
void setStatus(bool on);
virtual void render(struct rtgui_dc* dc, const Point &dcPoint = Point(),
const Rect &srcRect = Rect(),
RenderFlag flags = DrawNormal);
virtual bool handleGestureEvent(struct rtgui_event_gesture *gev,
const struct rtgui_gesture *gest);
Signal<bool> changed;
private:
Image *image_on;
Image *image_off;
bool on;
};
}