format XUI

This commit is contained in:
Tropical
2026-03-22 12:40:22 -05:00
parent a403bf5a4a
commit 4b2f614326
175 changed files with 31285 additions and 30912 deletions

View File

@@ -2,97 +2,94 @@
#include "XUI_Control_ComboBox.h"
#include "../../Minecraft.Client/Platform/Xbox/Xbox_App.h"
HRESULT CXuiControl4JComboBox::OnInit(XUIMessageInit *pInitData, BOOL& bHandled)
{
m_ListData.nItems=0;
m_ListData.pItems=NULL;
HRESULT CXuiControl4JComboBox::OnInit(XUIMessageInit* pInitData,
BOOL& bHandled) {
m_ListData.nItems = 0;
m_ListData.pItems = NULL;
return S_OK;
return S_OK;
}
void CXuiControl4JComboBox::SetData(LIST_ITEM_INFO *pItems,int iCount)
{
CXuiControl4JComboBox *pThis;
HRESULT hr = XuiObjectFromHandle(m_hObj, (void **) &pThis);
void CXuiControl4JComboBox::SetData(LIST_ITEM_INFO* pItems, int iCount) {
CXuiControl4JComboBox* pThis;
HRESULT hr = XuiObjectFromHandle(m_hObj, (void**)&pThis);
// copy the data in
pThis->m_ListData.pItems= new LIST_ITEM_INFO [iCount] ;
memcpy(pThis->m_ListData.pItems,pItems,sizeof(LIST_ITEM_INFO)*iCount);
pThis->m_ListData.nItems=iCount;
// copy the data in
pThis->m_ListData.pItems = new LIST_ITEM_INFO[iCount];
memcpy(pThis->m_ListData.pItems, pItems, sizeof(LIST_ITEM_INFO) * iCount);
pThis->m_ListData.nItems = iCount;
//InsertItems( 0, iCount );
// InsertItems( 0, iCount );
}
int CXuiControl4JComboBox::GetSelectedIndex()
{
return XuiListGetCurSel(GetListObject(),NULL);
int CXuiControl4JComboBox::GetSelectedIndex() {
return XuiListGetCurSel(GetListObject(), NULL);
}
// Gets called every frame
HRESULT CXuiControl4JComboBox::OnGetSourceDataText(XUIMessageGetSourceText *pGetSourceTextData,BOOL& bHandled)
{
if( ( 0 == pGetSourceTextData->iData ) && ( ( pGetSourceTextData->bItemData ) ) )
{
pGetSourceTextData->szText =
m_ListData.pItems[pGetSourceTextData->iItem].pwszText;
bHandled = TRUE;
}
return S_OK;
HRESULT CXuiControl4JComboBox::OnGetSourceDataText(
XUIMessageGetSourceText* pGetSourceTextData, BOOL& bHandled) {
if ((0 == pGetSourceTextData->iData) && ((pGetSourceTextData->bItemData))) {
pGetSourceTextData->szText =
m_ListData.pItems[pGetSourceTextData->iItem].pwszText;
bHandled = TRUE;
}
return S_OK;
}
HRESULT CXuiControl4JComboBox::OnGetItemCountAll(XUIMessageGetItemCount *pGetItemCountData,BOOL& bHandled)
{
pGetItemCountData->cItems = m_ListData.nItems;
bHandled = TRUE;
return S_OK;
HRESULT CXuiControl4JComboBox::OnGetItemCountAll(
XUIMessageGetItemCount* pGetItemCountData, BOOL& bHandled) {
pGetItemCountData->cItems = m_ListData.nItems;
bHandled = TRUE;
return S_OK;
}
HRESULT CXuiControl4JComboBox::OnGetSourceDataImage(XUIMessageGetSourceImage *pGetSourceImageData,BOOL& bHandled)
{
return S_OK;
HRESULT CXuiControl4JComboBox::OnGetSourceDataImage(
XUIMessageGetSourceImage* pGetSourceImageData, BOOL& bHandled) {
return S_OK;
//if( ( 0 == pGetSourceImageData->iData ) && ( pGetSourceImageData->bItemData ) )
//{
// // Check for a brush
// if( ( 0 == pGetSourceImageData->iData ) && (
// pGetSourceImageData->bItemData ) )
//{
// // Check for a brush
// if(m_ListData.pItems[pGetSourceImageData->iItem].hXuiBrush!=NULL)
// {
// pGetSourceImageData->hBrush=m_ListData.pItems[pGetSourceImageData->iItem].hXuiBrush;
// }
// else
// {
// pGetSourceImageData->szPath =
// m_ListData.pItems[pGetSourceImageData->iItem].pwszImage;
// }
// bHandled = TRUE;
//}
//return S_OK;
// if(m_ListData.pItems[pGetSourceImageData->iItem].hXuiBrush!=NULL)
// {
// pGetSourceImageData->hBrush=m_ListData.pItems[pGetSourceImageData->iItem].hXuiBrush;
// }
// else
// {
// pGetSourceImageData->szPath =
// m_ListData.pItems[pGetSourceImageData->iItem].pwszImage;
// }
// bHandled = TRUE;
//}
// return S_OK;
}
HRESULT CXuiControl4JComboBox::OnGetItemEnable(XUIMessageGetItemEnable *pGetItemEnableData,BOOL& bHandled)
{
if(m_ListData.pItems!=NULL && m_ListData.nItems!=0)
{
pGetItemEnableData->bEnabled =
m_ListData.pItems[pGetItemEnableData->iItem].fEnabled;
}
bHandled = TRUE;
return S_OK;
HRESULT CXuiControl4JComboBox::OnGetItemEnable(
XUIMessageGetItemEnable* pGetItemEnableData, BOOL& bHandled) {
if (m_ListData.pItems != NULL && m_ListData.nItems != 0) {
pGetItemEnableData->bEnabled =
m_ListData.pItems[pGetItemEnableData->iItem].fEnabled;
}
bHandled = TRUE;
return S_OK;
}
//----------------------------------------------------------------------------------
// Handler for the button press message.
//----------------------------------------------------------------------------------
HRESULT CXuiControl4JComboBox::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, BOOL& rfHandled)
{
// This assumes all buttons can only be pressed with the A button
CScene_Base::HandleKeyPress(pNotifyPressData->UserIndex, VK_PAD_A);
if(hObjPressed==GetValueObject())
{
XuiElementSetShow(GetListObject(),TRUE);
XuiElementSetFocus(GetListObject());
rfHandled = TRUE;
}
return S_OK;
HRESULT CXuiControl4JComboBox::OnNotifyPressEx(HXUIOBJ hObjPressed,
XUINotifyPress* pNotifyPressData,
BOOL& rfHandled) {
// This assumes all buttons can only be pressed with the A button
CScene_Base::HandleKeyPress(pNotifyPressData->UserIndex, VK_PAD_A);
if (hObjPressed == GetValueObject()) {
XuiElementSetShow(GetListObject(), TRUE);
XuiElementSetFocus(GetListObject());
rfHandled = TRUE;
}
return S_OK;
}