MenuStack.h
上传用户:duwei1288
上传日期:2009-12-27
资源大小:451k
文件大小:2k
源码类别:

BREW编程

开发平台:

Visual C++

  1. #ifndef _MENUSTACK_H
  2. #define _MENUSTACK_H
  3. #include "AeeStdlib.h"
  4. #include "AeeMenu.h"
  5. #include "AeeShell.h"
  6. #include "IStack.h"
  7. typedef boolean PFNMENUHANDLE();
  8. typedef enum 
  9. {
  10. MENUITEM_NULL,
  11. MENUITEM_LOGIN,
  12. MENUITEM_BOOKMARK,
  13. MENUITEM_PUSH,
  14. MENUITEM_HISTORY,
  15. MENUITEM_SETTING,
  16. MENUITEM_ABOUT,
  17. MENUITEM_MAINPAGE,
  18. MENUITEM_LASTPAGE,
  19. MENUITEM_OPENURL,
  20. MENUITEM_SWITCH,
  21. MENUITEM_EDIT,
  22. MENUITEM_NEW,
  23. MENUITEM_DELETE,
  24. MENUITEM_DEFAULTPAGESET,
  25. MENUITEM_DEFAULTPAGENAME,
  26. MENUITEM_DEFAULTPAGEURL,
  27. MENUITEM_GATEWAYSET,
  28. MENUITEM_CONNECTMETHOD,
  29. MENUITEM_ADVANCESET,
  30. //MENUITEM_CONNECT,
  31. //MENUITEM_GATEWAY,
  32. MENUITEM_CONNECTTCP,
  33. MENUITEM_CONNECTUDP,
  34. MENUITEM_GATEWAYIP,
  35. MENUITEM_GATEWAYPORT,
  36. MENUITEM_GATEWAYUSER,
  37. MENUITEM_PASSWORD,
  38. MENUITEM_CONNECTTCPWTLS,
  39. MENUITEM_CONNECTUDPWTLS,
  40. MENUITEM_HTTP,
  41. MENUITEM_HTTPWTLS,
  42. } TMenuItemId;
  43. typedef struct TMenuItem
  44. {
  45.   TMenuItemId tItemId; //菜单的ItemID
  46.   uint16 tImageId; //菜单有图标时为图标ID
  47.   uint16 uiResourceId; //菜单名字ID
  48.   const struct TMenuItem* ptChildMenu; //如果选择此菜单会出现子菜单,则保存子菜单指针
  49.   PFNMENUHANDLE *ChildFunc;
  50. }TMenuItem;
  51. typedef AECHAR* PFNMENUREDRAWHDL(uint16 ResId);
  52. typedef uint16  PFNGETSELITEM(TMenuItem* pMenu);
  53. typedef struct _IMenuStack
  54. {
  55. IStack*   m_pStack; //菜单栈
  56. IMenuCtl* m_pCtl; //菜单控件
  57. PFNMENUREDRAWHDL *m_pRedrawCb;
  58. PFNGETSELITEM *m_pGetSelCb;
  59. }IMenuStack;
  60. //创建一个IMenuStack的结构
  61. IMenuStack* IMENUSTACK_CreateInstance(TMenuItem* pItem,PFNMENUREDRAWHDL *pRedrawCb,PFNGETSELITEM *pGetSelCb);
  62. //释放IMenuStack结构保存的资源
  63. void IMENUSTACK_Release(IMenuStack** pStack);
  64. //将当前栈顶保存的菜单指针画在屏幕上
  65. boolean     IMENUSTACK_Redraw(IMenuStack* pStack); 
  66. //处理用户输入的事件
  67. boolean     IMENUSTACK_HandleEvent(IMenuStack* pStack,AEEEvent eCode,uint16 wParam,uint32 dwParam); 
  68. #endif