-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathpm_panel.h
More file actions
56 lines (43 loc) · 1.21 KB
/
pm_panel.h
File metadata and controls
56 lines (43 loc) · 1.21 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
/*
* File : pm_panel.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_container.h>
#include <pm_image.h>
namespace Persimmon
{
class Panel : public Container
{
public:
enum type
{
VERTICAL = 1 << 0,
HORIZONTAL = 1 << 1,
LEFT = 1 << 2,
TOP = 1 << 3,
};
DEFINE_CLASS_ENUM_FLAG_OPERATORS(type);
Panel(const Rect rect, enum type tp = VERTICAL);
virtual ~Panel();
void setScrollbar(Image *yImg, Image *xImg);
void addItem(Widget *w);
virtual bool handleGestureEvent(struct rtgui_event_gesture *gev,
const struct rtgui_gesture *gest);
virtual void render(struct rtgui_dc* dc, const Point &dcPoint = Point(),
const Rect &srcRect = Rect(),
RenderFlag flags = DrawNormal);
protected:
void fixChildrenExtent(int xOffset, int yOffset);
enum type mtype;
private:
int yLastPosition, yFirstPosition;
int xLastPosition, xFirstPosition;
int yMovePitch, xMovePitch;
Image *yImage, *xImage;
};
}