From d011509921c8e5903a3e4b52f640982d40593bc4 Mon Sep 17 00:00:00 2001 From: ricardoofnl Date: Sun, 30 Aug 2026 16:52:56 +0700 Subject: [PATCH] [saco] Implement/match `CDXUTListBox::InsertItem` --- saco/d3d9/common/DXUTgui.cpp | 3 ++- saco/d3d9/common/DXUTgui.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/saco/d3d9/common/DXUTgui.cpp b/saco/d3d9/common/DXUTgui.cpp index 602e58d..2f59e8f 100644 --- a/saco/d3d9/common/DXUTgui.cpp +++ b/saco/d3d9/common/DXUTgui.cpp @@ -4288,7 +4288,7 @@ HRESULT CDXUTListBox::AddItem( const TCHAR *wszText, void *pData, D3DCOLOR TextC //-------------------------------------------------------------------------------------- -HRESULT CDXUTListBox::InsertItem( int nIndex, const TCHAR *wszText, void *pData ) +HRESULT CDXUTListBox::InsertItem( int nIndex, const TCHAR *wszText, void *pData, D3DCOLOR TextColor ) { DXUTListBoxItem *pNewItem = new DXUTListBoxItem; if( !pNewItem ) @@ -4298,6 +4298,7 @@ HRESULT CDXUTListBox::InsertItem( int nIndex, const TCHAR *wszText, void *pData pNewItem->pData = pData; SetRect( &pNewItem->rcActive, 0, 0, 0, 0 ); pNewItem->bSelected = false; + pNewItem->TextColor = TextColor; HRESULT hr = m_Items.Insert( nIndex, pNewItem ); if( SUCCEEDED( hr ) ) diff --git a/saco/d3d9/common/DXUTgui.h b/saco/d3d9/common/DXUTgui.h index cd4d3eb..7bf0cdb 100644 --- a/saco/d3d9/common/DXUTgui.h +++ b/saco/d3d9/common/DXUTgui.h @@ -625,7 +625,7 @@ public: void SetScrollBarWidth( int nWidth ) { m_nSBWidth = nWidth; UpdateRects(); } void SetBorder( int nBorder, int nMargin ) { m_nBorder = nBorder; m_nMargin = nMargin; } HRESULT AddItem( const TCHAR *wszText, void *pData, D3DCOLOR TextColor ); - HRESULT InsertItem( int nIndex, const TCHAR *wszText, void *pData ); + HRESULT InsertItem( int nIndex, const TCHAR *wszText, void *pData, D3DCOLOR TextColor ); void RemoveItem( int nIndex ); void RemoveItemByText( TCHAR *wszText ); void RemoveItemByData( void *pData );