[saco] Implement CDXUTDialog::RemoveAllControls()

This commit is contained in:
RD42 2024-05-24 22:45:01 +08:00
parent 7ad9b52673
commit b3ff5fd8aa
2 changed files with 21 additions and 0 deletions

View File

@ -86,6 +86,26 @@ void CDXUTDialog::SetCallback( PCALLBACKDXUTGUIEVENT pCallback, void* pUserConte
}
//--------------------------------------------------------------------------------------
void CDXUTDialog::RemoveAllControls()
{
if( s_pControlFocus && s_pControlFocus->m_pDialog == this )
s_pControlFocus = NULL;
if( s_pControlPressed && s_pControlPressed->m_pDialog == this )
s_pControlPressed = NULL;
m_pControlMouseOver = NULL;
for( int i=0; i < m_Controls.GetSize(); i++ )
{
CDXUTControl* pControl = m_Controls.GetAt( i );
SAFE_DELETE( pControl );
}
m_Controls.RemoveAll();
}
//--------------------------------------------------------------------------------------
CDXUTDialogResourceManager::CDXUTDialogResourceManager()
{
m_pd3dDevice = NULL;

View File

@ -91,6 +91,7 @@ public:
CDXUTDialog();
~CDXUTDialog();
void RemoveAllControls();
// Sets the callback used to notify the app of control events
void SetCallback( PCALLBACKDXUTGUIEVENT pCallback, void* pUserContext = NULL );