This repository was archived by the owner on Mar 29, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpm_container.h
More file actions
75 lines (54 loc) · 1.63 KB
/
pm_container.h
File metadata and controls
75 lines (54 loc) · 1.63 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/*
* File : pm_container.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_widget.h>
#include <rtgui/widgets/widget.h>
#include <rtgui/widgets/container.h>
#include "sigslot.h"
#include <vector>
namespace Persimmon
{
class Container : public Widget
{
typedef Widget super;
public:
Container();
Container(const rtgui_type_t* type);
Container(const Rect &rect);
virtual ~Container();
virtual void addChild(Widget* widget);
virtual void removeChild(Widget* widget);
int getChildIndex(Widget* widget);
void empty();
void saveClip(struct rtgui_region ®ion);
void restoreClip(struct rtgui_region ®ion);
virtual void setRect(const Rect &rect);
void setBox(struct rtgui_box *box);
void layout();
virtual void render(struct rtgui_dc* dc, const Point &dcPoint = Point(),
const Rect &srcRect = Rect(),
RenderFlag flags = DrawNormal);
virtual rt_bool_t eventHandler(struct rtgui_event *event);
virtual Widget* getMouseOwner(int x, int y);
protected:
/* C++ children object under this window */
std::vector<Widget*> children;
void handleEventInChildren(struct rtgui_event *event);
};
class TapContainer: public Container
{
public:
TapContainer(const Rect &rect, int value = 0);
virtual ~TapContainer() {}
Signal<int> touch;
virtual bool handleGestureEvent(struct rtgui_event_gesture *, const struct rtgui_gesture *);
private:
int baseValue;
};
}