-
Notifications
You must be signed in to change notification settings - Fork 15
/
pm_dotIndicator.h
68 lines (54 loc) · 1.38 KB
/
pm_dotIndicator.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/*
* File : pm_dotIndicator.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 <pm_image.h>
namespace Persimmon
{
class DotIndicator : public Widget
{
public:
enum type
{
HORIZONTAL = 0,
VERTICAL = 1,
};
DotIndicator(Image *norImg, Image *selImg, int num, int gap = 0);
virtual ~DotIndicator();
void setDirection(enum type t = HORIZONTAL) /* ????????,??? 0 */
{
direction = t;
}
void selectDotIndicator(int num)
{
if (num >= dotIndicatorNum || num < 0)
return;
dotIndicatorSelNum = num;
}
int getSelectNum(void) /* ????????? */
{
return dotIndicatorSelNum;
}
void setDotIndicatorNum(int num) /* ????????? */
{
dotIndicatorNum = num;
}
void setDotIndicatorGap(int gap)
{
dotIndicatorGap = gap;
}
virtual void render(struct rtgui_dc* dc, const Point &dcPoint = Point(),
const Rect &srcRect = Rect(),
RenderFlag flags = DrawNormal);
private:
enum type direction;
Image *norImage, *selImage;
int dotIndicatorNum, dotIndicatorSelNum, dotIndicatorGap;
};
}