--------------------------------------------------------------------------------------
| 1221 | |
| 1222 | //-------------------------------------------------------------------------------------- |
| 1223 | _Use_decl_annotations_ |
| 1224 | HRESULT CDXUTDialog::AddButton( int ID, LPCWSTR strText, int x, int y, int width, int height, UINT nHotkey, |
| 1225 | bool bIsDefault, CDXUTButton** ppCreated ) |
| 1226 | { |
| 1227 | HRESULT hr = S_OK; |
| 1228 | |
| 1229 | auto pButton = new (std::nothrow) CDXUTButton( this ); |
| 1230 | |
| 1231 | if( ppCreated ) |
| 1232 | *ppCreated = pButton; |
| 1233 | |
| 1234 | if( !pButton ) |
| 1235 | return E_OUTOFMEMORY; |
| 1236 | |
| 1237 | hr = AddControl( pButton ); |
| 1238 | if( FAILED( hr ) ) |
| 1239 | return hr; |
| 1240 | |
| 1241 | // Set the ID and list index |
| 1242 | pButton->SetID( ID ); |
| 1243 | pButton->SetText( strText ); |
| 1244 | pButton->SetLocation( x, y ); |
| 1245 | pButton->SetSize( width, height ); |
| 1246 | pButton->SetHotkey( nHotkey ); |
| 1247 | pButton->m_bIsDefault = bIsDefault; |
| 1248 | |
| 1249 | return S_OK; |
| 1250 | } |
| 1251 | |
| 1252 | |
| 1253 | //-------------------------------------------------------------------------------------- |
no test coverage detected