diff options
author | Max Horn | 2003-11-03 00:24:04 +0000 |
---|---|---|
committer | Max Horn | 2003-11-03 00:24:04 +0000 |
commit | af71b2f309a07eba9f1554858da2fe37bd1f3897 (patch) | |
tree | 953c7c3dfe84a16c0e0e657380958b05e3b5a4a5 | |
parent | 528c9f45137b8e6b51421f0218e762d14af44129 (diff) | |
download | scummvm-rg350-af71b2f309a07eba9f1554858da2fe37bd1f3897.tar.gz scummvm-rg350-af71b2f309a07eba9f1554858da2fe37bd1f3897.tar.bz2 scummvm-rg350-af71b2f309a07eba9f1554858da2fe37bd1f3897.zip |
use TabWidget for GlobalOptionsDialog
svn-id: r11073
-rw-r--r-- | TODO | 3 | ||||
-rw-r--r-- | gui/launcher.cpp | 7 | ||||
-rw-r--r-- | gui/options.cpp | 79 |
3 files changed, 56 insertions, 33 deletions
@@ -48,11 +48,10 @@ Documentation GUI === -* Implement "tabs" for multi-pane prefs dialog - -> could also be used by the Scumm help dialog in scumm/help.cpp * LAUNCHER: fix global options dialog to be properly persistent * LAUNCHER: add more options to global options dialog * LAUNCHER: add more options to game target options dialog +* Maybe make use of TabWidget in the Scumm help dialog? * Global & game target options dialogs probably could share some "panes" -> write code allowing this -> also, 'in game' option dialogs (for volume/scaler/etc. settings) diff --git a/gui/launcher.cpp b/gui/launcher.cpp index 18b0e8a000..ead4891d25 100644 --- a/gui/launcher.cpp +++ b/gui/launcher.cpp @@ -29,7 +29,6 @@ #include "gui/options.h" #include "gui/EditTextWidget.h" #include "gui/ListWidget.h" -#include "gui/TabWidget.h" #include "backends/fs/fs.h" @@ -175,13 +174,7 @@ LauncherDialog::LauncherDialog(GameDetector &detector) new ButtonWidget(this, x, _h - 24, width, 16, "Start", kStartCmd, 'S'); x += space + width; // Add list with game titles -#if 0 - // HACK HACK HACK FIXME - new TabWidget(this, 0, 76, 320, 64); - _list = new ListWidget(this, 10, 28, 300, 46); -#else _list = new ListWidget(this, 10, 28, 300, 112); -#endif _list->setEditable(false); _list->setNumberingMode(kListNumberingOff); diff --git a/gui/options.cpp b/gui/options.cpp index 4f8582af0a..6572132239 100644 --- a/gui/options.cpp +++ b/gui/options.cpp @@ -24,6 +24,7 @@ #include "gui/newgui.h" #include "gui/options.h" #include "gui/PopUpWidget.h" +#include "gui/TabWidget.h" #include "backends/fs/fs.h" #include "base/gameDetector.h" @@ -62,12 +63,23 @@ enum { }; GlobalOptionsDialog::GlobalOptionsDialog(GameDetector &detector) - : Dialog(10, 15, 320 - 2 * 10, 200 - 2 * 15) { + : Dialog(10, 20, 320 - 2 * 10, 200 - 2 * 20) { + + const int vBorder = 5; + + // The tab widget + TabWidget *tab = new TabWidget(this, 0, vBorder, _w, _h - 24 - 2*vBorder); + + // + // 1) The graphics tab + // + tab->addTab("Graphics"); + // The GFX mode popup & a label // TODO - add an API to query the list of available GFX modes, and to get/set the mode - new StaticTextWidget(this, 5, 10+1, 100, kLineHeight, "Graphics mode: ", kTextAlignRight); + new StaticTextWidget(tab, vBorder, vBorder+2, 100, kLineHeight, "Graphics mode: ", kTextAlignRight); PopUpWidget *gfxPopUp; - gfxPopUp = new PopUpWidget(this, 105, 10, 180, kLineHeight); + gfxPopUp = new PopUpWidget(tab, 105, vBorder, 180, kLineHeight); gfxPopUp->appendEntry("<default>"); gfxPopUp->appendEntry(""); gfxPopUp->appendEntry("Normal (no scaling)"); @@ -84,15 +96,23 @@ GlobalOptionsDialog::GlobalOptionsDialog(GameDetector &detector) // FIXME - disable GFX popup for now gfxPopUp->setEnabled(false); + // TODO: Aspect ratio setting + // TODO: Fullscreen setting + + + // + // 2) The audio tab + // + tab->addTab("Audio"); // The MIDI mode popup & a label - new StaticTextWidget(this, 5, 26+1, 100, kLineHeight, "Music driver: ", kTextAlignRight); - _midiPopUp = new PopUpWidget(this, 105, 26, 180, kLineHeight); - int midiSelected = 0, i = 0;; + new StaticTextWidget(tab, 5, vBorder+2, 100, kLineHeight, "Music driver: ", kTextAlignRight); + _midiPopUp = new PopUpWidget(tab, 105, vBorder, 180, kLineHeight); // Populate it const MidiDriverDescription *md = getAvailableMidiDrivers(); const int midiDriver = parseMusicDriver(ConfMan.get("music_driver")); + int midiSelected = 0, i = 0; while (md->name) { _midiPopUp->appendEntry(md->description, md->id); if (md->id == midiDriver) @@ -102,40 +122,45 @@ GlobalOptionsDialog::GlobalOptionsDialog(GameDetector &detector) } _midiPopUp->setSelected(midiSelected); - // - // Sound controllers - // - int yoffset = 48; + // Volume controllers + int yoffset = vBorder + 16; - new StaticTextWidget(this, 5, yoffset+2, 100, 16, "Master volume: ", kTextAlignRight); - _masterVolumeSlider = new SliderWidget(this, 105, yoffset, 85, 12, kMasterVolumeChanged); - _masterVolumeLabel = new StaticTextWidget(this, 200, yoffset+2, 24, 16, "100%", kTextAlignLeft); + new StaticTextWidget(tab, 5, yoffset+2, 100, 16, "Master volume: ", kTextAlignRight); + _masterVolumeSlider = new SliderWidget(tab, 105, yoffset, 85, 12, kMasterVolumeChanged); + _masterVolumeLabel = new StaticTextWidget(tab, 200, yoffset+2, 24, 16, "100%", kTextAlignLeft); _masterVolumeSlider->setMinValue(0); _masterVolumeSlider->setMaxValue(255); _masterVolumeLabel->setFlags(WIDGET_CLEARBG); yoffset += 16; - new StaticTextWidget(this, 5, yoffset+2, 100, 16, "Music volume: ", kTextAlignRight); - _musicVolumeSlider = new SliderWidget(this, 105, yoffset, 85, 12, kMusicVolumeChanged); - _musicVolumeLabel = new StaticTextWidget(this, 200, yoffset+2, 24, 16, "100%", kTextAlignLeft); + new StaticTextWidget(tab, 5, yoffset+2, 100, 16, "Music volume: ", kTextAlignRight); + _musicVolumeSlider = new SliderWidget(tab, 105, yoffset, 85, 12, kMusicVolumeChanged); + _musicVolumeLabel = new StaticTextWidget(tab, 200, yoffset+2, 24, 16, "100%", kTextAlignLeft); _musicVolumeSlider->setMinValue(0); _musicVolumeSlider->setMaxValue(255); _musicVolumeLabel->setFlags(WIDGET_CLEARBG); yoffset += 16; - new StaticTextWidget(this, 5, yoffset+2, 100, 16, "SFX volume: ", kTextAlignRight); - _sfxVolumeSlider = new SliderWidget(this, 105, yoffset, 85, 12, kSfxVolumeChanged); - _sfxVolumeLabel = new StaticTextWidget(this, 200, yoffset+2, 24, 16, "100%", kTextAlignLeft); + new StaticTextWidget(tab, 5, yoffset+2, 100, 16, "SFX volume: ", kTextAlignRight); + _sfxVolumeSlider = new SliderWidget(tab, 105, yoffset, 85, 12, kSfxVolumeChanged); + _sfxVolumeLabel = new StaticTextWidget(tab, 200, yoffset+2, 24, 16, "100%", kTextAlignLeft); _sfxVolumeSlider->setMinValue(0); _sfxVolumeSlider->setMaxValue(255); _sfxVolumeLabel->setFlags(WIDGET_CLEARBG); yoffset += 16; + + // TODO: cd drive setting + // TODO: multi midi setting + // TODO: native mt32 setting -#if !( defined(__DC__) || defined(__GP32__) ) // - // Save game path + // 3) The miscellaneous tab // - new StaticTextWidget(this, 5, 106, 100, kLineHeight, "Savegame path: ", kTextAlignRight); - _savePath = new StaticTextWidget(this, 105, 106, 180, kLineHeight, "/foo/bar", kTextAlignLeft); - new ButtonWidget(this, 105, 120, 64, 16, "Choose...", kChooseSaveDirCmd, 0); + tab->addTab("Misc"); + +#if !( defined(__DC__) || defined(__GP32__) ) + // Save game path + new StaticTextWidget(tab, 5, vBorder+2, 100, kLineHeight, "Savegame path: ", kTextAlignRight); + _savePath = new StaticTextWidget(tab, 105, vBorder+2, 180, kLineHeight, "/foo/bar", kTextAlignLeft); + new ButtonWidget(tab, 105, vBorder+14, 64, 16, "Choose...", kChooseSaveDirCmd, 0); // TODO: set _savePath to the current save path Common::String dir(ConfMan.get("savepath")); @@ -148,6 +173,8 @@ GlobalOptionsDialog::GlobalOptionsDialog(GameDetector &detector) _savePath->setLabel(buf); } #endif + // TODO: joystick setting + // // Add OK & Cancel buttons @@ -157,6 +184,10 @@ GlobalOptionsDialog::GlobalOptionsDialog(GameDetector &detector) // Create file browser dialog _browser = new BrowserDialog("Select directory for savegames"); + + + // Activate the first tab + tab->setActiveTab(0); } GlobalOptionsDialog::~GlobalOptionsDialog() { |