43 #if defined(__cplusplus) 53 #define MENU_SKIN_FLEX MENU_DrawSkinFlex 59 #define MENU_CF_HORIZONTAL (0<<0) 60 #define MENU_CF_VERTICAL (1<<0) 61 #define MENU_CF_OPEN_ON_POINTEROVER (1<<1) // Normally a menu opens first when clicked on it 62 #define MENU_CF_CLOSE_ON_SECOND_CLICK (1<<2) // Normally a menu closes only when clicked outside it 63 #define MENU_CF_HIDE_DISABLED_SEL (1<<3) // Hides the selection when a disabled item is selected 69 #define MENU_IF_DISABLED (1<<0) // Indicates that item is disabled 70 #define MENU_IF_SEPARATOR (1<<1) // Indicates that item is a separator 76 #define MENU_CI_ENABLED 0 77 #define MENU_CI_SELECTED 1 78 #define MENU_CI_DISABLED 2 79 #define MENU_CI_DISABLED_SEL 3 80 #define MENU_CI_ACTIVE_SUBMENU 4 86 #define MENU_BI_LEFT 0 87 #define MENU_BI_RIGHT 1 89 #define MENU_BI_BOTTOM 3 95 #define MENU_ON_ITEMSELECT 0 // Send to owner when selecting a menu item 96 #define MENU_ON_INITMENU 1 // Send to owner when for the first time selecting a submenu 97 #define MENU_ON_INITSUBMENU 2 // Send to owner when selecting a submenu 98 #define MENU_ON_OPEN 3 // Internal message of menu widget (only send to submenus) 99 #define MENU_ON_CLOSE 4 // Internal message of menu widget (only send to submenus) 100 #define MENU_IS_MENU 5 // Internal message of menu widget. Owner must call 102 #define MENU_ON_ITEMACTIVATE 6 // Send to owner when highlighting a menu item 103 #define MENU_ON_ITEMPRESSED 7 // Send to owner when a menu item has been pressed 109 #define MENU_SKINFLEX_PI_ENABLED 0 110 #define MENU_SKINFLEX_PI_SELECTED 1 111 #define MENU_SKINFLEX_PI_DISABLED 2 112 #define MENU_SKINFLEX_PI_DISABLED_SEL 3 113 #define MENU_SKINFLEX_PI_ACTIVE_SUBMENU 4 122 typedef WM_HMEM MENU_Handle;
152 } MENU_SKINFLEX_PROPS;
171 MENU_Handle hSubmenu;
180 MENU_Handle MENU_CreateIndirect(
const GUI_WIDGET_CREATE_INFO * pCreateInfo, WM_HWIN hWinParent,
int x0,
int y0, WM_CALLBACK * cb);
181 MENU_Handle MENU_CreateEx (
int x0,
int y0,
int xSize,
int ySize, WM_HWIN hParent,
int WinFlags,
int ExFlags,
int Id);
182 MENU_Handle MENU_CreateUser (
int x0,
int y0,
int xSize,
int ySize, WM_HWIN hParent,
int WinFlags,
int ExFlags,
int Id,
int NumExtraBytes);
191 void MENU_Callback(WM_MESSAGE * pMsg);
199 #define MENU_EnableMemdev(hObj) WM_EnableMemdev(hObj) 200 #define MENU_DisableMemdev(hObj) WM_DisableMemdev(hObj) 201 #define MENU_Delete(hObj) WM_DeleteWindow(hObj) 202 #define MENU_Paint(hObj) WM_Paint(hObj) 203 #define MENU_Invalidate(hObj) WM_InvalidateWindow(hObj) 211 void MENU_AddItem (MENU_Handle hObj,
const MENU_ITEM_DATA * pItemData);
212 void MENU_Attach (MENU_Handle hObj, WM_HWIN hDestWin,
int x,
int y,
int xSize,
int ySize,
int Flags);
213 void MENU_DeleteItem (MENU_Handle hObj,
U16 ItemId);
214 void MENU_DisableItem (MENU_Handle hObj,
U16 ItemId);
215 void MENU_EnableItem (MENU_Handle hObj,
U16 ItemId);
216 void MENU_GetItem (MENU_Handle hObj,
U16 ItemId, MENU_ITEM_DATA * pItemData);
217 void MENU_GetItemText (MENU_Handle hObj,
U16 ItemId,
char * pBuffer,
unsigned BufferSize);
218 unsigned MENU_GetNumItems (MENU_Handle hObj);
219 WM_HWIN MENU_GetOwner (MENU_Handle hObj);
220 int MENU_GetUserData (MENU_Handle hObj,
void * pDest,
int NumBytes);
221 void MENU_InsertItem (MENU_Handle hObj,
U16 ItemId,
const MENU_ITEM_DATA * pItemData);
222 void MENU_Popup (MENU_Handle hObj, WM_HWIN hDestWin,
int x,
int y,
int xSize,
int ySize,
int Flags);
223 void MENU_SetBkColor (MENU_Handle hObj,
unsigned ColorIndex,
GUI_COLOR Color);
224 void MENU_SetBorderSize(MENU_Handle hObj,
unsigned BorderIndex,
U8 BorderSize);
225 void MENU_SetFont (MENU_Handle hObj,
const GUI_FONT * pFont);
226 void MENU_SetItem (MENU_Handle hObj,
U16 ItemId,
const MENU_ITEM_DATA * pItemData);
227 void MENU_SetOwner (MENU_Handle hObj, WM_HWIN hOwner);
228 int MENU_SetSel (MENU_Handle hObj,
int Sel);
229 void MENU_SetTextColor (MENU_Handle hObj,
unsigned ColorIndex,
GUI_COLOR Color);
230 int MENU_SetUserData (MENU_Handle hObj,
const void * pSrc,
int NumBytes);
238 GUI_COLOR MENU_GetDefaultTextColor (
unsigned ColorIndex);
239 GUI_COLOR MENU_GetDefaultBkColor (
unsigned ColorIndex);
240 U8 MENU_GetDefaultBorderSize (
unsigned BorderIndex);
241 const WIDGET_EFFECT * MENU_GetDefaultEffect (
void);
242 const GUI_FONT * MENU_GetDefaultFont (
void);
243 void MENU_SetDefaultTextColor (
unsigned ColorIndex,
GUI_COLOR Color);
244 void MENU_SetDefaultBkColor (
unsigned ColorIndex,
GUI_COLOR Color);
245 void MENU_SetDefaultBorderSize (
unsigned BorderIndex,
U8 BorderSize);
246 void MENU_SetDefaultEffect (
const WIDGET_EFFECT * pEffect);
247 void MENU_SetDefaultFont (
const GUI_FONT * pFont);
255 int MENU_DrawSkinFlex (
const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo);
256 void MENU_GetSkinFlexProps (MENU_SKINFLEX_PROPS * pProps,
int Index);
257 WIDGET_DRAW_ITEM_FUNC * MENU_SetDefaultSkin (WIDGET_DRAW_ITEM_FUNC * pfDrawSkin);
258 void MENU_SetDefaultSkinClassic(
void);
259 void MENU_SetSkinClassic (MENU_Handle hObj);
260 void MENU_SetSkin (MENU_Handle hObj, WIDGET_DRAW_ITEM_FUNC * pfDrawSkin);
261 void MENU_SetSkinFlexProps (
const MENU_SKINFLEX_PROPS * pProps,
int Index);
262 void MENU_SkinEnableArrow (MENU_Handle hObj,
int OnOff);
264 #if defined(__cplusplus) 268 #endif // GUI_WINSUPPORT