[Scummvm-cvs-logs] CVS: scummvm/gui dialog.cpp,1.54,1.55 dialog.h,1.35,1.36 launcher.cpp,1.120,1.121 options.cpp,1.83,1.84 options.h,1.30,1.31

Torbjörn Andersson eriktorbjorn at users.sourceforge.net
Wed May 18 07:13:21 CEST 2005


Update of /cvsroot/scummvm/scummvm/gui
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30146/gui

Modified Files:
	dialog.cpp dialog.h launcher.cpp options.cpp options.h 
Log Message:
Some more scaling work. Parts of the options dialogs scale themselves. Some
of them better than others.


Index: dialog.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui/dialog.cpp,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -d -r1.54 -r1.55
--- dialog.cpp	18 May 2005 10:12:20 -0000	1.54
+++ dialog.cpp	18 May 2005 14:11:52 -0000	1.55
@@ -289,13 +289,17 @@
 }
 
 ButtonWidget *Dialog::addButton(int x, int y, const Common::String &label, uint32 cmd, char hotkey, WidgetSize ws) {
+	return addButton(this, x, y, label, cmd, hotkey, ws);
+}
+
+ButtonWidget *Dialog::addButton(GuiObject *boss, int x, int y, const Common::String &label, uint32 cmd, char hotkey, WidgetSize ws) {
 	int w = kButtonWidth;
 	int h = kButtonHeight;
 	if (ws == kBigWidgetSize) {
 		w = kBigButtonWidth;
 		h = kBigButtonHeight;
 	}
-	return new ButtonWidget(this, x, y, w, h, label, cmd, hotkey, ws);
+	return new ButtonWidget(boss, x, y, w, h, label, cmd, hotkey, ws);
 }
 
 CheckboxWidget *Dialog::addCheckbox(int x, int y, const Common::String &label, uint32 cmd, char hotkey, WidgetSize ws) {

Index: dialog.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui/dialog.h,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- dialog.h	18 May 2005 10:12:20 -0000	1.35
+++ dialog.h	18 May 2005 14:11:52 -0000	1.36
@@ -87,7 +87,9 @@
 	
 	Widget *findWidget(int x, int y); // Find the widget at pos x,y if any
 
+	ButtonWidget *addButton(GuiObject *boss, int x, int y, const Common::String &label, uint32 cmd, char hotkey, WidgetSize ws = kDefaultWidgetSize);
 	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);
 

Index: launcher.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui/launcher.cpp,v
retrieving revision 1.120
retrieving revision 1.121
diff -u -d -r1.120 -r1.121
--- launcher.cpp	18 May 2005 10:12:20 -0000	1.120
+++ launcher.cpp	18 May 2005 14:11:52 -0000	1.121
@@ -146,11 +146,17 @@
 	_h = screenH - 2 * 40;	// TODO/FIXME
 
 	GUI::WidgetSize ws;
+	int buttonHeight;
+	int buttonWidth;
 
 	if (screenW >= 400 && screenH >= 300) {
 		ws = GUI::kBigWidgetSize;
+		buttonHeight = kBigButtonHeight;
+		buttonWidth = kBigButtonWidth;
 	} else {
 		ws = GUI::kNormalWidgetSize;
+		buttonHeight = kButtonHeight;
+		buttonWidth = kButtonWidth;
 	}
 	
 	const int x = 5;
@@ -171,7 +177,7 @@
 	}
 
 	// GUI:  Add tab widget
-	TabWidget *tab = new TabWidget(this, 0, vBorder, _w, _h - 24 - 2 * vBorder, ws);
+	TabWidget *tab = new TabWidget(this, 0, vBorder, _w, _h - buttonHeight - 8 - 2 * vBorder, ws);
 
 	//
 	// 1) The game tab
@@ -180,12 +186,12 @@
 	yoffset = vBorder;
 
 	// GUI:  Label & edit widget for the game ID
-	new StaticTextWidget(tab, x, yoffset + 2, labelWidth, kLineHeight, "ID: ", kTextAlignRight);
+	new StaticTextWidget(tab, x, yoffset + 2, labelWidth, kLineHeight, "ID: ", kTextAlignRight, ws);
 	_domainWidget = new DomainEditTextWidget(tab, x + labelWidth, yoffset, _w - labelWidth - 10, kLineHeight, _domain);
 	yoffset += 16;
 
 	// GUI:  Label & edit widget for the description
-	new StaticTextWidget(tab, x, yoffset + 2, labelWidth, kLineHeight, "Name: ", kTextAlignRight);
+	new StaticTextWidget(tab, x, yoffset + 2, labelWidth, kLineHeight, "Name: ", kTextAlignRight, ws);
 	_descriptionWidget = new EditTextWidget(tab, x + labelWidth, yoffset, _w - labelWidth - 10, kLineHeight, description);
 	yoffset += 16;
 
@@ -212,26 +218,27 @@
 	// 2) The 'Path' tab
 	tab->addTab("Paths");
 	yoffset = vBorder;
+
 	// GUI:  Button + Label for the game path
- 	new ButtonWidget(tab, x, yoffset, kButtonWidth + 14, 16, "Game Path:", kCmdGameBrowser, 0);
-	_gamePathWidget = new StaticTextWidget(tab, x + kButtonWidth + 20, yoffset + 3, _w - (x + kButtonWidth + 20) - 10, kLineHeight, gamePath, kTextAlignLeft);
-	yoffset += 18;
+	addButton(tab, x, yoffset, "Game Path:", kCmdGameBrowser, 0, ws);
+	_gamePathWidget = new StaticTextWidget(tab, x + buttonWidth + 20, yoffset + 3, _w - (x + buttonWidth + 20) - 10, kLineHeight, gamePath, kTextAlignLeft, ws);
+	yoffset += buttonHeight + 2;
 
 	// GUI:  Button + Label for the additional path
- 	new ButtonWidget(tab, x, yoffset, kButtonWidth + 14, 16, "Extra Path:", kCmdExtraBrowser, 0);
-	_extraPathWidget = new StaticTextWidget(tab, x + kButtonWidth + 20, yoffset + 3, _w - (x + kButtonWidth + 20) - 10, kLineHeight, extraPath, kTextAlignLeft);
+	addButton(tab, x, yoffset, "Extra Path:", kCmdExtraBrowser, 0, ws);
+	_extraPathWidget = new StaticTextWidget(tab, x + buttonWidth + 20, yoffset + 3, _w - (x + buttonWidth + 20) - 10, kLineHeight, extraPath, kTextAlignLeft, ws);
 	if (extraPath.isEmpty() || !ConfMan.hasKey("extrapath", _domain)) {
 		_extraPathWidget->setLabel("None");
 	}
-	yoffset += 18;
+	yoffset += buttonHeight + 2;
 
 	// GUI:  Button + Label for the save path
- 	new ButtonWidget(tab, x, yoffset, kButtonWidth + 14, 16, "Save Path:", kCmdSaveBrowser, 0);
-	_savePathWidget = new StaticTextWidget(tab, x + kButtonWidth + 20, yoffset + 3, _w - (x + kButtonWidth + 20) - 10, kLineHeight, savePath, kTextAlignLeft);
+	addButton(tab, x, yoffset, "Save Path:", kCmdSaveBrowser, 0, ws);
+	_savePathWidget = new StaticTextWidget(tab, x + buttonWidth + 20, yoffset + 3, _w - (x + buttonWidth + 20) - 10, kLineHeight, savePath, kTextAlignLeft, ws);
 	if (savePath.isEmpty() || !ConfMan.hasKey("savepath", _domain)) {
 		_savePathWidget->setLabel("Default");
 	}
-	yoffset += 18;
+	yoffset += buttonHeight + 2;
 
 	//
 	// 3) The graphics tab
@@ -239,10 +246,10 @@
 	tab->addTab("Gfx");
 	yoffset = vBorder;
 
-	_globalGraphicsOverride = addCheckbox(tab, x, yoffset, "Override global graphic settings", kCmdGlobalGraphicsOverride, 0);
+	_globalGraphicsOverride = addCheckbox(tab, x, yoffset, "Override global graphic settings", kCmdGlobalGraphicsOverride, 0, ws);
 	yoffset += _globalGraphicsOverride->getHeight();
 
-	yoffset = addGraphicControls(tab, yoffset);
+	yoffset = addGraphicControls(tab, yoffset, ws);
 
 	//
 	// 4) The audio tab
@@ -250,10 +257,10 @@
 	tab->addTab("Audio");
 	yoffset = vBorder;
 
-	_globalAudioOverride = addCheckbox(tab, x, yoffset, "Override global audio settings", kCmdGlobalAudioOverride, 0);
+	_globalAudioOverride = addCheckbox(tab, x, yoffset, "Override global audio settings", kCmdGlobalAudioOverride, 0, ws);
 	yoffset += _globalAudioOverride->getHeight();
 
-	yoffset = addAudioControls(tab, yoffset);
+	yoffset = addAudioControls(tab, yoffset, ws);
 
 	//
 	// 5) The MIDI tab
@@ -261,10 +268,10 @@
 	tab->addTab("MIDI");
 	yoffset = vBorder;
 
-	_globalMIDIOverride = addCheckbox(tab, x, yoffset, "Override global MIDI settings", kCmdGlobalMIDIOverride, 0);
+	_globalMIDIOverride = addCheckbox(tab, x, yoffset, "Override global MIDI settings", kCmdGlobalMIDIOverride, 0, ws);
 	yoffset += _globalMIDIOverride->getHeight();
 
-	yoffset = addMIDIControls(tab, yoffset);
+	yoffset = addMIDIControls(tab, yoffset, ws);
 
 	//
 	// 6) The volume tab
@@ -272,18 +279,18 @@
 	tab->addTab("Volume");
 	yoffset = vBorder;
 
-	_globalVolumeOverride = addCheckbox(tab, x, yoffset, "Override global volume settings", kCmdGlobalVolumeOverride, 0);
+	_globalVolumeOverride = addCheckbox(tab, x, yoffset, "Override global volume settings", kCmdGlobalVolumeOverride, 0, ws);
 	yoffset += _globalVolumeOverride->getHeight();
 
-	yoffset = addVolumeControls(tab, yoffset);
+	yoffset = addVolumeControls(tab, yoffset, ws);
 
 
 	// Activate the first tab
 	tab->setActiveTab(0);
 
 	// Add OK & Cancel buttons
-	addButton(_w - 2 * (kButtonWidth + 10), _h - 24, "Cancel", kCloseCmd, 0);
-	addButton(_w - (kButtonWidth + 10), _h - 24, "OK", kOKCmd, 0);
+	addButton(_w - 2 * (buttonWidth + 10), _h - buttonHeight - 8, "Cancel", kCloseCmd, 0, ws);
+	addButton(_w - (buttonWidth + 10), _h - buttonHeight - 8, "OK", kOKCmd, 0, ws);
 }
 
 void EditGameDialog::open() {

Index: options.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui/options.cpp,v
retrieving revision 1.83
retrieving revision 1.84
diff -u -d -r1.83 -r1.84
--- options.cpp	18 May 2005 10:24:02 -0000	1.83
+++ options.cpp	18 May 2005 14:11:52 -0000	1.84
@@ -84,7 +84,6 @@
 	_musicVolumeSlider(0), _musicVolumeLabel(0),
 	_sfxVolumeSlider(0), _sfxVolumeLabel(0),
 	_speechVolumeSlider(0), _speechVolumeLabel(0) {
-
 }
 
 void OptionsDialog::open() {
@@ -309,7 +308,7 @@
 	_speechVolumeLabel->setEnabled(enabled);
 }
 
-int OptionsDialog::addGraphicControls(GuiObject *boss, int yoffset) {
+int OptionsDialog::addGraphicControls(GuiObject *boss, int yoffset, WidgetSize ws) {
 	const int x = 10;
 	const int w = _w - 2 * 10;
 	const OSystem::GraphicsMode *gm = g_system->getSupportedGraphicsModes();
@@ -336,11 +335,11 @@
 	}
 
 	// Fullscreen checkbox
-	_fullscreenCheckbox = addCheckbox(boss, x, yoffset, "Fullscreen mode", 0, 0);
+	_fullscreenCheckbox = addCheckbox(boss, x, yoffset, "Fullscreen mode", 0, 0, ws);
 	yoffset += _fullscreenCheckbox->getHeight();
 
 	// Aspect ratio checkbox
-	_aspectCheckbox = addCheckbox(boss, x, yoffset, "Aspect ratio correction", 0, 0);
+	_aspectCheckbox = addCheckbox(boss, x, yoffset, "Aspect ratio correction", 0, 0, ws);
 	yoffset += _aspectCheckbox->getHeight();
 
 #ifdef _WIN32_WCE
@@ -354,7 +353,7 @@
 	return yoffset;
 }
 
-int OptionsDialog::addAudioControls(GuiObject *boss, int yoffset) {
+int OptionsDialog::addAudioControls(GuiObject *boss, int yoffset, WidgetSize ws) {
 	const int x = 10;
 	const int w = _w - 20;
 
@@ -370,7 +369,7 @@
 	}
 
 	// Subtitles on/off
-	_subCheckbox = addCheckbox(boss, x, yoffset, "Display subtitles", 0, 0);
+	_subCheckbox = addCheckbox(boss, x, yoffset, "Display subtitles", 0, 0, ws);
 	yoffset += _subCheckbox->getHeight();
 
 	yoffset += 18;
@@ -380,7 +379,7 @@
 	return yoffset;
 }
 
-int OptionsDialog::addMIDIControls(GuiObject *boss, int yoffset) {
+int OptionsDialog::addMIDIControls(GuiObject *boss, int yoffset, WidgetSize ws) {
 	const int x = 10;
 
 	// SoundFont
@@ -389,15 +388,15 @@
 	yoffset += 18;
 
 	// Multi midi setting
-	_multiMidiCheckbox = addCheckbox(boss, x, yoffset, "Mixed Adlib/MIDI mode", 0, 0);
+	_multiMidiCheckbox = addCheckbox(boss, x, yoffset, "Mixed Adlib/MIDI mode", 0, 0, ws);
 	yoffset += _multiMidiCheckbox->getHeight();
 	
 	// Native mt32 setting
-	_mt32Checkbox = addCheckbox(boss, x, yoffset, "True Roland MT-32 (disable GM emulation)", 0, 0);
+	_mt32Checkbox = addCheckbox(boss, x, yoffset, "True Roland MT-32 (disable GM emulation)", 0, 0, ws);
 	yoffset += _mt32Checkbox->getHeight();
 
 	// GS Extensions setting
-	_enableGSCheckbox = addCheckbox(boss, x, yoffset, "Enable Roland GS Mode", 0, 0);
+	_enableGSCheckbox = addCheckbox(boss, x, yoffset, "Enable Roland GS Mode", 0, 0, ws);
 	yoffset += _enableGSCheckbox->getHeight();
 	
 	_enableMIDISettings = true;
@@ -405,25 +404,25 @@
 	return yoffset;
 }
 
-int OptionsDialog::addVolumeControls(GuiObject *boss, int yoffset) {
+int OptionsDialog::addVolumeControls(GuiObject *boss, int yoffset, WidgetSize ws) {
 	// Volume controllers
-	new StaticTextWidget(boss, 5, yoffset + 2, 100, kLineHeight, "Music volume: ", kTextAlignRight);
+	new StaticTextWidget(boss, 5, yoffset + 2, 100, kLineHeight, "Music volume: ", kTextAlignRight, ws);
 	_musicVolumeSlider = new SliderWidget(boss, 105, yoffset, 85, 12, kMusicVolumeChanged);
-	_musicVolumeLabel = new StaticTextWidget(boss, 200, yoffset + 2, 24, kLineHeight, "100%", kTextAlignLeft);
+	_musicVolumeLabel = new StaticTextWidget(boss, 200, yoffset + 2, 24, kLineHeight, "100%", kTextAlignLeft, ws);
 	_musicVolumeSlider->setMinValue(0); _musicVolumeSlider->setMaxValue(Audio::Mixer::kMaxMixerVolume);
 	_musicVolumeLabel->setFlags(WIDGET_CLEARBG);
 	yoffset += 16;
 
-	new StaticTextWidget(boss, 5, yoffset + 2, 100, kLineHeight, "SFX volume: ", kTextAlignRight);
+	new StaticTextWidget(boss, 5, yoffset + 2, 100, kLineHeight, "SFX volume: ", kTextAlignRight, ws);
 	_sfxVolumeSlider = new SliderWidget(boss, 105, yoffset, 85, 12, kSfxVolumeChanged);
-	_sfxVolumeLabel = new StaticTextWidget(boss, 200, yoffset + 2, 24, kLineHeight, "100%", kTextAlignLeft);
+	_sfxVolumeLabel = new StaticTextWidget(boss, 200, yoffset + 2, 24, kLineHeight, "100%", kTextAlignLeft, ws);
 	_sfxVolumeSlider->setMinValue(0); _sfxVolumeSlider->setMaxValue(Audio::Mixer::kMaxMixerVolume);
 	_sfxVolumeLabel->setFlags(WIDGET_CLEARBG);
 	yoffset += 16;
 
-	new StaticTextWidget(boss, 5, yoffset + 2, 100, kLineHeight, "Speech volume: ", kTextAlignRight);
+	new StaticTextWidget(boss, 5, yoffset + 2, 100, kLineHeight, "Speech volume: ", kTextAlignRight, ws);
 	_speechVolumeSlider = new SliderWidget(boss, 105, yoffset, 85, 12, kSpeechVolumeChanged);
-	_speechVolumeLabel = new StaticTextWidget(boss, 200, yoffset + 2, 24, kLineHeight, "100%", kTextAlignLeft);
+	_speechVolumeLabel = new StaticTextWidget(boss, 200, yoffset + 2, 24, kLineHeight, "100%", kTextAlignLeft, ws);
 	_speechVolumeSlider->setMinValue(0); _speechVolumeSlider->setMaxValue(Audio::Mixer::kMaxMixerVolume);
 	_speechVolumeLabel->setFlags(WIDGET_CLEARBG);
 	yoffset += 16;
@@ -469,15 +468,15 @@
 	//
 	tab->addTab("Graphics");
 	yoffset = vBorder;
-	yoffset = addGraphicControls(tab, yoffset);
+	yoffset = addGraphicControls(tab, yoffset, ws);
 
 	//
 	// 2) The audio tab
 	//
 	tab->addTab("Audio");
 	yoffset = vBorder;
-	yoffset = addAudioControls(tab, yoffset);
-	yoffset = addVolumeControls(tab, yoffset);
+	yoffset = addAudioControls(tab, yoffset, ws);
+	yoffset = addVolumeControls(tab, yoffset, ws);
 	// TODO: cd drive setting
 	
 	//
@@ -485,7 +484,7 @@
 	//
 	tab->addTab("MIDI");
 	yoffset = vBorder;
-	yoffset = addMIDIControls(tab, yoffset);
+	yoffset = addMIDIControls(tab, yoffset, ws);
 
 	//
 	// 4) The miscellaneous tab

Index: options.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui/options.h,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- options.h	16 May 2005 06:33:33 -0000	1.30
+++ options.h	18 May 2005 14:11:53 -0000	1.31
@@ -56,10 +56,10 @@
 	ButtonWidget *_soundFontButton;
 	StaticTextWidget *_soundFont;
 
-	int addGraphicControls(GuiObject *boss, int yoffset);
-	int addAudioControls(GuiObject *boss, int yoffset);
-	int addMIDIControls(GuiObject *boss, int yoffset);
-	int addVolumeControls(GuiObject *boss, int yoffset);
+	int addGraphicControls(GuiObject *boss, int yoffset, WidgetSize ws);
+	int addAudioControls(GuiObject *boss, int yoffset, WidgetSize ws);
+	int addMIDIControls(GuiObject *boss, int yoffset, WidgetSize ws);
+	int addVolumeControls(GuiObject *boss, int yoffset, WidgetSize ws);
 
 	void setGraphicSettingsState(bool enabled);
 	void setAudioSettingsState(bool enabled);





More information about the Scummvm-git-logs mailing list