mirror of
https://github.com/dashr9230/SA-MP.git
synced 2024-12-22 14:37:29 +08:00
[saco] Implement CDXUTDialog::GetPrevControl(...)
This commit is contained in:
parent
92f47f526f
commit
eb2876272f
@ -11,6 +11,10 @@
|
||||
#undef min // use __min instead
|
||||
#undef max // use __max instead
|
||||
|
||||
double CDXUTDialog::s_fTimeRefresh = 0.0f;
|
||||
CDXUTControl* CDXUTDialog::s_pControlFocus = NULL; // The control which has focus
|
||||
CDXUTControl* CDXUTDialog::s_pControlPressed = NULL; // The control currently pressed
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// CDXUTDialog class
|
||||
//--------------------------------------------------------------------------------------
|
||||
@ -391,6 +395,29 @@ CDXUTControl* CDXUTDialog::GetNextControl( CDXUTControl* pControl )
|
||||
return pDialog->m_Controls.GetAt( index );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
CDXUTControl* CDXUTDialog::GetPrevControl( 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 'previous' control.
|
||||
while( index < 0 )
|
||||
{
|
||||
pDialog = pDialog->m_pPrevDialog;
|
||||
if( pDialog == NULL )
|
||||
pDialog = pControl->m_pDialog;
|
||||
|
||||
index = pDialog->m_Controls.GetSize() - 1;
|
||||
}
|
||||
|
||||
return pDialog->m_Controls.GetAt( index );
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// CDXUTControl class
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
@ -103,6 +103,8 @@ public:
|
||||
|
||||
|
||||
static CDXUTControl* GetNextControl( CDXUTControl* pControl );
|
||||
static CDXUTControl* GetPrevControl( CDXUTControl* pControl );
|
||||
|
||||
void RemoveAllControls();
|
||||
|
||||
// Sets the callback used to notify the app of control events
|
||||
@ -128,6 +130,8 @@ private:
|
||||
static double s_fTimeRefresh;
|
||||
double m_fTimeLastRefresh;
|
||||
|
||||
static CDXUTControl* s_pControlFocus; // The control which has focus
|
||||
static CDXUTControl* s_pControlPressed; // The control currently pressed
|
||||
|
||||
CDXUTControl* m_pControlMouseOver; // The control which is hovered over
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user