46 #ifndef __D4D_LIST_BOX_H 
   47 #define __D4D_LIST_BOX_H 
   69 #define D4D_LIST_BOX_F_SIDEBAR    (0x01 << D4D_OBJECT_F_OBJECT_SHIFT)    
   74 #ifndef D4D_LIST_BOX_F_DEFAULT 
   75   #define D4D_LIST_BOX_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_DENTED) 
   80 #ifndef D4D_LIST_BOX_F_SCRLBRS_DEFAULT 
   81   #define D4D_LIST_BOX_F_SCRLBRS_DEFAULT  (D4D_OBJECT_F_ENABLED | D4D_OBJECT_F_TABSTOP | D4D_OBJECT_F_TOUCHENABLE | D4D_OBJECT_F_FASTTOUCH | D4D_OBJECT_F_BEVEL_RAISED | D4D_OBJECT_F_MOUSE_NORMAL) 
   86 #ifndef D4D_LIST_BOX_SCRLBR_WIDTH 
   87   #define D4D_LIST_BOX_SCRLBR_WIDTH  ( 20 ) 
   92 #ifndef D4D_LIST_BOX_SCRLBR_STEP 
   93   #define D4D_LIST_BOX_SCRLBR_STEP  ( 1 ) 
   98 #ifndef D4D_LIST_BOX_ITEM_TXT_PRTY_DEFAULT 
   99   #define D4D_LIST_BOX_ITEM_TXT_PRTY_DEFAULT  ( D4D_ALIGN_V_CENTER_MASK | D4D_ALIGN_H_LEFT_MASK ) 
  104 #ifndef D4D_LIST_BOX_ITEM_FNT_PRTY_DEFAULT 
  105   #define D4D_LIST_BOX_ITEM_FNT_PRTY_DEFAULT  ( 0 ) 
  160 #define D4D_LIST_BOX_CHILD_SCROLL_BAR_IX 1 
  167 #define D4D_GET_LIST_BOX(pObj) ((D4D_LIST_BOX*)((pObj)->pParam)) 
  169 #define D4D_GET_LIST_BOX_SCROLL_BAR(pObj) ((D4D_OBJECT*)((pObj)->pRelations[D4D_LIST_BOX_CHILD_SCROLL_BAR_IX])) 
  203 #define _D4D_DECLARE_LIST_BOX_BEGIN(type, name, x, y, cx, cy, radius, pMargin, pParent, flags, pScheme,\ 
  204     itemsFontId, posCnt, listBoxItemsOff, pUser, pOnEvent, pOnUsrMsg) \ 
  205     extern type D4D_LIST_BOX_ITEM name##_items[];\ 
  206     extern type D4D_OBJECT name##_scrollBarVer;\ 
  207     static D4D_LIST_BOX_DATA name##_data = { 0, 0, (const D4D_LIST_BOX_ITEM*)&(name##_items[0])};\ 
  208     static const D4D_OBJECT * const name##_relations[] = {pParent, &name##_scrollBarVer, NULL};\ 
  209     static type D4D_LIST_BOX name##_params = \ 
  218     D4D_DECLARE_OBJECT(type, name, x, y, cx, cy, radius, pMargin, name##_relations, pOnUsrMsg, &d4d_listBoxSysFunc, &(name##_params), flags, pUser, pScheme)\ 
  220     static const D4D_OBJECT* const name##_scrollBarVerRelations[] = {&name, NULL};\ 
  221     _D4D_DECLARE_SCROLL_BAR(type, name##_scrollBarVer,  (D4D_COOR)(cx - D4D_LIST_BOX_SCRLBR_WIDTH - 2*D4D_BEVEL_WIDTH), 0, D4D_LIST_BOX_SCRLBR_WIDTH, (D4D_COOR)(cy - 2*D4D_BEVEL_WIDTH),\ 
  222      radius, NULL, name##_scrollBarVerRelations, D4D_LIST_BOX_F_SCRLBRS_DEFAULT, pScheme, (void*)&name, D4D_ListBoxScrollBarsFeedBack, NULL) \ 
  224     type D4D_LIST_BOX_ITEM name##_items[] = { \ 
  240 #define D4D_DECLARE_LIST_BOX_ITEM(pText, pUser) { pText, (void*)pUser}, 
  253 #define D4D_DECLARE_LIST_BOX_END() { NULL, NULL} }; 
  278 #define D4D_DECLARE_LIST_BOX_BEGIN(name, x, y, cx, cy, flags, pParent, pScheme, itemsFontId, posCnt, listBoxItemsOff, pUser, pOnEvent, pOnUsrMsg) \ 
  279  _D4D_DECLARE_LIST_BOX_BEGIN(D4D_CONST, name, x, y, cx, cy, 0, (D4D_MARGIN*)&listBox_marginDefault, pParent, flags, pScheme,\ 
  280     itemsFontId, posCnt, listBoxItemsOff, pUser, pOnEvent, pOnUsrMsg) 
  299 #define D4D_DECLARE_STD_LIST_BOX_BEGIN(name, x, y, cx, cy, pParent, itemsFontId, pOnEvent) \ 
  300     D4D_DECLARE_LIST_BOX_BEGIN(name, x, y, cx, cy, (D4D_LIST_BOX_F_DEFAULT), pParent, NULL, itemsFontId, 0, 0, NULL, pOnEvent, NULL) 
  327 #define D4D_DECLARE_RLIST_BOX_BEGIN(name, x, y, cx, cy, radius, flags, pParent, pScheme, itemsFontId, posCnt, listBoxItemsOff, pUser, pOnEvent, pOnUsrMsg) \ 
  328  _D4D_DECLARE_LIST_BOX_BEGIN(D4D_CONST, name, x, y, cx, cy, radius, (D4D_MARGIN*)&listBox_marginDefault, pParent, flags, pScheme,\ 
  329     itemsFontId, posCnt, listBoxItemsOff, pUser, pOnEvent, pOnUsrMsg) 
  349 #define D4D_DECLARE_STD_RLIST_BOX_BEGIN(name, x, y, cx, cy, radius, pParent, itemsFontId, pOnEvent) \ 
  350     D4D_DECLARE_RLIST_BOX_BEGIN(name, x, y, cx, cy, radius, (D4D_LIST_BOX_F_DEFAULT), pParent, NULL, itemsFontId, 0, 0, NULL, pOnEvent, NULL) 
  357 #define D4D_DECLARE_LIST_BOX_BEGIN_INRAM(name, x, y, cx, cy, flags, pParent, pScheme, itemsFontId, posCnt, listBoxItemsOff, pUser, pOnEvent, pOnUsrMsg) \ 
  358  _D4D_DECLARE_LIST_BOX_BEGIN(D4D_NO_CONST, name, x, y, cx, cy, 0, (D4D_MARGIN*)&listBox_marginDefault, pParent, flags, pScheme,\ 
  359     itemsFontId, posCnt, listBoxItemsOff, pUser, pOnEvent, pOnUsrMsg) 
  364 #define D4D_DECLARE_STD_LIST_BOX_BEGIN_INRAM(name, x, y, cx, cy, pParent, itemsFontId, pOnEvent) \ 
  365     D4D_DECLARE_LIST_BOX_BEGIN_INRAM(name, x, y, cx, cy, (D4D_LIST_BOX_F_DEFAULT), pParent, NULL, itemsFontId, 0, 0, NULL, pOnEvent, NULL) 
  372 #define D4D_DECLARE_RLIST_BOX_BEGIN_INRAM(name, x, y, cx, cy, radius, flags, pParent, pScheme, itemsFontId, posCnt, listBoxItemsOff, pUser, pOnEvent, pOnUsrMsg) \ 
  373  _D4D_DECLARE_LIST_BOX_BEGIN(D4D_NO_CONST, name, x, y, cx, cy, radius, (D4D_MARGIN*)&listBox_marginDefault, pParent, flags, pScheme,\ 
  374     itemsFontId, posCnt, listBoxItemsOff, pUser, pOnEvent, pOnUsrMsg) 
  379 #define D4D_DECLARE_STD_RLIST_BOX_BEGIN_INRAM(name, x, y, cx, cy, radius, pParent, itemsFontId, pOnEvent) \ 
  380     D4D_DECLARE_RLIST_BOX_BEGIN_INRAM(name, x, y, cx, cy, radius, (D4D_LIST_BOX_F_DEFAULT), pParent, NULL, itemsFontId, 0, 0, NULL, pOnEvent, NULL) 
D4D_WCHAR D4D_TCHAR
Type definition of eGUI character (it depends on UNICODE setting if this is D4D_CHAR or D4D_WCHAR)...
 
D4D_LIST_BOX_ITEM * D4D_ListBoxGetItemList(D4D_OBJECT_PTR pThis)
Function gets the current using item list. 
 
void D4D_ListBoxChangeItemList(D4D_OBJECT_PTR pThis, const D4D_LIST_BOX_ITEM *pItems)
Function change the items list using by list box. 
 
const D4D_MARGIN listBox_marginDefault
 
D4D_LIST_BOX_INDEX D4D_ListBoxGetItemCount(D4D_OBJECT_PTR pThis)
Function gets the count of list box items. 
 
This is list box item variable type. 
 
D4D_TCHAR * pText
pointer to item text 
 
const D4D_OBJECT_SYS_FUNCTION d4d_listBoxSysFunc
 
D4D_LIST_BOX_DATA * pData
 
D4D_LIST_BOX_INDEX D4D_ListBoxGetIndex(D4D_OBJECT *pThis)
Function returns the current selected item index. 
 
D4D_TCHAR * D4D_ListBoxGetItemTextIx(D4D_OBJECT_PTR pThis, D4D_LIST_BOX_INDEX ix)
Function gets the text of item choosed by item index. 
 
Byte D4D_COOR
Type definition of eGUI coordination variables. 
 
D4D_LIST_BOX_INDEX D4D_ListBoxFindUserDataItem(D4D_OBJECT_PTR pThis, void *pUser)
Function finds the index of items with specified user data. 
 
void D4D_ListBoxScrollBarsFeedBack(D4D_OBJECT *pThis, D4D_INDEX old_position, D4D_INDEX new_position)
 
void D4D_ListBoxSetIndex(D4D_OBJECT *pThis, D4D_LIST_BOX_INDEX ix)
Function select new item by index. 
 
sByte D4D_LIST_BOX_INDEX
This is list box item index variable type. 
 
D4D_EVENTID
D4D events that is handled by object callback functions. 
 
void D4D_ListBoxEnsureVisible(D4D_OBJECT *pThis)
Function ensure that the selected item in list will be scrolled to visible area. 
 
LWord D4D_INDEX
Type definition of eGUI general index variables. 
 
The object main structure type definition. 
 
signed char sByte
Type definition of sByte (signed 8-bit). 
 
D4D_TCHAR * D4D_ListBoxGetItemText(D4D_OBJECT_PTR pThis)
Function gets the selected item text. 
 
The object system function needed for each object - this is part of D4D_OBJECT main structure...
 
D4D_LIST_BOX_INDEX page_ix
 
D4D_LSTBX_ON_EVENT OnEvent
 
D4D_LIST_BOX_INDEX posCnt
 
void * D4D_ListBoxGetItemUserData(D4D_OBJECT_PTR pThis)
Function gets the selected item user data. 
 
const D4D_LIST_BOX_ITEM * pItems
 
void * pUser
pointer to void (it can be retype to any other user data in size or less that is pointer size) ...
 
void(* D4D_LSTBX_ON_EVENT)(D4D_OBJECT *pThis, D4D_EVENTID eventId)
Type definition of list box on event callback function. 
 
Type definition of eGUI client area margin structure.