-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathpm_meterbox.h
More file actions
49 lines (38 loc) · 1.07 KB
/
pm_meterbox.h
File metadata and controls
49 lines (38 loc) · 1.07 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
/*
* File : pm_meterbox.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_timer.h>
#include <sigslot.h>
namespace Persimmon
{
class MeterBox : public Widget
{
public:
MeterBox(Image* img, int length);
virtual ~MeterBox();
Signal<void> finished;
void setCenter(int x, int y);
void setDegreeRange(double min, double max);
void setValueRange(double min, double max);
void setTimes(int times);
void setValue(double value);
virtual void render(struct rtgui_dc* dc, const Point &dcPoint = Point(),
const Rect &srcRect = Rect(),
RenderFlag flags = DrawNormal);
private:
void timeout(void);
protected:
struct rtgui_dc *pointer_dc;
struct rtgui_point p_center, b_center;
Timer *timer;
int times;
double min_degree, max_degree, min_value, max_value, pointer_degree, rota_degree, once_degree;
};
}