Game Development Reference
In-Depth Information
m_UI.AddButton( IDOK, g_pApp->GetString(IDS_OK).c_str(),
iX, iY - border, btnWidth, btnHeight );
m_UI.AddButton( IDCANCEL, g_pApp->GetString(IDS_CANCEL).c_str(),
iX, iY, btnWidth, btnHeight );
}
else if (buttonFlags == MB_RETRYCANCEL)
{
//The message box contains two push buttons: Retry and Cancel.
m_UI.AddButton( IDRETRY, g_pApp->GetString(IDS_RETRY).c_str(),
iX, iY - border, btnWidth, btnHeight );
m_UI.AddButton( IDCANCEL, g_pApp->GetString(IDS_CANCEL).c_str(),
iX, iY, btnWidth, btnHeight );
}
else if (buttonFlags == MB_YESNO)
{
//The message box contains two push buttons: Yes and No.
m_UI.AddButton( IDYES, g_pApp->GetString(IDS_YES).c_str(),
iX, iY - border, btnWidth, btnHeight );
m_UI.AddButton( IDNO, g_pApp->GetString(IDS_NO).c_str(),
iX, iY, btnWidth, btnHeight );
}
else if (buttonFlags == MB_YESNOCANCEL)
{
//The message box contains three push buttons: Yes, No, and Cancel.
m_UI.AddButton( IDYES, g_pApp->GetString(IDS_YES).c_str(),
iX, iY - (2*border), btnWidth, btnHeight );
m_UI.AddButton( IDNO, g_pApp->GetString(IDS_NO).c_str(),
iX, iY - border, btnWidth, btnHeight );
m_UI.AddButton( IDCANCEL, g_pApp->GetString(IDS_CANCEL).c_str(),
iX, iY, btnWidth, btnHeight );
}
else //if (buttonFlags & MB_OK)
{
// The message box contains one push button: OK. This is the default.
m_UI.AddButton( IDOK, g_pApp->GetString(IDS_OK).c_str(),
iX, iY, btnWidth, btnHeight );
}
}
DXUT needs two bits of homework to get started. First, the m_UI member is initialized
with a pointer to the global dialog resource manager. Next, a callback function is set. On
every game user interface I
s some mechanism for a control to
send a message to the screen that it has been clicked on or otherwise messed with. The
OnGuiEvent() will trap those events so you can see which button was clicked.
'
ve ever worked on, there
'
Search WWH ::




Custom Search