Hello, I modify and add a 5 tab with buttons, and I look in vain to add events when you click on these button.
Here are the pieces of code I added:
in ScnGuideMain.h:
in ScnGuideMain.cpp :
aprint("Register"); et aprint("Unregister"); Are well written
ScnGuideInfo::Register(); and ScnGuideInfo::Unregister(); Works but not ScnGuideMain::Register(); and ScnGuideMain::Unregister(); I have the impression
Any help is welcome, thanks in advance
Here are the pieces of code I added:
Code:
HRESULT XuiRegisterClassHook(const XUIClass * pClass, HXUICLASS *phClass)
{
HRESULT ret = XuiRegisterClass(pClass, phClass);
aprint("Register");
ScnGuideInfo::Register(); //GuideInfo
ScnGuideMain::Register(); //GuideMain
return ret;
}
HRESULT XuiUnregisterClassHook(LPCWSTR szClassName)
{
HRESULT ret = XuiUnregisterClass(szClassName);
aprint("Unregister");
ScnGuideInfo::Unregister(); //GuideInfo
ScnGuideMain::Unregister(); //GuideMain
return ret;
}
in ScnGuideMain.h:
Code:
#pragma once
#include <xtl.h>
#include <xui.h> // XUI Runtime
#include <xuiapp.h> // XUI Class Library
#include "pTools.h"
class ScnGuideMain : CXuiSceneImpl
{
public:
CXuiTextElement Hitmanw, ROL, imgControllerBattery, imgHeadsetBattery, btnY, btnX, btnB, txt_gamesSel, txt_Games, txt_SystemSel, txt_Settings, Tabscene, txt_MediaSel, txt_Media;
CXuiControl btnRedeemToken;
CXuiControl btnReset;
CXuiControl btnUpdates;
CXuiControl btnDev;
CXuiControl btnkvboton;
CXuiControl btnreboot;
CXuiControl descargarmodloader;
XUI_IMPLEMENT_CLASS(ScnGuideMain, L"GuideMain", XUI_CLASS_SCENE)
XUI_BEGIN_MSG_MAP()
XUI_ON_XM_NOTIFY_PRESS(OnNotifyPress)
XUI_ON_XM_INIT(OnInitGuideMain)
XUI_ON_XM_RENDER(OnRenderGuideMain)
XUI_END_MSG_MAP()
HRESULT OnInitGuideMain(XUIMessageInit *pInitData, BOOL& bHandled);
HRESULT OnRenderGuideMain(XUIMessageRender *pRenderData, BOOL& bHandled);
HRESULT InitializeChildrenGuideMain();
HRESULT OnNotifyPress(HXUIOBJ hObjPressed, BOOL& bHandled);
};
in ScnGuideMain.cpp :
Code:
#include "stdafx.h"
#include "ScnGuideMain.h"
HRESULT ScnGuideMain::OnInitGuideMain(XUIMessageInit *pInitData, BOOL& bHandled)
{
InitializeChildrenGuideMain();
aprint("OnInitGuideMain");
return ERROR_SUCCESS;
}
HRESULT ScnGuideMain::OnNotifyPress(HXUIOBJ hObjPressed, BOOL& bHandled)
{
if (hObjPressed == btnRedeemToken)
{
XNotifyUI(L"btnRedeemToken");
bHandled = TRUE;
return S_OK;
}
else if (hObjPressed == btnReset)
{
XNotifyUI(L"btnReset");
bHandled = TRUE;
return S_OK;
}
else if (hObjPressed == btnUpdates)
{
XNotifyUI(L"btnUpdates");
bHandled = TRUE;
return S_OK;
}
else if (hObjPressed == btnDev)
{
XNotifyUI(L"btnDev");
bHandled = TRUE;
return S_OK;
}
else if (hObjPressed == btnkvboton)
{
XNotifyUI(L"btnkvboton");
bHandled = TRUE;
return S_OK;
}
else if (hObjPressed == btnreboot)
{
XNotifyUI(L"btnreboot");
Sleep(300);
HalReturnToFirmware(HalFatalErrorRebootRoutine);
bHandled = TRUE;
return S_OK;
}
else if (hObjPressed == descargarmodloader)
{
XNotifyUI(L"descargarmodloader");
bHandled = TRUE;
return S_OK;
}
return S_OK;
}
HRESULT ScnGuideMain::OnRenderGuideMain(XUIMessageRender *pRenderData, BOOL& bHandled)
{
aprint("OnRenderGuideMain");
return ERROR_SUCCESS;
}
HRESULT ScnGuideMain::InitializeChildrenGuideMain()
{
aprint("InitializeChildrenGuideMain");
return ERROR_SUCCESS;
}
aprint("Register"); et aprint("Unregister"); Are well written
ScnGuideInfo::Register(); and ScnGuideInfo::Unregister(); Works but not ScnGuideMain::Register(); and ScnGuideMain::Unregister(); I have the impression
Any help is welcome, thanks in advance