summaryrefslogtreecommitdiffstats
path: root/matchblox/menu/button.h
diff options
context:
space:
mode:
Diffstat (limited to 'matchblox/menu/button.h')
-rw-r--r--matchblox/menu/button.h54
1 files changed, 54 insertions, 0 deletions
diff --git a/matchblox/menu/button.h b/matchblox/menu/button.h
new file mode 100644
index 0000000..d8f1fe5
--- /dev/null
+++ b/matchblox/menu/button.h
@@ -0,0 +1,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