2010-07-26 17:12:06 +08:00
|
|
|
// Application main form file.
|
|
|
|
|
|
|
|
// Original file name: test_uphoneMainForm.cpp
|
|
|
|
// Generated by TOPS Builder:Project wizard,Date:2010-7-26
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "test_uphoneMainForm.h"
|
2010-07-28 18:18:27 +08:00
|
|
|
|
2010-07-26 17:12:06 +08:00
|
|
|
#include "test_uphone_res_def.h"
|
2010-07-28 18:18:27 +08:00
|
|
|
#include "TG3.h"
|
2010-08-03 11:23:12 +08:00
|
|
|
#include "ssMsgQueue.h"
|
2010-07-28 18:18:27 +08:00
|
|
|
#include "touch_dispatcher/CCTouchDelegateProtocol.h"
|
2010-07-26 17:12:06 +08:00
|
|
|
|
2010-07-28 10:15:02 +08:00
|
|
|
using namespace cocos2d;
|
|
|
|
|
|
|
|
TMainForm::TMainForm(TApplication * pApp)
|
|
|
|
: CCXEGLView(pApp)
|
2010-07-26 17:12:06 +08:00
|
|
|
{
|
2010-08-12 14:46:58 +08:00
|
|
|
TRectangle rcWnd(0, 0, pApp->GetScreenWidth(), pApp->GetScreenHeight());
|
|
|
|
Create(&rcWnd);
|
2010-07-26 17:12:06 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
TMainForm::~TMainForm()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Boolean TMainForm::EventHandler(TApplication * pApp, EventType * pEvent)
|
|
|
|
{
|
|
|
|
Boolean bHandled = FALSE;
|
|
|
|
|
|
|
|
switch(pEvent->eType)
|
|
|
|
{
|
2010-08-03 11:23:12 +08:00
|
|
|
case EVENT_WinInit:
|
|
|
|
{
|
|
|
|
// do some thing
|
|
|
|
bHandled = TRUE;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2010-07-26 17:12:06 +08:00
|
|
|
case EVENT_CtrlSelect:
|
|
|
|
{
|
|
|
|
//switch(pEvent->sParam1)
|
|
|
|
//{
|
|
|
|
//case RES_SYSTEM_WINDOW_TITLE_BUTTON_ID:
|
|
|
|
// bHandled = TRUE;
|
|
|
|
// break;
|
|
|
|
//}
|
|
|
|
}
|
|
|
|
break;
|
2010-08-03 11:23:12 +08:00
|
|
|
|
2010-07-26 17:12:06 +08:00
|
|
|
case EVENT_WinClose:
|
|
|
|
{
|
|
|
|
// Stop the application since the main form has been closed
|
|
|
|
pApp->SendStopEvent();
|
2010-08-03 11:23:12 +08:00
|
|
|
bHandled = TRUE;
|
2010-07-26 17:12:06 +08:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (FALSE == bHandled)
|
|
|
|
{
|
2010-07-28 10:15:02 +08:00
|
|
|
return CCXEGLView::EventHandler(pApp,pEvent);
|
2010-07-26 17:12:06 +08:00
|
|
|
}
|
|
|
|
return bHandled;
|
|
|
|
}
|