46 #ifndef __D4D_COMBO_BOX_H
47 #define __D4D_COMBO_BOX_H
68 #ifndef D4D_COMBO_BOX_F_DEFAULT
69 #define D4D_COMBO_BOX_F_DEFAULT (D4D_OBJECT_F_VISIBLE | D4D_OBJECT_F_ENABLED | D4D_OBJECT_F_TABSTOP | D4D_OBJECT_F_TOUCHENABLE | D4D_OBJECT_F_FOCUSRECT | D4D_OBJECT_F_MOUSE_NORMAL | D4D_OBJECT_F_BEVEL_RAISED)
74 #ifndef D4D_COMBO_BOX_F_EDITBOX_DEFAULT
75 #define D4D_COMBO_BOX_F_EDITBOX_DEFAULT (D4D_OBJECT_F_VISIBLE | D4D_OBJECT_F_ENABLED | D4D_OBJECT_F_TABSTOP | D4D_OBJECT_F_TOUCHENABLE | D4D_OBJECT_F_FASTTOUCH | D4D_OBJECT_F_MOUSE_NORMAL | D4D_OBJECT_F_BEVEL_DENTED)
80 #ifndef D4D_COMBO_BOX_F_BTN_DEFAULT
81 #define D4D_COMBO_BOX_F_BTN_DEFAULT (D4D_OBJECT_F_VISIBLE | D4D_OBJECT_F_ENABLED | D4D_OBJECT_F_TABSTOP | D4D_OBJECT_F_TOUCHENABLE | D4D_OBJECT_F_FASTTOUCH | D4D_OBJECT_F_MOUSE_NORMAL | D4D_OBJECT_F_BEVEL_RAISED | D4D_BTN_F_3D | D4D_BTN_F_CONT_RECT)
86 #ifndef D4D_COMBO_BOX_F_LISTBOX_DEFAULT
87 #define D4D_COMBO_BOX_F_LISTBOX_DEFAULT (D4D_OBJECT_F_ENABLED | D4D_OBJECT_F_TABSTOP | D4D_OBJECT_F_TOUCHENABLE | D4D_OBJECT_F_FASTTOUCH | D4D_OBJECT_F_FOCUSRECT | D4D_OBJECT_F_MOUSE_NORMAL | D4D_OBJECT_F_BEVEL_RAISED)
92 #ifndef D4D_COMBO_BOX_ITEM_FNT_PRTY_DEFAULT
93 #define D4D_COMBO_BOX_ITEM_FNT_PRTY_DEFAULT ( 0 )
98 #ifndef D4D_COMBO_BOX_STR_MAX_LEN
99 #define D4D_COMBO_BOX_STR_MAX_LEN (20)
146 #define D4D_COMBO_BOX_CHILD_EDIT_BOX_IX 1
147 #define D4D_COMBO_BOX_CHILD_BUTTON_IX 2
148 #define D4D_COMBO_BOX_CHILD_LIST_BOX_IX 3
157 #define D4D_GET_COMBO_BOX(pObj) ((D4D_COMBO_BOX*)((pObj)->pParam))
158 #define D4D_GET_COMBO_BOX_DATA(pObj) ((D4D_COMBO_BOX_DATA*)((D4D_GET_COMBO_BOX(pObj))->pData))
160 #define D4D_GET_COMBO_BOX_EDIT_BOX(pObj) ((D4D_OBJECT*)((pObj)->pRelations[D4D_COMBO_BOX_CHILD_EDIT_BOX_IX]))
161 #define D4D_GET_COMBO_BOX_BUTTON(pObj) ((D4D_OBJECT*)((pObj)->pRelations[D4D_COMBO_BOX_CHILD_BUTTON_IX]))
162 #define D4D_GET_COMBO_BOX_LIST_BOX(pObj) ((D4D_OBJECT*)((pObj)->pRelations[D4D_COMBO_BOX_CHILD_LIST_BOX_IX]))
199 #define _D4D_DECLARE_COMBO_BOX_BEGIN(type, name, x, y, cx, cy, cy_list, radius, pMargin, pParent, flags, pScheme,\
200 itemsFontId, maxStrLen, posCnt, comboBoxItemsOff, pUser, pOnEvent, pOnUsrMsg) \
201 extern type D4D_OBJECT name##_EditBox;\
202 extern type D4D_OBJECT name##_Button;\
203 extern type D4D_OBJECT name##_ListBox;\
204 static D4D_COMBO_BOX_DATA name##_data = {-1};\
205 static const D4D_OBJECT * type name##_relations[] = {pParent, &name##_EditBox, &name##_Button, &name##_ListBox, NULL};\
206 static type D4D_COMBO_BOX name##_params = \
213 D4D_DECLARE_OBJECT(type, name, x, y, (cx), (D4D_COOR)((cy) + cy_list), radius, pMargin, name##_relations, pOnUsrMsg, &d4d_comboBoxSysFunc, &(name##_params), (flags), pUser, pScheme)\
215 static const D4D_OBJECT* const name##_EditBoxRelations[] = {&name, NULL};\
216 _D4D_DECLARE_EDIT_BOX(type, name##_EditBox, 0, 0, (D4D_COOR)((cx) - (cy)), (cy), radius, (D4D_MARGIN*)&d4d_marginDefault, name##_EditBoxRelations, D4D_COMBO_BOX_F_EDITBOX_DEFAULT, pScheme, NULL, itemsFontId, maxStrLen, (void*)&name, D4D_ComboBoxEditFeedBack, NULL) \
217 static const D4D_OBJECT* const name##_ButtonsRelations[] = {&name, NULL};\
218 _D4D_DECLARE_BUTTON(type, name##_Button, NULL, (D4D_COOR)((cx) - (cy)), 0, (cy), (cy), radius, NULL, name##_ButtonsRelations, D4D_COMBO_BOX_F_BTN_DEFAULT, &bmp_arrow, &bmp_arrow, pScheme, 0, (void*)&name, D4D_ComboBoxButtonFeedBack, D4D_ComboBoxButtonMsgFeedBack) \
219 _D4D_DECLARE_LIST_BOX_BEGIN(type, name##_ListBox, 0, (cy), (cx), cy_list, radius, (D4D_MARGIN*)&d4d_marginDefault, &name, D4D_COMBO_BOX_F_LISTBOX_DEFAULT, pScheme, itemsFontId, posCnt, comboBoxItemsOff, (void*)&name, D4D_ComboBoxListFeedBack, D4D_ComboBoxListBoxMsgFeedBack)
234 #define D4D_DECLARE_COMBO_BOX_ITEM D4D_DECLARE_LIST_BOX_ITEM
247 #define D4D_DECLARE_COMBO_BOX_END D4D_DECLARE_LIST_BOX_END
276 #define D4D_DECLARE_COMBO_BOX_BEGIN(name, x, y, cx, cy, cy_list, flags, pParent, pScheme, itemsFontId, maxStrLen, posCnt, comboBoxItemsOff, pUser, pOnEvent, pOnUsrMsg) \
277 _D4D_DECLARE_COMBO_BOX_BEGIN(D4D_CONST, name, x, y, cx, cy, cy_list, 0, (D4D_MARGIN*)&comboBox_marginDefault, pParent, flags, pScheme,\
278 itemsFontId, maxStrLen, posCnt, comboBoxItemsOff, pUser, pOnEvent, pOnUsrMsg)
299 #define D4D_DECLARE_STD_COMBO_BOX_BEGIN(name, x, y, cx, cy, cy_list, pParent, itemsFontId, pOnEvent) \
300 D4D_DECLARE_COMBO_BOX_BEGIN(name, x, y, cx, cy, cy_list, (D4D_COMBO_BOX_F_DEFAULT), pParent, NULL, itemsFontId, D4D_COMBO_BOX_STR_MAX_LEN, 0, 0, NULL, pOnEvent, NULL)
330 #define D4D_DECLARE_RCOMBO_BOX_BEGIN(name, x, y, cx, cy, cy_list, radius, flags, pParent, pScheme, itemsFontId, maxStrLen, posCnt, comboBoxItemsOff, pUser, pOnEvent, pOnUsrMsg) \
331 _D4D_DECLARE_COMBO_BOX_BEGIN(D4D_CONST, name, x, y, cx, cy, cy_list, radius, (D4D_MARGIN*)&comboBox_marginDefault, pParent, flags, pScheme,\
332 itemsFontId, maxStrLen, posCnt, comboBoxItemsOff, pUser, pOnEvent, pOnUsrMsg)
354 #define D4D_DECLARE_STD_RCOMBO_BOX_BEGIN(name, x, y, cx, cy, cy_list, radius, pParent, itemsFontId, pOnEvent) \
355 D4D_DECLARE_RCOMBO_BOX_BEGIN(name, x, y, cx, cy, cy_list, radius, (D4D_COMBO_BOX_F_DEFAULT), pParent, NULL, itemsFontId, D4D_COMBO_BOX_STR_MAX_LEN, 0, 0, NULL, pOnEvent, NULL)
362 #define D4D_DECLARE_COMBO_BOX_BEGIN_INRAM(name, x, y, cx, cy, cy_list, flags, pParent, pScheme, itemsFontId, maxStrLen, posCnt, comboBoxItemsOff, pUser, pOnEvent, pOnUsrMsg) \
363 _D4D_DECLARE_COMBO_BOX_BEGIN(D4D_NO_CONST, name, x, y, cx, cy, cy_list, 0, (D4D_MARGIN*)&comboBox_marginDefault, pParent, flags, pScheme,\
364 itemsFontId, maxStrLen, posCnt, comboBoxItemsOff, pUser, pOnEvent, pOnUsrMsg)
369 #define D4D_DECLARE_STD_COMBO_BOX_BEGIN_INRAM(name, x, y, cx, cy, cy_list, pParent, itemsFontId, pOnEvent) \
370 D4D_DECLARE_COMBO_BOX_BEGIN_INRAM(name, x, y, cx, cy, cy_list, (D4D_COMBO_BOX_F_DEFAULT), pParent, NULL, itemsFontId, D4D_COMBO_BOX_STR_MAX_LEN, 0, 0, NULL, pOnEvent, NULL)
377 #define D4D_DECLARE_RCOMBO_BOX_BEGIN_INRAM(name, x, y, cx, cy, cy_list, radius, flags, pParent, pScheme, itemsFontId, maxStrLen, posCnt, comboBoxItemsOff, pUser, pOnEvent, pOnUsrMsg) \
378 _D4D_DECLARE_COMBO_BOX_BEGIN(D4D_NO_CONST, name, x, y, cx, cy, cy_list, radius, (D4D_MARGIN*)&comboBox_marginDefault, pParent, flags, pScheme,\
379 itemsFontId, maxStrLen, posCnt, comboBoxItemsOff, pUser, pOnEvent, pOnUsrMsg)
384 #define D4D_DECLARE_STD_RCOMBO_BOX_BEGIN_INRAM(name, x, y, cx, cy, cy_list, radius, pParent, itemsFontId, pOnEvent) \
385 D4D_DECLARE_RCOMBO_BOX_BEGIN_INRAM(name, x, y, cx, cy, cy_list, radius, (D4D_COMBO_BOX_F_DEFAULT), pParent, NULL, itemsFontId, D4D_COMBO_BOX_STR_MAX_LEN, 0, 0, NULL, pOnEvent, NULL)
410 #define D4D_ComboBoxGetItemCount(pThis) D4D_ListBoxGetItemCount(D4D_GET_COMBO_BOX_LIST_BOX(pThis))
419 #define D4D_ComboBoxFindUserDataItem(pThis, pUser) D4D_ListBoxFindUserDataItem(D4D_GET_COMBO_BOX_LIST_BOX(pThis), pUser)
427 #define D4D_ComboBoxGetItemUserData(pThis) D4D_ListBoxGetItemUserData(D4D_GET_COMBO_BOX_LIST_BOX(pThis))
435 #define D4D_ComboBoxGetItemText(pThis) D4D_ListBoxGetItemText(D4D_GET_COMBO_BOX_LIST_BOX(pThis))
444 #define D4D_ComboBoxGetItemTextIx(pThis, ix) D4D_ListBoxGetItemTextIx(D4D_GET_COMBO_BOX_LIST_BOX(pThis), ix)
452 #define D4D_ComboBoxEnsureVisible(pThis) D4D_ListBoxEnsureVisible(D4D_GET_COMBO_BOX_LIST_BOX(pThis))
461 #define D4D_ComboBoxChangeItemList(pThis, pItems) D4D_ListBoxChangeItemList(D4D_GET_COMBO_BOX_LIST_BOX(pThis), pItems)
469 #define D4D_ComboBoxGetItemList(pThis) D4D_ListBoxGetItemList(D4D_GET_COMBO_BOX_LIST_BOX(pThis))
const D4D_OBJECT_SYS_FUNCTION d4d_comboBoxSysFunc
Byte D4D_ComboBoxButtonMsgFeedBack(D4D_MESSAGE *pMsg)
This is list box item variable type.
D4D object messages structure.
void D4D_ComboBoxEditFeedBack(D4D_OBJECT *pThis, D4D_EVENTID eventId)
void D4D_ComboBoxButtonFeedBack(D4D_OBJECT *pThis)
D4D_LIST_BOX_INDEX D4D_COMBO_BOX_INDEX
D4D_EXTERN_BMP(bmp_arrow)
D4D_COMBO_BOX_DATA * pData
void(* D4D_CMBBX_ON_EVENT)(D4D_OBJECT *pThis, D4D_EVENTID eventId)
Type definition of combo box on event callback function.
Byte D4D_ComboBoxListBoxMsgFeedBack(D4D_MESSAGE *pMsg)
void D4D_ComboBoxListFeedBack(D4D_OBJECT *pThis, D4D_EVENTID eventId)
D4D_CMBBX_ON_EVENT OnEvent
Byte D4D_COOR
Type definition of eGUI coordination variables.
unsigned char Byte
Type definition of Byte (unsigned 8-bit).
sByte D4D_LIST_BOX_INDEX
This is list box item index variable type.
D4D_EVENTID
D4D events that is handled by object callback functions.
D4D_LIST_BOX_INDEX real_ix
The object main structure type definition.
const D4D_MARGIN comboBox_marginDefault
The object system function needed for each object - this is part of D4D_OBJECT main structure...
D4D_LIST_BOX_ITEM D4D_COMBO_BOX_ITEM
struct D4D_COMBO_BOX_DATA_S D4D_COMBO_BOX_DATA
struct D4D_COMBO_BOX_S D4D_COMBO_BOX
Type definition of eGUI client area margin structure.