MCPcopy Create free account
hub / github.com/GPUOpen-Effects/GeometryFX / AddButton

Method AddButton

framework/d3d11/dxut/Optional/DXUTgui.cpp:1223–1250  ·  view source on GitHub ↗

--------------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

1221
1222//--------------------------------------------------------------------------------------
1223_Use_decl_annotations_
1224HRESULT 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//--------------------------------------------------------------------------------------

Callers 3

InitAppMethod · 0.80
CreateControlsMethod · 0.80
InitAppFunction · 0.80

Calls 5

SetIDMethod · 0.80
SetTextMethod · 0.80
SetHotkeyMethod · 0.80
SetLocationMethod · 0.45
SetSizeMethod · 0.45

Tested by

no test coverage detected