[Scummvm-cvs-logs] SF.net SVN: scummvm:[35895] scummvm/trunk/gui

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Sun Jan 18 15:42:30 CET 2009


Revision: 35895
          http://scummvm.svn.sourceforge.net/scummvm/?rev=35895&view=rev
Author:   fingolfin
Date:     2009-01-18 14:42:26 +0000 (Sun, 18 Jan 2009)

Log Message:
-----------
GUI: Renamed Globals.TabLabelWidth to Globals.PopUpWidget.labelWidth (that's what it really is); changed PopUpWidget to use that value directly

Modified Paths:
--------------
    scummvm/trunk/gui/PopUpWidget.cpp
    scummvm/trunk/gui/PopUpWidget.h
    scummvm/trunk/gui/launcher.cpp
    scummvm/trunk/gui/options.cpp
    scummvm/trunk/gui/themes/scummclassic/classic_layout.stx
    scummvm/trunk/gui/themes/scummclassic/classic_layout_lowres.stx
    scummvm/trunk/gui/themes/scummmodern/scummmodern_layout.stx
    scummvm/trunk/gui/themes/scummmodern/scummmodern_layout_lowres.stx

Modified: scummvm/trunk/gui/PopUpWidget.cpp
===================================================================
--- scummvm/trunk/gui/PopUpWidget.cpp	2009-01-18 12:58:06 UTC (rev 35894)
+++ scummvm/trunk/gui/PopUpWidget.cpp	2009-01-18 14:42:26 UTC (rev 35895)
@@ -356,15 +356,13 @@
 // PopUpWidget
 //
 
-PopUpWidget::PopUpWidget(GuiObject *boss, const String &name, const String &label, uint labelWidth)
-	: Widget(boss, name), CommandSender(boss), _label(label), _labelWidth(labelWidth) {
+PopUpWidget::PopUpWidget(GuiObject *boss, const String &name, const String &label)
+	: Widget(boss, name), CommandSender(boss), _label(label), _labelWidth(0) {
 	setFlags(WIDGET_ENABLED | WIDGET_CLEARBG | WIDGET_RETAIN_FOCUS | WIDGET_IGNORE_DRAG);
 	_type = kPopUpWidget;
 
 	_selectedItem = -1;
-
-	if (!_label.empty() && _labelWidth == 0)
-		_labelWidth = g_gui.getStringWidth(_label);
+	_labelWidth = g_gui.xmlEval()->getVar("Globals.PopUpWidget.labelWidth");
 }
 
 void PopUpWidget::handleMouseDown(int x, int y, int button, int clickCount) {
@@ -396,6 +394,7 @@
 }
 
 void PopUpWidget::reflowLayout() {
+	_labelWidth = g_gui.xmlEval()->getVar("Globals.PopUpWidget.labelWidth");
 	_leftPadding = g_gui.xmlEval()->getVar("Globals.PopUpWidget.Padding.Left", 0);
 	_rightPadding = g_gui.xmlEval()->getVar("Globals.PopUpWidget.Padding.Right", 0);
 	_labelSpacing = g_gui.xmlEval()->getVar("Globals.PopUpWidget.labelSpacing", 10);

Modified: scummvm/trunk/gui/PopUpWidget.h
===================================================================
--- scummvm/trunk/gui/PopUpWidget.h	2009-01-18 12:58:06 UTC (rev 35894)
+++ scummvm/trunk/gui/PopUpWidget.h	2009-01-18 14:42:26 UTC (rev 35895)
@@ -56,17 +56,15 @@
 	int				_selectedItem;
 
 	String			_label;
-	uint			_labelWidth;
+	int				_labelWidth;
 
 	int				_leftPadding;
 	int				_rightPadding;
 	int				_labelSpacing;
 
 public:
-	PopUpWidget(GuiObject *boss, const String &name, const String &label, uint labelWidth = 0);
+	PopUpWidget(GuiObject *boss, const String &name, const String &label);
 
-	void changeLabelWidth(uint newWidth) { _labelWidth = newWidth; }
-
 	void handleMouseDown(int x, int y, int button, int clickCount);
 	void handleMouseWheel(int x, int y, int direction);
 

Modified: scummvm/trunk/gui/launcher.cpp
===================================================================
--- scummvm/trunk/gui/launcher.cpp	2009-01-18 12:58:06 UTC (rev 35894)
+++ scummvm/trunk/gui/launcher.cpp	2009-01-18 14:42:26 UTC (rev 35895)
@@ -121,8 +121,6 @@
 public:
 	EditGameDialog(const String &domain, const String &desc);
 
-	virtual void reflowLayout();
-
 	void open();
 	void close();
 	virtual void handleCommand(CommandSender *sender, uint32 cmd, uint32 data);
@@ -147,8 +145,6 @@
 EditGameDialog::EditGameDialog(const String &domain, const String &desc)
 	: OptionsDialog(domain, "GameOptions") {
 
-	int labelWidth = g_gui.xmlEval()->getVar("Globals.TabLabelWidth");
-
 	// GAME: Path to game data (r/o), extra data (r/o), and save data (r/w)
 	String gamePath(ConfMan.get("path", _domain));
 	String extraPath(ConfMan.get("extrapath", _domain));
@@ -177,7 +173,7 @@
 	_descriptionWidget = new EditTextWidget(tab, "GameOptions_Game.Desc", description);
 
 	// Language popup
-	_langPopUp = new PopUpWidget(tab, "GameOptions_Game.Lang", "Language:", labelWidth);
+	_langPopUp = new PopUpWidget(tab, "GameOptions_Game.Lang", "Language:");
 	_langPopUp->appendEntry("<default>");
 	_langPopUp->appendEntry("");
 	const Common::LanguageDescription *l = Common::g_languages;
@@ -186,7 +182,7 @@
 	}
 
 	// Platform popup
-	_platformPopUp = new PopUpWidget(tab, "GameOptions_Game.Platform", "Platform:", labelWidth);
+	_platformPopUp = new PopUpWidget(tab, "GameOptions_Game.Platform", "Platform:");
 	_platformPopUp->appendEntry("<default>");
 	_platformPopUp->appendEntry("");
 	const Common::PlatformDescription *p = Common::g_platforms;
@@ -260,17 +256,6 @@
 	new ButtonWidget(this, "GameOptions.Ok", "OK", kOKCmd, 0);
 }
 
-void EditGameDialog::reflowLayout() {
-	OptionsDialog::reflowLayout();
-
-	int labelWidth = g_gui.xmlEval()->getVar("Globals.TabLabelWidth");
-
-	if (_langPopUp)
-		_langPopUp->changeLabelWidth(labelWidth);
-	if (_platformPopUp)
-		_platformPopUp->changeLabelWidth(labelWidth);
-}
-
 void EditGameDialog::open() {
 	OptionsDialog::open();
 

Modified: scummvm/trunk/gui/options.cpp
===================================================================
--- scummvm/trunk/gui/options.cpp	2009-01-18 12:58:06 UTC (rev 35894)
+++ scummvm/trunk/gui/options.cpp	2009-01-18 14:42:26 UTC (rev 35895)
@@ -515,10 +515,8 @@
 void OptionsDialog::addGraphicControls(GuiObject *boss, const String &prefix) {
 	const OSystem::GraphicsMode *gm = g_system->getSupportedGraphicsModes();
 
-	int labelWidth = g_gui.xmlEval()->getVar("Globals.TabLabelWidth");
-
 	// The GFX mode popup
-	_gfxPopUp = new PopUpWidget(boss, prefix + "grModePopup", "Graphics mode:", labelWidth);
+	_gfxPopUp = new PopUpWidget(boss, prefix + "grModePopup", "Graphics mode:");
 
 	_gfxPopUp->appendEntry("<default>");
 	_gfxPopUp->appendEntry("");
@@ -528,7 +526,7 @@
 	}
 
 	// RenderMode popup
-	_renderModePopUp = new PopUpWidget(boss, prefix + "grRenderPopup", "Render mode:", labelWidth);
+	_renderModePopUp = new PopUpWidget(boss, prefix + "grRenderPopup", "Render mode:");
 	_renderModePopUp->appendEntry("<default>", Common::kRenderDefault);
 	_renderModePopUp->appendEntry("");
 	const Common::RenderModeDescription *rm = Common::g_renderModes;
@@ -546,10 +544,8 @@
 }
 
 void OptionsDialog::addAudioControls(GuiObject *boss, const String &prefix) {
-	int labelWidth = g_gui.xmlEval()->getVar("Globals.TabLabelWidth");
-
 	// The MIDI mode popup & a label
-	_midiPopUp = new PopUpWidget(boss, prefix + "auMidiPopup", "Music driver:", labelWidth);
+	_midiPopUp = new PopUpWidget(boss, prefix + "auMidiPopup", "Music driver:");
 
 	// Populate it
 	const MidiDriverDescription *md = MidiDriver::getAvailableMidiDrivers();
@@ -559,7 +555,7 @@
 	}
 
 	// Sample rate settings
-	_outputRatePopUp = new PopUpWidget(boss, prefix + "auSampleRatePopup", "Output rate:", labelWidth);
+	_outputRatePopUp = new PopUpWidget(boss, prefix + "auSampleRatePopup", "Output rate:");
 
 	for (int i = 0; outputRateLabels[i]; i++) {
 		_outputRatePopUp->appendEntry(outputRateLabels[i], outputRateValues[i]);
@@ -652,19 +648,8 @@
 void OptionsDialog::reflowLayout() {
 	Dialog::reflowLayout();
 
-	int labelWidth = g_gui.xmlEval()->getVar("Globals.TabLabelWidth");
-
 	if (_graphicsTabId != -1 && _tabWidget)
 		_tabWidget->setTabTitle(_graphicsTabId, g_system->getOverlayWidth() > 320 ? "Graphics" : "GFX");
-
-	if (_midiPopUp)
-		_midiPopUp->changeLabelWidth(labelWidth);
-	if (_outputRatePopUp)
-		_outputRatePopUp->changeLabelWidth(labelWidth);
-	if (_gfxPopUp)
-		_gfxPopUp->changeLabelWidth(labelWidth);
-	if (_renderModePopUp)
-		_renderModePopUp->changeLabelWidth(labelWidth);
 }
 
 #pragma mark -
@@ -731,14 +716,12 @@
 	_curTheme = new StaticTextWidget(tab, "GlobalOptions_Misc.CurTheme", g_gui.theme()->getThemeName());
 
 
-	int labelWidth = g_gui.xmlEval()->getVar("Globals.TabLabelWidth");
+	_rendererPopUp = new PopUpWidget(tab, "GlobalOptions_Misc.Renderer", "GUI Renderer:");
 
-	_rendererPopUp = new PopUpWidget(tab, "GlobalOptions_Misc.Renderer", "GUI Renderer:", labelWidth);
-
 	for (uint i = 1; i < GUI::ThemeEngine::_rendererModesSize; ++i)
 		_rendererPopUp->appendEntry(GUI::ThemeEngine::_rendererModes[i].name, GUI::ThemeEngine::_rendererModes[i].mode);
 
-	_autosavePeriodPopUp = new PopUpWidget(tab, "GlobalOptions_Misc.AutosavePeriod", "Autosave:", labelWidth);
+	_autosavePeriodPopUp = new PopUpWidget(tab, "GlobalOptions_Misc.AutosavePeriod", "Autosave:");
 
 	for (int i = 0; savePeriodLabels[i]; i++) {
 		_autosavePeriodPopUp->appendEntry(savePeriodLabels[i], savePeriodValues[i]);

Modified: scummvm/trunk/gui/themes/scummclassic/classic_layout.stx
===================================================================
--- scummvm/trunk/gui/themes/scummclassic/classic_layout.stx	2009-01-18 12:58:06 UTC (rev 35894)
+++ scummvm/trunk/gui/themes/scummclassic/classic_layout.stx	2009-01-18 14:42:26 UTC (rev 35895)
@@ -27,10 +27,10 @@
 	<globals>
 		<def var = 'Line.Height' value = '16' />
 		<def var = 'Font.Height' value = '16' />
-		<def var = 'TabLabelWidth' value = '110' />
 		
 		<def var = 'About.OuterBorder' value = '80'/>
 		<def var = 'PopUpWidget.labelSpacing' value = '10' />
+		<def var = 'PopUpWidget.labelWidth' value = '110' />
 		
 		<def var = 'Layout.Spacing' value = '8' />
 		<def var = 'ShowLauncherLogo' value = '0'/>

Modified: scummvm/trunk/gui/themes/scummclassic/classic_layout_lowres.stx
===================================================================
--- scummvm/trunk/gui/themes/scummclassic/classic_layout_lowres.stx	2009-01-18 12:58:06 UTC (rev 35894)
+++ scummvm/trunk/gui/themes/scummclassic/classic_layout_lowres.stx	2009-01-18 14:42:26 UTC (rev 35895)
@@ -27,11 +27,11 @@
 	<globals>
 		<def var = 'Line.Height' value = '12' />
 		<def var = 'Font.Height' value = '10' />
-		<def var = 'TabLabelWidth' value = '100' />
 
 		<def var = 'About.OuterBorder' value = '10'/>
 		<def var = 'PopUpWidget.labelSpacing' value = '6' />
-		
+		<def var = 'PopUpWidget.labelWidth' value = '100' />
+
 		<def var = 'Layout.Spacing' value = '8'/>
 
 		<def var = 'ShowLauncherLogo' value = '0'/>

Modified: scummvm/trunk/gui/themes/scummmodern/scummmodern_layout.stx
===================================================================
--- scummvm/trunk/gui/themes/scummmodern/scummmodern_layout.stx	2009-01-18 12:58:06 UTC (rev 35894)
+++ scummvm/trunk/gui/themes/scummmodern/scummmodern_layout.stx	2009-01-18 14:42:26 UTC (rev 35895)
@@ -27,7 +27,6 @@
 	<globals>
 		<def var = 'Line.Height' value = '16' />
 		<def var = 'Font.Height' value = '16' />
-		<def var = 'TabLabelWidth' value = '110' />
 		
 		<def var = 'Padding.Bottom' value = '16' />
 		<def var = 'Padding.Left' value = '16' />
@@ -39,6 +38,7 @@
 		<def var = 'ListWidget.hlLeftPadding' value = '0'/>
 		<def var = 'ListWidget.hlRightPadding' value = '0'/>
 		<def var = 'PopUpWidget.labelSpacing' value = '10' />
+		<def var = 'PopUpWidget.labelWidth' value = '110' />
 		
 		<def var = 'ShowLauncherLogo' value = '1'/>
 		<def var = 'ShowGlobalMenuLogo' value = '1'/>
@@ -705,4 +705,17 @@
 			</layout>
 		</layout>
 	</dialog>
+	
+	<dialog name = 'KeyRemapper' overlays = 'screen_center' shading = 'dim'>
+		<layout type = 'vertical' padding = '8, 8, 32, 8' center = 'true'>
+			<widget name = 'Popup'
+					type = 'PopUp'
+			/>
+			<widget name = 'KeymapArea' 
+			/>
+			<widget name = 'Close'
+					type = 'Button'
+			/>
+		</layout>
+	</dialog>
 </layout_info>

Modified: scummvm/trunk/gui/themes/scummmodern/scummmodern_layout_lowres.stx
===================================================================
--- scummvm/trunk/gui/themes/scummmodern/scummmodern_layout_lowres.stx	2009-01-18 12:58:06 UTC (rev 35894)
+++ scummvm/trunk/gui/themes/scummmodern/scummmodern_layout_lowres.stx	2009-01-18 14:42:26 UTC (rev 35895)
@@ -27,10 +27,10 @@
 	<globals>
 		<def var = 'Line.Height' value = '12' />
 		<def var = 'Font.Height' value = '10' />
-		<def var = 'TabLabelWidth' value = '100' />
 
 		<def var = 'About.OuterBorder' value = '10'/>
 		<def var = 'PopUpWidget.labelSpacing' value = '6' />
+		<def var = 'PopUpWidget.labelWidth' value = '100' />
 
 		<def var = 'ShowLauncherLogo' value = '0'/>
 		<def var = 'ShowGlobalMenuLogo' value = '0'/>


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list