blob: d8f1fe54d09473328ed80d9c122a183df150d7f2 (
plain)
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
|
#ifndef _CBUTTON_H
#define _CBUTTON_H
#include "bitmap.h"
#define BUTTON_MAX_TITLE 256
#define BUTTON_MAX_IMGS 3
#define BUTTON_CLICK_HEIGHT 49
struct ButtonStruct {
int m_iXPos; // x positie
int m_iYPos; // y positie
int m_iCenterWidth; // breedte van middenstuk
int m_iWidth; // totale breedte
int m_iHeight; // totale hoogte
int m_bPressed; // pressed or not
int m_bHover; // mouse hovering or not
int m_iType; // button type
int m_iGroup; // group id for radio buttons
int m_iId; // button identifier
// button caption/title
char m_pcTitle[BUTTON_MAX_TITLE];
// button images
struct BitmapStruct m_psImgNormal[BUTTON_MAX_IMGS];
struct BitmapStruct m_psImgHover[BUTTON_MAX_IMGS];
struct BitmapStruct m_psImgPressed[BUTTON_MAX_IMGS];
};
enum ButtonType {
BUTTON_CLICK,
BUTTON_RADIO
};
enum ButtonGroup {
BUTTON_NO_GROUP,
BUTTON_GROUP1,
BUTTON_GROUP2,
BUTTON_GROUP3,
BUTTON_GROUP4
};
struct ButtonStruct ButtonCreate(int f_dXPos, int f_dYPos, int f_dCenterWidth, int f_dHeight, char *f_pcTitle, int f_iType, int f_iGroup, int f_iId);
void ButtonRender(struct ButtonStruct *f_sButton);
void ButtonEnter(struct ButtonStruct *f_sButton);
void ButtonExit(struct ButtonStruct *f_sButton);
void ButtonPress(struct ButtonStruct *f_sButton);
void ButtonRelease(struct ButtonStruct *f_sButton);
void ButtonEnable(struct ButtonStruct *f_sButton);
void ButtonDisable(struct ButtonStruct *f_sButton);
#endif
|