[saco] Implement CDXUTDialog::GetNextControl(...)

This commit is contained in:
RD42 2024-05-24 23:09:12 +08:00
parent 937495a9b8
commit 92f47f526f
2 changed files with 21 additions and 0 deletions

View File

@ -372,6 +372,25 @@ CDXUTControl* CDXUTDialog::GetControl( int ID, UINT nControlType )
//--------------------------------------------------------------------------------------
CDXUTControl* CDXUTDialog::GetNextControl( CDXUTControl* pControl )
{
int index = pControl->m_Index + 1;
CDXUTDialog* pDialog = pControl->m_pDialog;
// Cycle through dialogs in the loop to find the next control. Note
// that if only one control exists in all looped dialogs it will
// be the returned 'next' control.
while( index >= (int) pDialog->m_Controls.GetSize() )
{
pDialog = pDialog->m_pNextDialog;
index = 0;
}
return pDialog->m_Controls.GetAt( index );
}
//--------------------------------------------------------------------------------------
// CDXUTControl class
//--------------------------------------------------------------------------------------

View File

@ -101,6 +101,8 @@ public:
// Methods called by controls
void SendEvent( UINT nEvent, bool bTriggeredByUser, CDXUTControl* pControl );
static CDXUTControl* GetNextControl( CDXUTControl* pControl );
void RemoveAllControls();
// Sets the callback used to notify the app of control events