46 #ifndef __D4D_BUTTON_H
47 #define __D4D_BUTTON_H
60 #ifndef D4D_BTN_3D_SHIFT
61 #define D4D_BTN_3D_SHIFT 1
75 #define D4D_BTN_F_3D (0x01 << D4D_OBJECT_F_OBJECT_SHIFT)
76 #define D4D_BTN_F_CONT_RECT (0x02 << D4D_OBJECT_F_OBJECT_SHIFT)
77 #define D4D_BTN_F_INVERT (0x04 << D4D_OBJECT_F_OBJECT_SHIFT)
80 //******************************************************************************
86 #ifndef D4D_BTN_F_DEFAULT
87 #define D4D_BTN_F_DEFAULT (D4D_OBJECT_F_VISIBLE | D4D_OBJECT_F_ENABLED | D4D_OBJECT_F_TABSTOP | D4D_OBJECT_F_TOUCHENABLE | D4D_OBJECT_F_MOUSE_NORMAL | D4D_OBJECT_F_BEVEL_RAISED | D4D_BTN_F_3D)
92 #ifndef D4D_BTN_TXT_PRTY_DEFAULT
93 #define D4D_BTN_TXT_PRTY_DEFAULT (D4D_ALIGN_H_CENTER_MASK | D4D_ALIGN_V_CENTER_MASK)
98 #ifndef D4D_BTN_FNT_PRTY_DEFAULT
99 #define D4D_BTN_FNT_PRTY_DEFAULT ( 0 )
104 #ifndef D4D_BUTTON_3D_FORE_INTENSITY
105 #define D4D_BUTTON_3D_FORE_INTENSITY D4D_BEVEL_FORE_INTENSITY
110 #ifndef D4D_BUTTON_3D_BCKG_INTENSITY
111 #define D4D_BUTTON_3D_BCKG_INTENSITY D4D_BEVEL_BCKG_INTENSITY
142 #define D4D_BUTTON_STATUS_PRESSED_MASK (0x01)
143 #define D4D_BUTTON_STATUS_1ST_TOUCH_MASK (0x02)
144 #define D4D_BUTTON_STATUS_MOUSE_CLICK_MASK (0x04)
162 #define D4D_GET_BUTTON(pObj) ((D4D_BUTTON*)((pObj)->pParam))
163 #define D4D_GET_BUTTON_STATUS(pObj) ((D4D_BUTTON_STATUS*)(D4D_GET_BUTTON(pObj)->pStatus))
198 #define _D4D_DECLARE_BUTTON(type, name, text, x, y, cx, cy, radius, pMargin, pRelations, flags, pBmpN, pBmpF, pScheme, fontId, pUser, onclick, pOnUsrMsg) \
199 static D4D_BUTTON_STATUS name##_status = { 0 }; \
200 static D4D_STR_PROPERTIES name##_strPrties = { D4D_BTN_FNT_PRTY_DEFAULT, D4D_BTN_TXT_PRTY_DEFAULT}; \
201 static type D4D_BUTTON name##_params = \
203 { text, D4D_TEXT_LEN(text), fontId, &name##_strPrties, D4D_OBJECT_MAX_TEXT_LEN(text), 0}, \
210 D4D_DECLARE_OBJECT(type, name, x, y, cx, cy, radius, pMargin, pRelations, pOnUsrMsg, &d4d_btnSysFunc, &(name##_params), flags, pUser, pScheme)
234 #define D4D_DECLARE_BUTTON(name, text, x, y, cx, cy, flags, pBmpN, pBmpF, pScheme, fontId, pUser, onclick, pOnUsrMsg) \
235 _D4D_DECLARE_BUTTON(D4D_CONST, name, text, x, y, cx, cy, 0, NULL, NULL, flags, pBmpN, pBmpF, pScheme, fontId, pUser, onclick, pOnUsrMsg)
255 #define D4D_DECLARE_STD_BUTTON(name, text, x, y, cx, cy, pBmpN, pBmpF, fontId, onclick) \
256 D4D_DECLARE_BUTTON(name, text, x, y, cx, cy, (D4D_BTN_F_DEFAULT), pBmpN, pBmpF, NULL, fontId, NULL, onclick, NULL)
274 #define D4D_DECLARE_TXT_BUTTON(name, text, x, y, cx, cy, fontId, onclick) \
275 D4D_DECLARE_STD_BUTTON(name, text, x, y, cx, cy, NULL, NULL, \
303 #define D4D_DECLARE_RBUTTON(name, text, x, y, cx, cy, radius, flags, pBmpN, pBmpF, pScheme, fontId, pUser, onclick, pOnUsrMsg) \
304 _D4D_DECLARE_BUTTON(D4D_CONST, name, text, x, y, cx, cy, radius, NULL, NULL, flags, pBmpN, pBmpF, pScheme, fontId, pUser, onclick, pOnUsrMsg)
325 #define D4D_DECLARE_STD_RBUTTON(name, text, x, y, cx, cy, radius, pBmpN, pBmpF, fontId, onclick) \
326 D4D_DECLARE_RBUTTON(name, text, x, y, cx, cy, radius, (D4D_BTN_F_DEFAULT), pBmpN, pBmpF, NULL, fontId, NULL, onclick, NULL)
345 #define D4D_DECLARE_TXT_RBUTTON(name, text, x, y, cx, cy, radius, fontId, onclick) \
346 D4D_DECLARE_STD_RBUTTON(name, text, x, y, cx, cy, radius, NULL, NULL, \
353 #define D4D_DECLARE_BUTTON_INRAM(name, text, x, y, cx, cy, flags, pBmpN, pBmpF, pScheme, fontId, pUser, onclick, pOnUsrMsg) \
354 _D4D_DECLARE_BUTTON(D4D_NO_CONST, name, text, x, y, cx, cy, 0, NULL, NULL, flags, pBmpN, pBmpF, pScheme, fontId, pUser, onclick, pOnUsrMsg)
359 #define D4D_DECLARE_STD_BUTTON_INRAM(name, text, x, y, cx, cy, bmpN, bmpF, fontId, onclick) \
360 D4D_DECLARE_BUTTON_INRAM(name, text, x, y, cx, cy, (D4D_BTN_F_DEFAULT), bmpN, bmpF, NULL, fontId, NULL, onclick, NULL)
365 #define D4D_DECLARE_TXT_BUTTON_INRAM(name, text, x, y, cx, cy, fontId, onclick) \
366 D4D_DECLARE_STD_BUTTON_INRAM(name, text, x, y, cx, cy, NULL, NULL, \
373 #define D4D_DECLARE_RBUTTON_INRAM(name, text, x, y, cx, cy, radius, flags, pBmpN, pBmpF, pScheme, fontId, pUser, onclick, pOnUsrMsg) \
374 _D4D_DECLARE_BUTTON(D4D_NO_CONST, name, text, x, y, cx, cy, radius, NULL, NULL, flags, pBmpN, pBmpF, pScheme, fontId, pUser, onclick, pOnUsrMsg)
379 #define D4D_DECLARE_STD_RBUTTON_INRAM(name, text, x, y, cx, cy, radius, bmpN, bmpF, fontId, onclick) \
380 D4D_DECLARE_RBUTTON_INRAM(name, text, x, y, cx, cy, radius, (D4D_BTN_F_DEFAULT), bmpN, bmpF, NULL, fontId, NULL, onclick, NULL)
385 #define D4D_DECLARE_TXT_RBUTTON_INRAM(name, text, x, y, cx, cy, radius, fontId, onclick) \
386 D4D_DECLARE_STD_RBUTTON_INRAM(name, text, x, y, cx, cy, radius, NULL, NULL, \
401 #define D4D_BtnSetText D4D_SetText
D4D_BUTTON_STATUS * pStatus
const D4D_BMP * pBmpNormal
D4D_BTN_ON_CLICK OnClicked
const D4D_BMP * pBmpFocus
The string type. This structure contains all properties about string in eGUI.
unsigned char Byte
Type definition of Byte (unsigned 8-bit).
D4D_BMP eGUI main image structure.
The object main structure type definition.
The object system function needed for each object - this is part of D4D_OBJECT main structure...