diff --git a/360/menu.cpp b/360/menu.cpp index 2bcf7c758d..8d4a07d218 100644 --- a/360/menu.cpp +++ b/360/menu.cpp @@ -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); -} \ No newline at end of file +} diff --git a/360/menu.h b/360/menu.h index 2aeced8bf9..8366dea83c 100644 --- a/360/menu.h +++ b/360/menu.h @@ -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) };