[Scummvm-cvs-logs] CVS: scummvm/gui dialog.cpp,1.53,1.54 dialog.h,1.34,1.35 launcher.cpp,1.119,1.120 options.cpp,1.81,1.82
Torbjörn Andersson
eriktorbjorn at users.sourceforge.net
Wed May 18 03:13:42 CEST 2005
Update of /cvsroot/scummvm/scummvm/gui
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11779
Modified Files:
dialog.cpp dialog.h launcher.cpp options.cpp
Log Message:
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.)
Index: dialog.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui/dialog.cpp,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -d -r1.53 -r1.54
--- dialog.cpp 18 May 2005 09:21:03 -0000 1.53
+++ dialog.cpp 18 May 2005 10:12:20 -0000 1.54
@@ -299,6 +299,10 @@
}
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 @@
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() {
Index: dialog.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui/dialog.h,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- dialog.h 18 May 2005 09:21:03 -0000 1.34
+++ dialog.h 18 May 2005 10:12:20 -0000 1.35
@@ -88,6 +88,7 @@
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; }
Index: launcher.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui/launcher.cpp,v
retrieving revision 1.119
retrieving revision 1.120
diff -u -d -r1.119 -r1.120
--- launcher.cpp 17 May 2005 06:19:42 -0000 1.119
+++ launcher.cpp 18 May 2005 10:12:20 -0000 1.120
@@ -239,8 +239,8 @@
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 @@
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 @@
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 @@
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);
Index: options.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui/options.cpp,v
retrieving revision 1.81
retrieving revision 1.82
diff -u -d -r1.81 -r1.82
--- options.cpp 17 May 2005 06:19:42 -0000 1.81
+++ options.cpp 18 May 2005 10:12:20 -0000 1.82
@@ -336,12 +336,12 @@
}
// 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 @@
}
// 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::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 @@
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;
More information about the Scummvm-git-logs
mailing list