-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathSpinner.cpp
More file actions
58 lines (42 loc) · 1.42 KB
/
Copy pathSpinner.cpp
File metadata and controls
58 lines (42 loc) · 1.42 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
#include "raygui-cpp/Spinner.h"
RAYGUI_CPP_BEGIN_NAMESPACE
Spinner::Spinner() : text(""), value(nullptr), minValue(0), maxValue(0), editMode(false) {}
Spinner::Spinner(const char *text, int *value, int minValue, int maxValue, bool editMode)
: text(text), value(value), minValue(minValue), maxValue(maxValue), editMode(editMode) {}
Spinner::Spinner(Bounds bounds, const char *text, int *value, int minValue, int maxValue, bool editMode)
: Component<bool>(bounds), text(text), value(value), minValue(minValue), maxValue(maxValue), editMode(editMode) {}
const char *Spinner::GetText() const {
return text;
}
void Spinner::SetText(const char *newText) {
this->text = newText;
}
int *Spinner::GetValue() const {
return value;
}
void Spinner::SetValue(int *newValue) {
this->value = newValue;
}
int Spinner::GetMinValue() const {
return minValue;
}
void Spinner::SetMinValue(int newMinValue) {
this->minValue = newMinValue;
}
int Spinner::GetMaxValue() const {
return maxValue;
}
void Spinner::SetMaxValue(int newMaxValue) {
this->maxValue = newMaxValue;
}
bool Spinner::IsEditMode() const {
return editMode;
}
void Spinner::SetEditMode(bool newEditMode) {
this->editMode = newEditMode;
}
bool Spinner::Show(const bool canClick) {
WITH_STATE_RENDER(int ret = ::GuiSpinner(GetBounds().GetRectangle(), text, value, minValue, maxValue, editMode))
return ret;
}
RAYGUI_CPP_END_NAMESPACE