(360) Added XUI logic (test)

This commit is contained in:
TwinAphex51224 2012-01-24 00:02:02 +01:00
parent 458abe3611
commit 8c672bc613
2 changed files with 35 additions and 1 deletions

View File

@ -39,6 +39,28 @@ HRESULT CSSNES::UnregisterXuiClasses (void)
return S_OK;
}
HRESULT CMyMainScene::OnInit(XUIMessageInit * pInitData, BOOL& bHandled)
{
GetChildById(L"XuiBtnRomBrowser", &m_filebrowser);
GetChildByid(L"XuiBtnSettings", &m_settings);
GetChildById(L"XuiBtnQuit", &m_quit);
GetChildById(L"XuiTxtTitle", &m_title);
return S_OK;
}
HRESULT CMyMainScene::OnNotifyPress( HXUIOBJ hObjPressed, BOOL& bHandled )
{
if ( hObjPressed == m_filebrowser )
{
menu_is_running = false;
}
bHandled = TRUE;
return S_OK;
}
int menu_init (void)
{
HRESULT hr;
@ -96,4 +118,4 @@ void menu_loop(void)
/* Present the frame */
vid->xdk360_render_device->Present(NULL, NULL, NULL, NULL);
}while(menu_is_running);
}
}

View File

@ -15,7 +15,19 @@ protected:
class CMyMainScene: public CXuiSceneImpl
{
protected:
CXuiControl m_filebrowser;
CxuiControl m_settings;
CXuiControl m_quit;
CxuiTextElemet m_title;
public:
HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled );
XUI_BEGIN_MSG_MAP()
XUI_ON_XM_INIT( OnInit)
XUI_ON_XM_NOTIFY_PRESS( OnNotifyPress )
XUI_END_MSG_MAP();
XUI_IMPLEMENT_CLASS(CMyMainScene, L"MyMainScene", XUI_CLASS_SCENE)
};