-
Notifications
You must be signed in to change notification settings - Fork 0
/
listbox.h
75 lines (66 loc) · 1.45 KB
/
listbox.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
#ifndef LISTBOX_H
#define LISTBOX_H
#include "baseEnt.h"
#include "basicstructs.h"
#include "label.h"
class listBox : public baseEnt
{
class listItem
{
public:
char name[100];
int id;
listItem();
~listItem();
};
bool active;
bool hoverActive;
RGBf bgColor;
RGBf bgColor_active;
RGBf bgColor_hoverActive;
void (*onChange)(int);
listItem *items;
int changeOccured();
int listOffset;
public:
int selectedItem;
listBox();
listBox(int ni); // Pass initializing number of items (ni)
~listBox();
int eventHandler(UINT message,WPARAM key,int mousex,int mousey);
int draw();
int forceUnActive();
int setOnChange(void (*p)(int));
label l_name;
bool useLabelName;
int createItems(unsigned int ni);
bool fillItem(int i,char *s);
bool setSelected(int i);
int numItems;
};
/*
bool active;
bool hoverActive;
RGBf bgColor;
RGBf bgColor_active;
RGBf bgColor_hoverActive;
RGBf forceColor;
bool useForceColor;
bool changeOccured();
bool (*onChange)(char*);
char string[512];
public:
int setLocation(int x, int y); // Return -1 when out of bounds?
int setSize(int x, int y); // Return -1 when error
int eventHandler(UINT message,WPARAM key,int mousex,int mousey);
//int setOnChange(int (*p)(char*));
textBox();
~textBox();
int draw();
int forceUnActive();
int value;
int setOnChange(bool (*p)(char*));
label l_name;
bool useLabelName;
*/
#endif // LISTBOX_H