diff options
author | Max Horn | 2010-05-26 19:54:50 +0000 |
---|---|---|
committer | Max Horn | 2010-05-26 19:54:50 +0000 |
commit | 947edd08c3b60ec873fcc6c922ef4ebb34ba2305 (patch) | |
tree | cdd32b9f1a079f3da714e0b64204cf901c685d1e /engines/dialogs.cpp | |
parent | db475d1501452490ab4e95ecbd181380b0bec414 (diff) | |
download | scummvm-rg350-947edd08c3b60ec873fcc6c922ef4ebb34ba2305.tar.gz scummvm-rg350-947edd08c3b60ec873fcc6c922ef4ebb34ba2305.tar.bz2 scummvm-rg350-947edd08c3b60ec873fcc6c922ef4ebb34ba2305.zip |
Replace SCUMM F5 dialog by GMM & add help button to GMM
The new "Help" button in the GMM is currently only used by SCUMM.
To use it, an engine currently needs to subclass MainMenuDialog.
svn-id: r49249
Diffstat (limited to 'engines/dialogs.cpp')
-rw-r--r-- | engines/dialogs.cpp | 45 |
1 files changed, 28 insertions, 17 deletions
diff --git a/engines/dialogs.cpp b/engines/dialogs.cpp index 73ba591b4b..954bc81470 100644 --- a/engines/dialogs.cpp +++ b/engines/dialogs.cpp @@ -35,8 +35,9 @@ #include "gui/GuiManager.h" #include "gui/launcher.h" #include "gui/ListWidget.h" -#include "gui/ThemeEval.h" +#include "gui/options.h" #include "gui/saveload.h" +#include "gui/ThemeEval.h" #include "engines/dialogs.h" #include "engines/engine.h" @@ -49,16 +50,17 @@ using GUI::CommandSender; using GUI::StaticTextWidget; -enum { - kSaveCmd = 'SAVE', - kLoadCmd = 'LOAD', - kPlayCmd = 'PLAY', - kOptionsCmd = 'OPTN', - kHelpCmd = 'HELP', - kAboutCmd = 'ABOU', - kQuitCmd = 'QUIT', - kRTLCmd = 'RTL ', - kChooseCmd = 'CHOS' +class ConfigDialog : public GUI::OptionsDialog { +protected: +#ifdef SMALL_SCREEN_DEVICE + GUI::Dialog *_keysDialog; +#endif + +public: + ConfigDialog(bool subtitleControls); + ~ConfigDialog(); + + virtual void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data); }; MainMenuDialog::MainMenuDialog(Engine *engine) @@ -95,6 +97,12 @@ MainMenuDialog::MainMenuDialog(Engine *engine) new GUI::ButtonWidget(this, "GlobalMenu.Options", "Options", kOptionsCmd, 'O'); + // The help button is disabled by default. + // To enable "Help", an engine needs to use a subclass of MainMenuDialog + // (at least for now, we might change how this works in the future). + _helpButton = new GUI::ButtonWidget(this, "GlobalMenu.Help", "Help", kHelpCmd, 'H'); + _helpButton->setEnabled(false); + new GUI::ButtonWidget(this, "GlobalMenu.About", "About", kAboutCmd, 'A'); _rtlButton = new GUI::ButtonWidget(this, "GlobalMenu.RTL", "Return to Launcher", kRTLCmd, 'R'); @@ -135,6 +143,9 @@ void MainMenuDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat case kAboutCmd: _aboutDialog->runModal(); break; + case kHelpCmd: + // Not handled here -- needs to be handled by a subclass (for now) + break; case kRTLCmd: { Common::Event eventRTL; eventRTL.type = Common::EVENT_RTL; @@ -263,13 +274,13 @@ enum { // "" as value for the domain, and in fact provide a somewhat better user // experience at the same time. ConfigDialog::ConfigDialog(bool subtitleControls) - : GUI::OptionsDialog("", "ScummConfig") { + : GUI::OptionsDialog("", "GlobalConfig") { // // Sound controllers // - addVolumeControls(this, "ScummConfig."); + addVolumeControls(this, "GlobalConfig."); setVolumeSettingsState(true); // could disable controls by GUI options // @@ -278,7 +289,7 @@ ConfigDialog::ConfigDialog(bool subtitleControls) if (subtitleControls) { // Global talkspeed range of 0-255 - addSubtitleControls(this, "ScummConfig.", 255); + addSubtitleControls(this, "GlobalConfig.", 255); setSubtitleSettingsState(true); // could disable controls by GUI options } @@ -286,11 +297,11 @@ ConfigDialog::ConfigDialog(bool subtitleControls) // Add the buttons // - new GUI::ButtonWidget(this, "ScummConfig.Ok", "OK", GUI::kOKCmd, 'O'); - new GUI::ButtonWidget(this, "ScummConfig.Cancel", "Cancel", GUI::kCloseCmd, 'C'); + new GUI::ButtonWidget(this, "GlobalConfig.Ok", "OK", GUI::kOKCmd, 'O'); + new GUI::ButtonWidget(this, "GlobalConfig.Cancel", "Cancel", GUI::kCloseCmd, 'C'); #ifdef SMALL_SCREEN_DEVICE - new GUI::ButtonWidget(this, "ScummConfig.Keys", "Keys", kKeysCmd, 'K'); + new GUI::ButtonWidget(this, "GlobalConfig.Keys", "Keys", kKeysCmd, 'K'); _keysDialog = NULL; #endif } |