MenuStack.h
资源名称:MenuList.rar [点击查看]
上传用户:duwei1288
上传日期:2009-12-27
资源大小:451k
文件大小:2k
源码类别:
BREW编程
开发平台:
Visual C++
- #ifndef _MENUSTACK_H
- #define _MENUSTACK_H
- #include "AeeStdlib.h"
- #include "AeeMenu.h"
- #include "AeeShell.h"
- #include "IStack.h"
- typedef boolean PFNMENUHANDLE();
- typedef enum
- {
- MENUITEM_NULL,
- MENUITEM_LOGIN,
- MENUITEM_BOOKMARK,
- MENUITEM_PUSH,
- MENUITEM_HISTORY,
- MENUITEM_SETTING,
- MENUITEM_ABOUT,
- MENUITEM_MAINPAGE,
- MENUITEM_LASTPAGE,
- MENUITEM_OPENURL,
- MENUITEM_SWITCH,
- MENUITEM_EDIT,
- MENUITEM_NEW,
- MENUITEM_DELETE,
- MENUITEM_DEFAULTPAGESET,
- MENUITEM_DEFAULTPAGENAME,
- MENUITEM_DEFAULTPAGEURL,
- MENUITEM_GATEWAYSET,
- MENUITEM_CONNECTMETHOD,
- MENUITEM_ADVANCESET,
- //MENUITEM_CONNECT,
- //MENUITEM_GATEWAY,
- MENUITEM_CONNECTTCP,
- MENUITEM_CONNECTUDP,
- MENUITEM_GATEWAYIP,
- MENUITEM_GATEWAYPORT,
- MENUITEM_GATEWAYUSER,
- MENUITEM_PASSWORD,
- MENUITEM_CONNECTTCPWTLS,
- MENUITEM_CONNECTUDPWTLS,
- MENUITEM_HTTP,
- MENUITEM_HTTPWTLS,
- } TMenuItemId;
- typedef struct TMenuItem
- {
- TMenuItemId tItemId; //菜单的ItemID
- uint16 tImageId; //菜单有图标时为图标ID
- uint16 uiResourceId; //菜单名字ID
- const struct TMenuItem* ptChildMenu; //如果选择此菜单会出现子菜单,则保存子菜单指针
- PFNMENUHANDLE *ChildFunc;
- }TMenuItem;
- typedef AECHAR* PFNMENUREDRAWHDL(uint16 ResId);
- typedef uint16 PFNGETSELITEM(TMenuItem* pMenu);
- typedef struct _IMenuStack
- {
- IStack* m_pStack; //菜单栈
- IMenuCtl* m_pCtl; //菜单控件
- PFNMENUREDRAWHDL *m_pRedrawCb;
- PFNGETSELITEM *m_pGetSelCb;
- }IMenuStack;
- //创建一个IMenuStack的结构
- IMenuStack* IMENUSTACK_CreateInstance(TMenuItem* pItem,PFNMENUREDRAWHDL *pRedrawCb,PFNGETSELITEM *pGetSelCb);
- //释放IMenuStack结构保存的资源
- void IMENUSTACK_Release(IMenuStack** pStack);
- //将当前栈顶保存的菜单指针画在屏幕上
- boolean IMENUSTACK_Redraw(IMenuStack* pStack);
- //处理用户输入的事件
- boolean IMENUSTACK_HandleEvent(IMenuStack* pStack,AEEEvent eCode,uint16 wParam,uint32 dwParam);
- #endif