diff options
author | Torbjörn Andersson | 2005-05-18 10:12:20 +0000 |
---|---|---|
committer | Torbjörn Andersson | 2005-05-18 10:12:20 +0000 |
commit | ef8e42473a5977a81bc7c09247cada35e16ce5ad (patch) | |
tree | b5cdc3823c4d4a3abf5da143f74fca8759e5daf1 | |
parent | 6ef7dbf97c21cc44d59185ce6a1df9978ce09003 (diff) | |
download | scummvm-rg350-ef8e42473a5977a81bc7c09247cada35e16ce5ad.tar.gz scummvm-rg350-ef8e42473a5977a81bc7c09247cada35e16ce5ad.tar.bz2 scummvm-rg350-ef8e42473a5977a81bc7c09247cada35e16ce5ad.zip |
Made use of addCheckbox(). I had to add an alternative form of the function
because most checkboxes are on tabs. (We'll probably need a similar form of
addButton() as well.)
svn-id: r18161
-rw-r--r-- | gui/dialog.cpp | 6 | ||||
-rw-r--r-- | gui/dialog.h | 1 | ||||
-rw-r--r-- | gui/launcher.cpp | 16 | ||||
-rw-r--r-- | gui/options.cpp | 25 |
4 files changed, 26 insertions, 22 deletions
diff --git a/gui/dialog.cpp b/gui/dialog.cpp index f0840a3a5b..6f629bfd4e 100644 --- a/gui/dialog.cpp +++ b/gui/dialog.cpp @@ -299,6 +299,10 @@ ButtonWidget *Dialog::addButton(int x, int y, const Common::String &label, uint3 } CheckboxWidget *Dialog::addCheckbox(int x, int y, const Common::String &label, uint32 cmd, char hotkey, WidgetSize ws) { + return addCheckbox(this, x, y, label, cmd, hotkey, ws); +} + +CheckboxWidget *Dialog::addCheckbox(GuiObject *boss, int x, int y, const Common::String &label, uint32 cmd, char hotkey, WidgetSize ws) { const Graphics::Font *font; int w, h; @@ -312,7 +316,7 @@ CheckboxWidget *Dialog::addCheckbox(int x, int y, const Common::String &label, u w = font->getFontHeight() + 10 + font->getStringWidth(label); - return new CheckboxWidget(this, x, y, w, h, label, cmd, hotkey, ws); + return new CheckboxWidget(boss, x, y, w, h, label, cmd, hotkey, ws); } uint32 GuiObject::getMillis() { diff --git a/gui/dialog.h b/gui/dialog.h index b437269a91..0309709a51 100644 --- a/gui/dialog.h +++ b/gui/dialog.h @@ -88,6 +88,7 @@ protected: Widget *findWidget(int x, int y); // Find the widget at pos x,y if any ButtonWidget *addButton(int x, int y, const Common::String &label, uint32 cmd, char hotkey, WidgetSize ws = kDefaultWidgetSize); + CheckboxWidget *addCheckbox(GuiObject *boss, int x, int y, const Common::String &label, uint32 cmd, char hotkey, WidgetSize ws = kDefaultWidgetSize); CheckboxWidget *addCheckbox(int x, int y, const Common::String &label, uint32 cmd, char hotkey, WidgetSize ws = kDefaultWidgetSize); void setResult(int result) { _result = result; } diff --git a/gui/launcher.cpp b/gui/launcher.cpp index 244a787fc7..cdffd49c17 100644 --- a/gui/launcher.cpp +++ b/gui/launcher.cpp @@ -239,8 +239,8 @@ EditGameDialog::EditGameDialog(const String &domain, GameSettings target) tab->addTab("Gfx"); yoffset = vBorder; - _globalGraphicsOverride = new CheckboxWidget(tab, x, yoffset, w, 16, "Override global graphic settings", kCmdGlobalGraphicsOverride); - yoffset += 16; + _globalGraphicsOverride = addCheckbox(tab, x, yoffset, "Override global graphic settings", kCmdGlobalGraphicsOverride, 0); + yoffset += _globalGraphicsOverride->getHeight(); yoffset = addGraphicControls(tab, yoffset); @@ -250,8 +250,8 @@ EditGameDialog::EditGameDialog(const String &domain, GameSettings target) tab->addTab("Audio"); yoffset = vBorder; - _globalAudioOverride = new CheckboxWidget(tab, x, yoffset, w, 16, "Override global audio settings", kCmdGlobalAudioOverride); - yoffset += 16; + _globalAudioOverride = addCheckbox(tab, x, yoffset, "Override global audio settings", kCmdGlobalAudioOverride, 0); + yoffset += _globalAudioOverride->getHeight(); yoffset = addAudioControls(tab, yoffset); @@ -261,8 +261,8 @@ EditGameDialog::EditGameDialog(const String &domain, GameSettings target) tab->addTab("MIDI"); yoffset = vBorder; - _globalMIDIOverride = new CheckboxWidget(tab, x, yoffset, w, 16, "Override global MIDI settings", kCmdGlobalMIDIOverride); - yoffset += 16; + _globalMIDIOverride = addCheckbox(tab, x, yoffset, "Override global MIDI settings", kCmdGlobalMIDIOverride, 0); + yoffset += _globalMIDIOverride->getHeight(); yoffset = addMIDIControls(tab, yoffset); @@ -272,8 +272,8 @@ EditGameDialog::EditGameDialog(const String &domain, GameSettings target) tab->addTab("Volume"); yoffset = vBorder; - _globalVolumeOverride = new CheckboxWidget(tab, x, yoffset, w, 16, "Override global volume settings", kCmdGlobalVolumeOverride); - yoffset += 16; + _globalVolumeOverride = addCheckbox(tab, x, yoffset, "Override global volume settings", kCmdGlobalVolumeOverride, 0); + yoffset += _globalVolumeOverride->getHeight(); yoffset = addVolumeControls(tab, yoffset); diff --git a/gui/options.cpp b/gui/options.cpp index b9e6ccb2b8..1b0a69185e 100644 --- a/gui/options.cpp +++ b/gui/options.cpp @@ -336,12 +336,12 @@ int OptionsDialog::addGraphicControls(GuiObject *boss, int yoffset) { } // Fullscreen checkbox - _fullscreenCheckbox = new CheckboxWidget(boss, x, yoffset, w, 16, "Fullscreen mode"); - yoffset += 16; + _fullscreenCheckbox = addCheckbox(boss, x, yoffset, "Fullscreen mode", 0, 0); + yoffset += _fullscreenCheckbox->getHeight(); // Aspect ratio checkbox - _aspectCheckbox = new CheckboxWidget(boss, x, yoffset, w, 16, "Aspect ratio correction"); - yoffset += 16; + _aspectCheckbox = addCheckbox(boss, x, yoffset, "Aspect ratio correction", 0, 0); + yoffset += _aspectCheckbox->getHeight(); #ifdef _WIN32_WCE _fullscreenCheckbox->setState(TRUE); @@ -370,8 +370,8 @@ int OptionsDialog::addAudioControls(GuiObject *boss, int yoffset) { } // Subtitles on/off - _subCheckbox = new CheckboxWidget(boss, x, yoffset, w, 16, "Display subtitles"); - yoffset += 16; + _subCheckbox = addCheckbox(boss, x, yoffset, "Display subtitles", 0, 0); + yoffset += _subCheckbox->getHeight(); yoffset += 18; @@ -382,7 +382,6 @@ int OptionsDialog::addAudioControls(GuiObject *boss, int yoffset) { int OptionsDialog::addMIDIControls(GuiObject *boss, int yoffset) { const int x = 10; - const int w = _w - 20; // SoundFont _soundFontButton = new ButtonWidget(boss, x, yoffset, kButtonWidth + 14, 16, "SoundFont: ", kChooseSoundFontCmd, 0); @@ -390,16 +389,16 @@ int OptionsDialog::addMIDIControls(GuiObject *boss, int yoffset) { yoffset += 18; // Multi midi setting - _multiMidiCheckbox = new CheckboxWidget(boss, x, yoffset, w, 16, "Mixed Adlib/MIDI mode"); - yoffset += 16; + _multiMidiCheckbox = addCheckbox(boss, x, yoffset, "Mixed Adlib/MIDI mode", 0, 0); + yoffset += _multiMidiCheckbox->getHeight(); // Native mt32 setting - _mt32Checkbox = new CheckboxWidget(boss, x, yoffset, w, 16, "True Roland MT-32 (disable GM emulation)"); - yoffset += 16; + _mt32Checkbox = addCheckbox(boss, x, yoffset, "True Roland MT-32 (disable GM emulation)", 0, 0); + yoffset += _mt32Checkbox->getHeight(); // GS Extensions setting - _enableGSCheckbox = new CheckboxWidget(boss, x, yoffset, w, 16, "Enable Roland GS Mode"); - yoffset += 16; + _enableGSCheckbox = addCheckbox(boss, x, yoffset, "Enable Roland GS Mode", 0, 0); + yoffset += _enableGSCheckbox->getHeight(); _enableMIDISettings = true; |