本文整理汇总了C++中CDXUTDialog::GetDefaultElement方法的典型用法代码示例。如果您正苦于以下问题:C++ CDXUTDialog::GetDefaultElement方法的具体用法?C++ CDXUTDialog::GetDefaultElement怎么用?C++ CDXUTDialog::GetDefaultElement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDXUTDialog
的用法示例。
在下文中一共展示了CDXUTDialog::GetDefaultElement方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InitApp
//--------------------------------------------------------------------------------------
// Initialize the app
//--------------------------------------------------------------------------------------
void InitApp()
{
// Initialize dialogs
g_SettingsDlg.Init( &g_DialogResourceManager );
g_HUD.Init( &g_DialogResourceManager );
g_SampleUI.Init( &g_DialogResourceManager );
g_HUD.SetCallback( OnGUIEvent ); int iY = 10;
g_HUD.AddButton( IDC_TOGGLEFULLSCREEN, L"Toggle full screen", 35, iY, 125, 22 );
g_HUD.AddButton( IDC_TOGGLEREF, L"Toggle REF (F3)", 35, iY += 24, 125, 22 );
g_HUD.AddButton( IDC_CHANGEDEVICE, L"Change device (F2)", 35, iY += 24, 125, 22, VK_F2 );
g_SampleUI.SetCallback( OnGUIEvent ); iY = 10;
// Title font for comboboxes
g_SampleUI.SetFont( 1, L"Arial", 14, FW_BOLD );
CDXUTElement* pElement = g_SampleUI.GetDefaultElement( DXUT_CONTROL_STATIC, 0 );
if( pElement )
{
pElement->iFont = 1;
pElement->dwTextFormat = DT_LEFT | DT_BOTTOM;
}
g_SampleUI.AddStatic( IDC_STATIC, L"(S)ubset", 20, 0, 105, 25 );
g_SampleUI.AddComboBox( IDC_SUBSET, 20, 25, 140, 24, 'S' );
g_SampleUI.AddButton( IDC_SAVETOX, L"Save Mesh To X file", 20, 50, 140, 24, 'X' );
}
示例2: InitApp
//--------------------------------------------------------------------------------------
// Initialize the app
//--------------------------------------------------------------------------------------
void InitApp()
{
// Initialize dialogs
g_SettingsDlg.Init( &g_DialogResourceManager );
g_HUD.Init( &g_DialogResourceManager );
g_SampleUI.Init( &g_DialogResourceManager );
g_HUD.SetCallback( OnGUIEvent ); int iY = 10;
g_HUD.AddButton( IDC_TOGGLEFULLSCREEN, L"Toggle full screen", 35, iY, 125, 22 );
g_HUD.AddButton( IDC_CHANGEDEVICE, L"Change device (F2)", 35, iY += 24, 125, 22, VK_F2 );
g_HUD.AddButton( IDC_TOGGLEREF, L"Toggle REF (F3)", 35, iY += 24, 125, 22, VK_F3 );
g_HUD.AddButton( IDC_TOGGLEWARP, L"Toggle WARP (F4)", 35, iY += 24, 125, 22, VK_F4 );
g_SampleUI.SetCallback( OnGUIEvent );
// Title font for comboboxes
g_SampleUI.SetFont( 1, L"Arial", 14, FW_BOLD );
CDXUTElement* pElement = g_SampleUI.GetDefaultElement( DXUT_CONTROL_STATIC, 0 );
if( pElement )
{
pElement->iFont = 1;
pElement->dwTextFormat = DT_LEFT | DT_BOTTOM;
}
int checkboxY = 0;
g_SampleUI.AddStatic( IDC_STATIC, L"(S)ubset", 20, checkboxY+=0, 105, 25 );
g_SampleUI.AddComboBox( IDC_SUBSET, 20, checkboxY+=25, 140, 24, 'S' );
g_SampleUI.AddStatic( IDC_STATIC, L"Scene (R)asterizer Mode", 20, checkboxY+=25, 105, 25 );
g_SampleUI.AddComboBox( IDC_SCENERASTERIZER_MODE, 20, checkboxY+=25, 140, 24, 'S' );
g_SampleUI.AddStatic( IDC_STATIC, L"AABB Levels", 20, checkboxY+=25, 105, 25 );
g_SampleUI.AddComboBox( IDC_AABBSUBLEVEL, 20, checkboxY+=25, 140, 24, 'S' );
}
示例3: InitApp
//--------------------------------------------------------------------------------------
// Initialize the app
//--------------------------------------------------------------------------------------
void InitApp()
{
//g_LightControl.SetLightDirection( D3DXVECTOR3(-0.29f, 0.557f, 0.778f) );
g_LightControl.SetLightDirection( D3DXVECTOR3( -0.789f, 0.527f, 0.316f ) );
g_LightControl.SetButtonMask( MOUSE_MIDDLE_BUTTON );
// Initialize dialogs
g_SettingsDlg.Init( &g_DialogResourceManager );
g_HUD.Init( &g_DialogResourceManager );
g_SampleUI.Init( &g_DialogResourceManager );
g_HUD.SetCallback( OnGUIEvent ); int iX = 15; int iY = 10;
g_HUD.AddButton( IDC_TOGGLEFULLSCREEN, L"Toggle full screen", iX, iY, 125, 22 );
g_HUD.AddButton( IDC_TOGGLEREF, L"Toggle REF (F3)", iX, iY += 24, 125, 22 );
g_HUD.AddButton( IDC_CHANGEDEVICE, L"Change device (F2)", iX, iY += 24, 125, 22, VK_F2 );
g_SampleUI.SetCallback( OnGUIEvent ); iX = 15; iY = 10;
// Title font for static
g_SampleUI.SetFont( 1, L"Arial", 14, FW_NORMAL );
CDXUTElement* pElement = g_SampleUI.GetDefaultElement( DXUT_CONTROL_STATIC, 0 );
if( pElement )
{
pElement->iFont = 1;
pElement->dwTextFormat = DT_RIGHT | DT_VCENTER;
}
// Technique
g_SampleUI.AddStatic( -1, L"Technique", iX, iY += 24, 115, 22 );
g_SampleUI.AddComboBox( IDC_TECHNIQUE, iX + 125, iY, 150, 22 );
g_SampleUI.GetComboBox( IDC_TECHNIQUE )->SetScrollBarWidth( 0 );
g_SampleUI.GetComboBox( IDC_TECHNIQUE )->AddItem( L"Local-deformable PRT", ( void* )"LDPRT" );
g_SampleUI.GetComboBox( IDC_TECHNIQUE )->AddItem( L"N dot L lighting", ( void* )"NdotL" );
// Animation speed
iY += 10;
g_SampleUI.AddStatic( -1, L"Animation Speed", iX, iY += 24, 115, 22 );
g_SampleUI.AddSlider( IDC_ANIMATION_SPEED, iX + 125, iY, 125, 22, 0, 3000, 700 );
// Light intensity
iY += 10;
g_SampleUI.AddStatic( -1, L"Light Intensity", iX, iY += 24, 115, 22 );
g_SampleUI.AddSlider( IDC_LIGHT_SLIDER, iX + 125, iY, 125, 22, 0, 1000, 500 );
g_SampleUI.AddStatic( IDC_ENV_LABEL, L"Env Intensity", iX, iY += 24, 115, 22 );
g_SampleUI.AddSlider( IDC_ENV_SLIDER, iX + 125, iY, 125, 22, 0, 3000, 600 );
// Color transmission
iY += 10;
g_SampleUI.AddStatic( IDC_RED_TRANSMIT_LABEL, L"Transmit Red", iX, iY += 24, 115, 22 );
g_SampleUI.AddSlider( IDC_RED_TRANSMIT_SLIDER, iX + 125, iY, 125, 22, 0, 3000, 1200 );
g_SampleUI.AddStatic( IDC_GREEN_TRANSMIT_LABEL, L"Transmit Green", iX, iY += 24, 115, 22 );
g_SampleUI.AddSlider( IDC_GREEN_TRANSMIT_SLIDER, iX + 125, iY, 125, 22, 0, 3000, 800 );
g_SampleUI.AddStatic( IDC_BLUE_TRANSMIT_LABEL, L"Transmit Blue", iX, iY += 24, 115, 22 );
g_SampleUI.AddSlider( IDC_BLUE_TRANSMIT_SLIDER, iX + 125, iY, 125, 22, 0, 3000, 350 );
}
示例4: RenderWinner
void RenderWinner(float fElapsedTime)
{
if(g_Board.pRenjuGame->winner == Black)
{
WCHAR strMessage[MAX_PATH] = L"The Black have won!";
CDXUTStatic* pStatic = NULL;
CDXUTElement* pElement = NULL;
pStatic = g_TheBlackWinnerDialog.GetStatic(IDC_THE_BLACK_WINNER_DIALOG);
if(pStatic != NULL)
{
pStatic->SetText(strMessage);
}
pElement = g_TheBlackWinnerDialog.GetDefaultElement(DXUT_CONTROL_STATIC, 0);
pElement->FontColor.Init(D3DCOLOR_ARGB(255, 255, 255, 255));
g_TheBlackWinnerDialog.OnRender(fElapsedTime);
}
else
{
if(g_Board.pRenjuGame->winner == White)
{
WCHAR strMessage[MAX_PATH] = L"The White have won!";
CDXUTStatic* pStatic = NULL;
CDXUTElement* pElement = NULL;
pStatic = g_TheWhiteWinnerDialog.GetStatic(IDC_THE_WHITE_WINNER_DIALOG);
if(pStatic != NULL)
{
pStatic->SetText(strMessage);
}
pElement = g_TheWhiteWinnerDialog.GetDefaultElement(DXUT_CONTROL_STATIC, 0);
pElement->FontColor.Init(D3DCOLOR_ARGB(255, 0, 0, 0));
g_TheWhiteWinnerDialog.OnRender(fElapsedTime);
}
}
}
示例5: InitApp
void InitApp()
{
g_HUD.Init(&g_DialogResourceManager);
g_SampleUI.Init(&g_DialogResourceManager);
g_WhiteArrowDialog.Init(&g_DialogResourceManager);
g_BlackArrowDialog.Init(&g_DialogResourceManager);
g_TheWhiteWinnerDialog.Init(&g_DialogResourceManager);
g_TheBlackWinnerDialog.Init(&g_DialogResourceManager);
g_HUD.SetCallback(OnGUIEvent); int iY = 10;
g_HUD.AddButton(IDC_TOGGLEFULLSCREEN, L"Toggle Full Screen", 35, iY, 125, 22);
g_HUD.AddButton(IDC_HIDECONSOLE, L"Console", 35, iY += 24, 125, 22);
g_HUD.AddButton(IDC_LAUNCH_RENJU_MANUAL, L"Manual", 35, iY += 24, 125, 22);
g_HUD.AddButton(IDC_RESETGAME, L"Start", 35, iY += 24, 125, 22);
g_SampleUI.AddRadioButton(IDC_GAMEMODE_HUMAN_HUMAN_RADIO, 1, L"Human - Human", 35, iY += 24, 220, 24, true, L'1');
g_SampleUI.AddRadioButton(IDC_GAMEMODE_AI_IS_BLACK_RADIO, 1, L"AI is Black", 35, iY += 24, 220, 24, false, L'2');
g_SampleUI.AddRadioButton(IDC_GAMEMODE_AI_IS_WHITE_RADIO, 1, L"AI is White", 35, iY += 24, 220, 24, false, L'3');
g_SampleUI.SetCallback(OnGUIEvent);
CDXUTStatic* pStatic = NULL;
CDXUTElement* pElement = g_WhiteArrowDialog.GetDefaultElement(DXUT_CONTROL_STATIC, 0);
if(pElement)
{
pElement->FontColor.Init(D3DCOLOR_ARGB(255, 255, 255, 255));
}
g_WhiteArrowDialog.SetSize(150, 100);
g_WhiteArrowDialog.SetBackgroundColors(D3DCOLOR_ARGB(0, 255, 255, 255), D3DCOLOR_ARGB(0, 255, 255, 255),
D3DCOLOR_ARGB(0, 255, 255, 255), D3DCOLOR_ARGB(0, 255, 255, 255));
g_WhiteArrowDialog.SetCallback(OnGUIEvent);
g_WhiteArrowDialog.SetFont(0, L"Arial", 120, FW_BOLD);
g_WhiteArrowDialog.AddStatic(IDC_WHITESCORE, L"2", 0, 0, g_WhiteArrowDialog.GetWidth(),
g_WhiteArrowDialog.GetHeight(), false, &pStatic);
pElement = g_BlackArrowDialog.GetDefaultElement(DXUT_CONTROL_STATIC, 0);
if(pElement)
{
pElement->FontColor.Init(D3DCOLOR_ARGB(255, 0, 0, 0));
}
g_BlackArrowDialog.SetSize(150, 100);
g_BlackArrowDialog.SetBackgroundColors(D3DCOLOR_ARGB(0, 16, 16, 16), D3DCOLOR_ARGB(0, 16, 16, 16),
D3DCOLOR_ARGB(0, 16, 16, 16), D3DCOLOR_ARGB(0, 16, 16, 16));
g_BlackArrowDialog.SetCallback(OnGUIEvent);
g_BlackArrowDialog.SetFont(0, L"Arial", 120, FW_BOLD);
g_BlackArrowDialog.AddStatic(IDC_BLACKSCORE, L"2", 0, 0, g_BlackArrowDialog.GetWidth(),
g_BlackArrowDialog.GetHeight(), false, &pStatic);
pElement = g_TheWhiteWinnerDialog.GetDefaultElement(DXUT_CONTROL_STATIC, 0);
if(pElement)
{
pElement->FontColor.Init(D3DCOLOR_ARGB(255, 255, 255, 255));
}
pElement = g_TheWhiteWinnerDialog.GetDefaultElement(DXUT_CONTROL_STATIC, 0);
g_TheWhiteWinnerDialog.SetSize(500, 100);
g_TheWhiteWinnerDialog.SetBackgroundColors(D3DCOLOR_ARGB(0, 16, 16, 16), D3DCOLOR_ARGB(0, 16, 16, 16),
D3DCOLOR_ARGB(0, 16, 16, 16), D3DCOLOR_ARGB(0, 16, 16, 16));
g_TheWhiteWinnerDialog.SetCallback(OnGUIEvent);
g_TheWhiteWinnerDialog.SetFont(0, L"Arial", 60, FW_BOLD);
g_TheWhiteWinnerDialog.AddStatic(IDC_THE_WHITE_WINNER_DIALOG, L"2", 0, 0, g_TheWhiteWinnerDialog.GetWidth(),
g_TheWhiteWinnerDialog.GetHeight(), false, &pStatic);
pElement = g_TheBlackWinnerDialog.GetDefaultElement(DXUT_CONTROL_STATIC, 0);
if(pElement)
{
pElement->FontColor.Init(D3DCOLOR_ARGB(255, 0, 0, 0));
}
pElement = g_TheBlackWinnerDialog.GetDefaultElement(DXUT_CONTROL_STATIC, 0);
g_TheBlackWinnerDialog.SetSize(500, 100);
g_TheBlackWinnerDialog.SetBackgroundColors(D3DCOLOR_ARGB(0, 16, 16, 16), D3DCOLOR_ARGB(0, 16, 16, 16),
D3DCOLOR_ARGB(0, 16, 16, 16), D3DCOLOR_ARGB(0, 16, 16, 16));
g_TheBlackWinnerDialog.SetCallback(OnGUIEvent);
g_TheBlackWinnerDialog.SetFont(0, L"Arial", 60, FW_BOLD);
g_TheBlackWinnerDialog.AddStatic(IDC_THE_BLACK_WINNER_DIALOG, L"2", 0, 0, g_TheBlackWinnerDialog.GetWidth(),
g_TheBlackWinnerDialog.GetHeight(), false, &pStatic);
}