Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
MainMenuWnd.c
Package: pfly523.rar [view]
Upload User: shyhai1508
Upload Date: 2007-06-11
Package Size: 48k
Code Size: 2k
Category:
BREW
Development Platform:
Visual C++
- #include "MainMenuWnd.h"
- #include "pfly.h"
- #include "commondef.h"
- #include "pfly_res.h"
- static void MainMenuWnd_Update(MainMenuWnd* pthis);
- static boolean MainMenuWnd_HandleCommandEvent(MainMenuWnd* pthis,uint16 wParam,uint32 dwParam);
- boolean MainMenuWnd_New(MainMenuWnd* pthis, PflyApp* pMe)
- {
- pthis->pMe = pMe;
- pthis->pIMenu = NULL;
- return TRUE;
- }
- boolean MainMenuWnd_HandleEvent(MainMenuWnd* pthis, AEEEvent eCode, uint16 wParam, uint32 dwParam)
- {
- switch(eCode){
- case EVT_COMMAND:
- return MainMenuWnd_HandleCommandEvent(pthis,wParam,dwParam);;
- case EVT_APP_SUSPEND:
- return TRUE;
- case EVT_APP_RESUME:
- MainMenuWnd_Update(pthis);
- return TRUE;
- default:
- return IMENUCTL_HandleEvent(pthis->pIMenu,eCode,wParam,dwParam);
- }
- }
- boolean MainMenuWnd_Open(MainMenuWnd* pthis)
- {
- AEERect rect;
- AEEDeviceInfo di;
- ISHELL_CreateInstance(pthis->pMe->a.m_pIShell,AEECLSID_MENUCTL,(void**)&pthis->pIMenu);
- //设置菜单标题
- IMENUCTL_SetTitle(pthis->pIMenu, PFLY_RES_FILE, IDS_MENUTITLE, 0);
- //设置菜单矩形
- ISHELL_GetDeviceInfo(pthis->pMe->a.m_pIShell,&di);
- rect.x = 0;
- rect.y = 0;
- rect.dx = di.cxScreen;
- rect.dy = di.cyScreen;
- IMENUCTL_SetRect(pthis->pIMenu, &rect);
- //给菜单加子项目
- IMENUCTL_AddItem(pthis->pIMenu, PFLY_RES_FILE, IDS_MENU_START, IDS_MENU_START, 0, 0);
- IMENUCTL_AddItem(pthis->pIMenu, PFLY_RES_FILE, IDS_MENU_SCOREVIEW, IDS_MENU_SCOREVIEW, 0, 0);
- IMENUCTL_AddItem(pthis->pIMenu, PFLY_RES_FILE, IDS_MENU_EXIT, IDS_MENU_EXIT, 0, 0);
- MainMenuWnd_Update(pthis);
- return TRUE;
- }
- void MainMenuWnd_Close(MainMenuWnd* pthis)
- {
- if(pthis->pIMenu) {
- IMENUCTL_Release(pthis->pIMenu);
- pthis->pIMenu = NULL;
- }
- }
- void MainMenuWnd_Free(MainMenuWnd* pthis)
- {
- if(pthis->pIMenu) {
- IMENUCTL_Release(pthis->pIMenu);
- pthis->pIMenu = NULL;
- }
- }
- static void MainMenuWnd_Update(MainMenuWnd* pthis)
- {
- IMENUCTL_SetActive(pthis->pIMenu,TRUE);
- IMENUCTL_Redraw(pthis->pIMenu);
- }
- static boolean MainMenuWnd_HandleCommandEvent(MainMenuWnd* pthis,uint16 wParam,uint32 dwParam)
- {
- switch(wParam) {
- case IDS_MENU_START:
- return Pfly_SetActiveWnd(pthis->pMe, IDW_GAME);
- case IDS_MENU_SCOREVIEW:
- return Pfly_SetActiveWnd(pthis->pMe, IDW_SCORELIST);
- case IDS_MENU_EXIT:
- ISHELL_CloseApplet(pthis->pMe->a.m_pIShell,FALSE);
- return TRUE;
- default:
- return FALSE;
- }
- }