D4CD_MENU - Gargy007/D4CD GitHub Wiki
D4CD_MENU object is defined for menu use - select the item and run action. The menu object is very similar to D4D_MENU in eGUI, it has completely same behavior include the title text and item index. The selection of menu item is done by “focus“character on right side of object. The menu object also can be configured to two different visual mode:
Example:
- with title / item index
- without title / item index
- with title / item index (4 lines / 20 chars)
Declaration
The declaration is divided into three part (begin, items, end) to allow simply declare menu object with unspecified count of items. For more details check the eGUI Reference manual. D4CD_DECLARE_MENU_BEGIN(name, title_text, x, y, cx, cy, flags, pUser, pOnClick, pOnUsrMsg)
- name - name of object
- title_text - pointer to text of title of menu
- x,y - coordination of menu
- cx, cy- size of menu
- flags - system flags of object
- pUser - user data/pointer
- pOnClick - pointer on pOnClick function
- pOnUsrMsg - pointer on user message function D4CD_DECLARE_MENU_ITEM(text)
- text - pointer of item text D4CD_DECLARE_MENU_ITEM_FULL(text, pUser)
- text - pointer of item text
- pUser - item user pointer D4CD_DECLARE_MENU_END(name)
- name - name of object(must be same as in begin section)
API functions
Function that sets menu item index in runtime.
void D4CD_MenuSetIndex(D4CD_OBJECT* pThis, D4CD_MENU_INDEX ix)
Function that gets menu item index in runtime.
D4CD_MENU_INDEX D4CD_MenuGetIndex(D4CD_OBJECT* pThis)
Function that gets menu items count in runtime.
D4CD_MENU_INDEX D4CD_MenuGetItemCount(D4CD_OBJECT_PTR pThis)
Function that try to find item index by user data/pointer.
D4CD_MENU_INDEX D4CD_MenuFindUserDataItem(D4CD_OBJECT_PTR pThis, void* pUser)
Function that gets menu item user data/pointer in runtime.
void* D4CD_MenuGetItemUserData(D4CD_OBJECT_PTR pThis)
Function that gets menu item text pointer in runtime.
D4CD_CHAR* D4CD_MenuGetItemText(D4CD_OBJECT_PTR pThis)