forked from alimb2/Ayyware-Full-Fixed-Updated-2019
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Controls.h
109 lines (100 loc) · 1.72 KB
/
Controls.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
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
105
106
107
108
109
/*
Syn's AyyWare Framework 2015
*/
#pragma once
#include "GUI.h"
class CCheckBox : public CControl
{
public:
CCheckBox();
void SetState(bool s);
bool GetState();
protected:
bool Checked;
void Draw(bool hover);
void OnUpdate();
void OnClick();
};
class CLabel : public CControl
{
public:
CLabel();
void SetText(std::string text);
protected:
std::string Text;
void Draw(bool hover);
void OnUpdate();
void OnClick();
};
class CGroupBox : public CControl
{
public:
CGroupBox();
void SetText(std::string text);
void PlaceLabledControl(std::string Label, CTab *Tab, CControl* control);
protected:
int Items;
std::string Text;
void Draw(bool hover);
void OnUpdate();
void OnClick();
};
class CSlider : public CControl
{
public:
CSlider();
float GetValue();
void SetValue(float v);
void SetBoundaries(float min, float max);
protected:
float Value;
float Min;
float Max;
bool DoDrag;
void Draw(bool hover);
void OnUpdate();
void OnClick();
};
class CKeyBind : public CControl
{
public:
CKeyBind();
int GetKey();
void SetKey(int key);
protected:
int Key;
bool IsGettingKey;
void Draw(bool hover);
void OnUpdate();
void OnClick();
};
class CButton : public CControl
{
public:
typedef void(*ButtonCallback_t)(void);
CButton();
void SetCallback(ButtonCallback_t callback);
void SetText(std::string text);
protected:
ButtonCallback_t CallBack;
std::string Text;
void Draw(bool hover);
void OnUpdate();
void OnClick();
};
class CComboBox : public CControl
{
public:
CComboBox();
void AddItem(std::string text);
void SelectIndex(int idx);
int GetIndex();
std::string GetItem();
protected:
std::vector<std::string> Items;
int SelectedIndex;
bool IsOpen;
void Draw(bool hover);
void OnUpdate();
void OnClick();
};