-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgui.h
51 lines (47 loc) · 919 Bytes
/
gui.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
#ifndef GUI_H
#define GUI_H
#include "display.h"
const int SLIDER_RADIUS=20;
template <class T>
class Button {
private:
int x,y;
float w,h;
T val;
public:
Button();
Button(int,int,float,float,T);
~Button();
void init(int,int,float,float,T);
bool checkMouse(int,int);
int getX();
int getY();
float getWidth();
float getHeight();
T getValue();
};
class Slider {
private:
int x,y; // original position
int offsetx; // slid position
int lastX;
int value;
int min,max;
int inc;
bool clicked;
bool hovering;
public:
Slider();
Slider(int,int,int,int,int); // x, y, min, max, inc
~Slider();
bool checkMouse(int,int);
bool slide(int);
void render(X11&);
void setClicked(bool);
void setHovering(bool);
int getValue();
int getClicked();
int getLastX();
int getHovering();
};
#endif