-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathButton.cpp
More file actions
104 lines (90 loc) · 1.59 KB
/
Copy pathButton.cpp
File metadata and controls
104 lines (90 loc) · 1.59 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#include "Button.h"
Button::Button()
{
this->b_x = 0;
this->b_y = 0;
this->b_w = 0;
this->b_h = 0;
this->text = "";
this->textSize = DEFAULT_TEXT_SIZE;
this->value = UNABLE;
}
Button::Button(int x, int y, int w, int h, String text, int value, int textSize)
{
this->b_x = x;
this->b_y = y;
this->b_w = w;
this->b_h = h;
this->text = text;
this->textSize = textSize;
this->value = value;
}
void Button::set(int x, int y, int w, int h, String text, int value, int textSize)
{
this->b_x = x;
this->b_y = y;
this->b_w = w;
this->b_h = h;
this->text = text;
this->textSize = textSize;
this->value = value;
}
void Button::getFoDraw(int *x, int *y, int *w, int *h, String *text, int *textSize)
{
*x = this->b_x;
*y = this->b_y;
*w = this->b_w;
*h = this->b_h;
*text = this->text;
*textSize = this->textSize;
}
int Button::checkTouch(int x, int y)
{
if (value == UNABLE)
{
return UNABLE;
}
else if (x > b_x && x < b_x + b_w && y > b_y && y < b_y + b_h)
{
return value;
}
else
return UNABLE;
}
void Button::setText(String t)
{
text = t;
}
String Button::getText()
{
return text;
}
void Button::setText2(String t)
{
text2 = t;
}
String Button::getText2()
{
return text2;
}
void Button::setText3(String t)
{
text3 = t;
}
String Button::getText3()
{
return text3;
}
void Button::setValue(int v)
{
value = v;
}
int Button::getValue()
{
return value;
}
void Button::setTextSize(int textSize)
{
this->textSize = textSize;
;
}