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

This commit is contained in:
RD42
2024-05-24 23:05:44 +08:00
parent 87488b7d52
commit 0c26d699c2
2 changed files with 28 additions and 0 deletions
+26
View File
@@ -286,6 +286,32 @@ DXUTFontNode* CDXUTDialog::GetFont( UINT index )
return m_pManager->GetFontNode( m_Fonts.GetAt( index ) );
}
//--------------------------------------------------------------------------------------
HRESULT CDXUTDialog::InitControl( CDXUTControl* pControl )
{
HRESULT hr;
if( pControl == NULL )
return E_INVALIDARG;
pControl->m_Index = m_Controls.GetSize();
// Look for a default Element entries
for( int i=0; i < m_DefaultElements.GetSize(); i++ )
{
DXUTElementHolder* pElementHolder = m_DefaultElements.GetAt( i );
if( pElementHolder->nControlType == pControl->GetType() )
pControl->SetElement( pElementHolder->iElement, &pElementHolder->Element );
}
V_RETURN( pControl->OnInit() );
return S_OK;
}
//--------------------------------------------------------------------------------------
// CDXUTControl class
//--------------------------------------------------------------------------------------
+2
View File
@@ -91,6 +91,8 @@ public:
CDXUTDialog();
~CDXUTDialog();
HRESULT InitControl( CDXUTControl* pControl );
// Methods called by controls
void SendEvent( UINT nEvent, bool bTriggeredByUser, CDXUTControl* pControl );