-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathBasicWidget.h
69 lines (42 loc) · 1.12 KB
/
BasicWidget.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
69
#ifndef STUSYSTEMGUI_BASICWIDGET_H
#define STUSYSTEMGUI_BASICWIDGET_H
/**
* abstract class,is not allowed to create an instance
*/
#include<easyx.h>
class BasicWidget {
public:
//constructor
BasicWidget(int mX, int mY, int mW, int mH);
//destructor
virtual ~BasicWidget(){}
int getMX() const;
int getMY() const;
int getMW() const;
int getMH() const;
void setFixSize(int wid, int heig);
void move(int x, int y);
//check if the mouse is stopping the Button
bool isOn();
//check if the button is clicked
bool isClicked();
virtual void show() = 0;
//
virtual void event();
//setBackGroundColor
void setBackColor(COLORREF color);
//set color when mouse hovering in the button
void setMouseHoverColor(COLORREF color);
protected:
int m_x;//
int m_y;
int m_w;
int m_h;
//currrnt button color
COLORREF currentColor = RGB(232, 232, 236);
//normal state color
COLORREF commonColor = RGB(232, 232, 236);
//when a mouse was hovering
COLORREF mouseHoverColor = RED;
};
#endif //STUSYSTEMGUI_BASICWIDGET_H