diff options
author | Max Horn | 2010-04-06 09:26:43 +0000 |
---|---|---|
committer | Max Horn | 2010-04-06 09:26:43 +0000 |
commit | 894e2aefe6042cea38b93439812193f8ceb8356b (patch) | |
tree | 7295f1cba5168928151bbee324cb5db1ab772ae1 | |
parent | 745edbadc7b3841556c2e8962725bfd3de8a4dd3 (diff) | |
download | scummvm-rg350-894e2aefe6042cea38b93439812193f8ceb8356b.tar.gz scummvm-rg350-894e2aefe6042cea38b93439812193f8ceb8356b.tar.bz2 scummvm-rg350-894e2aefe6042cea38b93439812193f8ceb8356b.zip |
GUI: Unify various definitions of kOKCmd and move it to namespace GUI
svn-id: r48564
-rw-r--r-- | engines/dialogs.cpp | 9 | ||||
-rw-r--r-- | engines/mohawk/dialogs.cpp | 13 | ||||
-rw-r--r-- | engines/scumm/dialogs.cpp | 11 | ||||
-rw-r--r-- | gui/KeysDialog.cpp | 3 | ||||
-rw-r--r-- | gui/dialog.h | 3 | ||||
-rw-r--r-- | gui/options.h | 4 |
6 files changed, 14 insertions, 29 deletions
diff --git a/engines/dialogs.cpp b/engines/dialogs.cpp index cd42c2a23d..73ba591b4b 100644 --- a/engines/dialogs.cpp +++ b/engines/dialogs.cpp @@ -48,7 +48,6 @@ using GUI::CommandSender; using GUI::StaticTextWidget; -using GUI::kCloseCmd; enum { kSaveCmd = 'SAVE', @@ -235,10 +234,6 @@ void MainMenuDialog::load() { } enum { - kOKCmd = 'ok ' -}; - -enum { kKeysCmd = 'KEYS' }; @@ -291,8 +286,8 @@ ConfigDialog::ConfigDialog(bool subtitleControls) // Add the buttons // - new GUI::ButtonWidget(this, "ScummConfig.Ok", "OK", GUI::OptionsDialog::kOKCmd, 'O'); - new GUI::ButtonWidget(this, "ScummConfig.Cancel", "Cancel", kCloseCmd, 'C'); + new GUI::ButtonWidget(this, "ScummConfig.Ok", "OK", GUI::kOKCmd, 'O'); + new GUI::ButtonWidget(this, "ScummConfig.Cancel", "Cancel", GUI::kCloseCmd, 'C'); #ifdef SMALL_SCREEN_DEVICE new GUI::ButtonWidget(this, "ScummConfig.Keys", "Keys", kKeysCmd, 'K'); diff --git a/engines/mohawk/dialogs.cpp b/engines/mohawk/dialogs.cpp index a1264f5f2e..c80c12f053 100644 --- a/engines/mohawk/dialogs.cpp +++ b/engines/mohawk/dialogs.cpp @@ -71,7 +71,6 @@ void PauseDialog::handleKeyDown(Common::KeyState state) { } enum { - kCloseCmd = 'CLOS', kZipCmd = 'ZIPM', kTransCmd = 'TRAN', kWaterCmd = 'WATR' @@ -81,8 +80,8 @@ MystOptionsDialog::MystOptionsDialog(MohawkEngine_Myst* vm) : GUI::OptionsDialog _zipModeCheckbox = new GUI::CheckboxWidget(this, 15, 10, 300, 15, "Zip Mode Activated", kZipCmd, 'Z'); _transistionsCheckbox = new GUI::CheckboxWidget(this, 15, 30, 300, 15, "Transistions Enabled", kTransCmd, 'T'); - new GUI::ButtonWidget(this, 95, 160, 120, 25, "OK", GUI::OptionsDialog::kOKCmd, 'O'); - new GUI::ButtonWidget(this, 225, 160, 120, 25, "Cancel", kCloseCmd, 'C'); + new GUI::ButtonWidget(this, 95, 160, 120, 25, "OK", GUI::kOKCmd, 'O'); + new GUI::ButtonWidget(this, 225, 160, 120, 25, "Cancel", GUI::kCloseCmd, 'C'); } MystOptionsDialog::~MystOptionsDialog() { @@ -103,7 +102,7 @@ void MystOptionsDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd, ui case kTransCmd: _vm->_transitionsEnabled = _transistionsCheckbox->getState(); break; - case kCloseCmd: + case GUI::kCloseCmd: close(); break; default: @@ -115,8 +114,8 @@ RivenOptionsDialog::RivenOptionsDialog(MohawkEngine_Riven* vm) : GUI::OptionsDia _zipModeCheckbox = new GUI::CheckboxWidget(this, 15, 10, 300, 15, "Zip Mode Activated", kZipCmd, 'Z'); _waterEffectCheckbox = new GUI::CheckboxWidget(this, 15, 30, 300, 15, "Water Effect Enabled", kWaterCmd, 'W'); - new GUI::ButtonWidget(this, 95, 160, 120, 25, "OK", GUI::OptionsDialog::kOKCmd, 'O'); - new GUI::ButtonWidget(this, 225, 160, 120, 25, "Cancel", kCloseCmd, 'C'); + new GUI::ButtonWidget(this, 95, 160, 120, 25, "OK", GUI::kOKCmd, 'O'); + new GUI::ButtonWidget(this, 225, 160, 120, 25, "Cancel", GUI::kCloseCmd, 'C'); } RivenOptionsDialog::~RivenOptionsDialog() { @@ -137,7 +136,7 @@ void RivenOptionsDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd, u case kWaterCmd: *_vm->matchVarToString("waterenabled") = _waterEffectCheckbox->getState() ? 1 : 0; break; - case kCloseCmd: + case GUI::kCloseCmd: close(); break; default: diff --git a/engines/scumm/dialogs.cpp b/engines/scumm/dialogs.cpp index e0a70d80fe..1f153094c1 100644 --- a/engines/scumm/dialogs.cpp +++ b/engines/scumm/dialogs.cpp @@ -59,7 +59,6 @@ using GUI::CommandSender; using GUI::StaticTextWidget; -using GUI::kCloseCmd; using Graphics::kTextAlignCenter; using Graphics::kTextAlignLeft; using GUI::WIDGET_ENABLED; @@ -391,10 +390,6 @@ void ScummMenuDialog::load() { #pragma mark - enum { - kOKCmd = 'ok ' -}; - -enum { kKeysCmd = 'KEYS' }; @@ -443,8 +438,8 @@ ConfigDialog::ConfigDialog() // Add the buttons // - new GUI::ButtonWidget(this, "ScummConfig.Ok", "OK", GUI::OptionsDialog::kOKCmd, 'O'); - new GUI::ButtonWidget(this, "ScummConfig.Cancel", "Cancel", kCloseCmd, 'C'); + new GUI::ButtonWidget(this, "ScummConfig.Ok", "OK", GUI::kOKCmd, 'O'); + new GUI::ButtonWidget(this, "ScummConfig.Cancel", "Cancel", GUI::kCloseCmd, 'C'); #ifdef SMALL_SCREEN_DEVICE new GUI::ButtonWidget(this, "ScummConfig.Keys", "Keys", kKeysCmd, 'K'); _keysDialog = NULL; @@ -495,7 +490,7 @@ HelpDialog::HelpDialog(const GameSettings &game) _prevButton = new GUI::ButtonWidget(this, "ScummHelp.Prev", "Previous", kPrevCmd, 'P'); _nextButton = new GUI::ButtonWidget(this, "ScummHelp.Next", "Next", kNextCmd, 'N'); - new GUI::ButtonWidget(this, "ScummHelp.Close", "Close", kCloseCmd, 'C'); + new GUI::ButtonWidget(this, "ScummHelp.Close", "Close", GUI::kCloseCmd, 'C'); _prevButton->clearFlags(WIDGET_ENABLED); _numLines = HELP_NUM_LINES; diff --git a/gui/KeysDialog.cpp b/gui/KeysDialog.cpp index 103ae918ef..b80dd200bb 100644 --- a/gui/KeysDialog.cpp +++ b/gui/KeysDialog.cpp @@ -34,8 +34,7 @@ namespace GUI { enum { - kMapCmd = 'map ', - kOKCmd = 'ok ' + kMapCmd = 'map ' }; KeysDialog::KeysDialog(const Common::String &title) diff --git a/gui/dialog.h b/gui/dialog.h index dcc7d6fe27..5008f272ba 100644 --- a/gui/dialog.h +++ b/gui/dialog.h @@ -38,7 +38,8 @@ class PopUpWidget; // Some "common" commands sent to handleCommand() enum { - kCloseCmd = 'clos' + kCloseCmd = 'clos', + kOKCmd = 'ok ' }; class Dialog : public GuiObject { diff --git a/gui/options.h b/gui/options.h index 13803aee77..fa1f4dfb02 100644 --- a/gui/options.h +++ b/gui/options.h @@ -57,10 +57,6 @@ public: virtual void reflowLayout(); - enum { - kOKCmd = 'ok ' - }; - protected: /** Config domain this dialog is used to edit. */ String _domain; |