blob: 3103a5d5b080618599471e6ae84033cb5f676063 (
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
|
#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 {
double m_dXPos; // x positie
double m_dYPos; // y positie
double m_dCenterWidth; // breedte van middenstuk
double m_dWidth; // totale breedte
double m_dHeight; // totale hoogte
int m_bPressed; // pressed or not
int m_bHover; // mouse hovering or not
int m_iType; // button type
// button caption/title
char m_pcTitle[BUTTON_MAX_TITLE];
// button images
struct ImageStruct m_piImgNormal[BUTTON_MAX_IMGS];
struct ImageStruct m_piImgHover[BUTTON_MAX_IMGS];
struct ImageStruct m_piImgPressed[BUTTON_MAX_IMGS];
};
enum ButtonType {
BUTTON_CLICK,
BUTTON_RADIO,
BUTTON_LABEL
};
struct ButtonStruct ButtonCreate(double f_dXPos, double f_dYPos, double f_dWidth, char *f_pcTitle, int f_iType);
void ButtonRender(struct ButtonStruct *f_sButton);
void ButtonHover(struct ButtonStruct *f_sButton);
#endif
|