本文整理汇总了C++中OptionsDialog::remove方法的典型用法代码示例。如果您正苦于以下问题:C++ OptionsDialog::remove方法的具体用法?C++ OptionsDialog::remove怎么用?C++ OptionsDialog::remove使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OptionsDialog
的用法示例。
在下文中一共展示了OptionsDialog::remove方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: show
void OptionsDialog::show() {
OptionsDialog *dlg = new OptionsDialog();
dlg->draw();
GfxButton *btn = dlg->execute();
if (btn == &dlg->_btnQuit) {
// Quit game
if (MessageDialog::show(QUIT_CONFIRM_MSG, CANCEL_BTN_STRING, QUIT_BTN_STRING) == 1) {
_vm->quitGame();
}
} else if (btn == &dlg->_btnRestart) {
// Restart game
_globals->_game->restartGame();
} else if (btn == &dlg->_btnSound) {
// Sound dialog
} else if (btn == &dlg->_btnSave) {
// Save button
_globals->_game->saveGame();
} else if (btn == &dlg->_btnRestore) {
// Restore button
_globals->_game->restoreGame();
}
dlg->remove();
delete dlg;
}
示例2: show
void OptionsDialog::show() {
OptionsDialog *dlg = new OptionsDialog();
dlg->draw();
// Show the dialog
GfxButton *btn = dlg->execute();
// Get which button was pressed
int btnIndex = -1;
if (btn == &dlg->_btnRestore)
btnIndex = 0;
else if (btn == &dlg->_btnSave)
btnIndex = 1;
else if (btn == &dlg->_btnRestart)
btnIndex = 2;
else if (btn == &dlg->_btnQuit)
btnIndex = 3;
else if (btn == &dlg->_btnSound)
btnIndex = 4;
// Close the dialog
dlg->remove();
delete dlg;
// Execute the given selection
if (btnIndex == 0) {
// Restore button
g_globals->_game->restoreGame();
} else if (btnIndex == 1) {
// Save button
g_globals->_game->saveGame();
} else if (btnIndex == 2) {
// Restart game
g_globals->_game->restartGame();
} else if (btnIndex == 3) {
// Quit game
if (MessageDialog::show(QUIT_CONFIRM_MSG, CANCEL_BTN_STRING, QUIT_BTN_STRING) == 1) {
g_vm->quitGame();
}
} else if (btnIndex == 4) {
// Sound dialog
SoundDialog::execute();
}
}