forked from notsecure/uTox
-
Notifications
You must be signed in to change notification settings - Fork 1
/
button.h
35 lines (28 loc) · 1.14 KB
/
button.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
struct button {
PANEL panel;
// Button picture id, top-left aligned/centered respectively.
int bm, bm2;
// Width/height of bm2 picture. Used for centering.
int bw, bh;
// Background RGB color for bm picture, when Idle/Hovered/Pressed respectively.
uint32_t
c1, // Button normal background colour
c2, // Button hover background colour
c3, // Button active (press) background colour
ct1, // Button contents (text or icon) colour
ct2, // Button contents (text or icon) hover colour
cd;
MAYBE_I18NAL_STRING button_text;
MAYBE_I18NAL_STRING tooltip_text;
_Bool mouseover, mousedown, disabled, nodraw;
void (*onright)(void); // called when right mouse button goes down
void (*onpress)(void);
void (*updatecolor)(BUTTON *b);
};
void button_draw(BUTTON *b, int x, int y, int width, int height);
_Bool button_mmove(BUTTON *b, int x, int y, int width, int height, int mx, int my, int dx, int dy);
_Bool button_mdown(BUTTON *b);
_Bool button_mright(BUTTON *b);
_Bool button_mwheel(BUTTON *b, int height, double d);
_Bool button_mup(BUTTON *b);
_Bool button_mleave(BUTTON *b);