mirror of
https://github.com/dashr9230/SA-MP.git
synced 2025-01-11 11:32:35 +08:00
[saco] Implement CDXUTDialog::GetControl(...)
This commit is contained in:
parent
66cb7f0290
commit
937495a9b8
@ -332,6 +332,46 @@ HRESULT CDXUTDialog::AddControl( CDXUTControl* pControl )
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
CDXUTControl* CDXUTDialog::GetControl( int ID )
|
||||
{
|
||||
// Try to find the control with the given ID
|
||||
for( int i=0; i < m_Controls.GetSize(); i++ )
|
||||
{
|
||||
CDXUTControl* pControl = m_Controls.GetAt( i );
|
||||
|
||||
if( pControl->GetID() == ID )
|
||||
{
|
||||
return pControl;
|
||||
}
|
||||
}
|
||||
|
||||
// Not found
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
CDXUTControl* CDXUTDialog::GetControl( int ID, UINT nControlType )
|
||||
{
|
||||
// Try to find the control with the given ID
|
||||
for( int i=0; i < m_Controls.GetSize(); i++ )
|
||||
{
|
||||
CDXUTControl* pControl = m_Controls.GetAt( i );
|
||||
|
||||
if( pControl->GetID() == ID && pControl->GetType() == nControlType )
|
||||
{
|
||||
return pControl;
|
||||
}
|
||||
}
|
||||
|
||||
// Not found
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// CDXUTControl class
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
@ -94,6 +94,9 @@ public:
|
||||
HRESULT AddControl( CDXUTControl* pControl );
|
||||
HRESULT InitControl( CDXUTControl* pControl );
|
||||
|
||||
CDXUTControl* GetControl( int ID );
|
||||
CDXUTControl* GetControl( int ID, UINT nControlType );
|
||||
|
||||
|
||||
// Methods called by controls
|
||||
void SendEvent( UINT nEvent, bool bTriggeredByUser, CDXUTControl* pControl );
|
||||
|
Loading…
x
Reference in New Issue
Block a user