[Scummvm-cvs-logs] CVS: scummvm/gui options.cpp,1.26,1.27 widget.cpp,1.17,1.18 widget.h,1.20,1.21

Max Horn fingolfin at users.sourceforge.net
Sat Nov 1 14:22:06 CET 2003


Update of /cvsroot/scummvm/scummvm/gui
In directory sc8-pr-cvs1:/tmp/cvs-serv8244

Modified Files:
	options.cpp widget.cpp widget.h 
Log Message:
fixed Widget::draw for bordered items to adjust _h; removed unused label param from SliderWidget constructor; cleanup

Index: options.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui/options.cpp,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- options.cpp	18 Oct 2003 00:22:46 -0000	1.26
+++ options.cpp	1 Nov 2003 22:21:18 -0000	1.27
@@ -51,6 +51,7 @@
 // - music & graphics driver (but see also the comments on EditGameDialog
 //   for some techincal difficulties with this)
 // - default volumes (sfx/master/music)
+// - aspect ratio, language, platform, subtitles, debug mode/level, cd drive, joystick, multi midi, native mt32
 
 enum {
 	kMasterVolumeChanged	= 'mavc',
@@ -85,8 +86,7 @@
 	
 
 	// The MIDI mode popup & a label
-	StaticTextWidget *foo = new StaticTextWidget(this, 5, 26+1, 100, kLineHeight, "Music driver: ", kTextAlignRight);
-	foo->setEnabled(false);
+	new StaticTextWidget(this, 5, 26+1, 100, kLineHeight, "Music driver: ", kTextAlignRight);
 	_midiPopUp = new PopUpWidget(this, 105, 26, 180, kLineHeight);
 	int midiSelected = 0, i = 0;;
 	
@@ -105,26 +105,28 @@
 	//
 	// Sound controllers
 	//
-	const int yoffset = 40;
-	new StaticTextWidget(this, 5, yoffset+10, 100, 16, "Master volume: ", kTextAlignRight);
-	new StaticTextWidget(this, 5, yoffset+26, 100, 16, "Music volume: ", kTextAlignRight);
-	new StaticTextWidget(this, 5, yoffset+42, 100, 16, "SFX volume: ", kTextAlignRight);
-
-	_masterVolumeSlider = new SliderWidget(this, 105, yoffset+8, 85, 12, "Volume1", kMasterVolumeChanged);
-	_musicVolumeSlider  = new SliderWidget(this, 105, yoffset+24, 85, 12, "Volume2", kMusicVolumeChanged);
-	_sfxVolumeSlider    = new SliderWidget(this, 105, yoffset+40, 85, 12, "Volume3", kSfxVolumeChanged);
-
-	_masterVolumeSlider->setMinValue(0);	_masterVolumeSlider->setMaxValue(255);
-	_musicVolumeSlider->setMinValue(0);	_musicVolumeSlider->setMaxValue(255);
-	_sfxVolumeSlider->setMinValue(0);	_sfxVolumeSlider->setMaxValue(255);
+	int yoffset = 48;
 
-	_masterVolumeLabel = new StaticTextWidget(this, 200, yoffset+10, 24, 16, "100%", kTextAlignLeft);
-	_musicVolumeLabel  = new StaticTextWidget(this, 200, yoffset+26, 24, 16, "100%", kTextAlignLeft);
-	_sfxVolumeLabel    = new StaticTextWidget(this, 200, yoffset+42, 24, 16, "100%", kTextAlignLeft);
-	
+	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);
+	_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);
+	_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);
+	_sfxVolumeSlider->setMinValue(0); _sfxVolumeSlider->setMaxValue(255);
 	_sfxVolumeLabel->setFlags(WIDGET_CLEARBG);
+	yoffset += 16;
 
 
 #if !( defined(__DC__) || defined(__GP32__) )
@@ -165,15 +167,15 @@
 	Dialog::open();
 
 	_soundVolumeMaster = ConfMan.getInt("master_volume");
-	_soundVolumeMusic = ConfMan.getInt("music_volume");
-	_soundVolumeSfx = ConfMan.getInt("sfx_volume");
-
 	_masterVolumeSlider->setValue(_soundVolumeMaster);
-	_musicVolumeSlider->setValue(_soundVolumeMusic);
-	_sfxVolumeSlider->setValue(_soundVolumeSfx);
-
 	_masterVolumeLabel->setValue(_soundVolumeMaster);
+
+	_soundVolumeMusic = ConfMan.getInt("music_volume");
+	_musicVolumeSlider->setValue(_soundVolumeMusic);
 	_musicVolumeLabel->setValue(_soundVolumeMusic);
+
+	_soundVolumeSfx = ConfMan.getInt("sfx_volume");
+	_sfxVolumeSlider->setValue(_soundVolumeSfx);
 	_sfxVolumeLabel->setValue(_soundVolumeSfx);
 }
 

Index: widget.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui/widget.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- widget.cpp	31 Jul 2003 18:35:00 -0000	1.17
+++ widget.cpp	1 Nov 2003 22:21:18 -0000	1.18
@@ -51,6 +51,7 @@
 		_x += 4;
 		_y += 4;
 		_w -= 8;
+		_h -= 8;
 	}
 
 	// Now perform the actual widget draw
@@ -61,6 +62,7 @@
 		_x -= 4;
 		_y -= 4;
 		_w += 8;
+		_h += 8;
 	}
 
 	// Flag the draw area as dirty
@@ -171,8 +173,8 @@
 
 #pragma mark -
 
-SliderWidget::SliderWidget(Dialog *boss, int x, int y, int w, int h, const String &label, uint32 cmd, uint8 hotkey)
-	: ButtonWidget(boss, x, y, w, h, label, cmd, hotkey),
+SliderWidget::SliderWidget(Dialog *boss, int x, int y, int w, int h, uint32 cmd, uint8 hotkey)
+	: ButtonWidget(boss, x, y, w, h, "", cmd, hotkey),
 	  _value(0), _oldValue(0),_valueMin(0), _valueMax(100), _isDragging(false) {
 	_flags = WIDGET_ENABLED | WIDGET_TRACK_MOUSE | WIDGET_CLEARBG;
 	_type = kSliderWidget;

Index: widget.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui/widget.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- widget.h	2 Oct 2003 17:43:02 -0000	1.20
+++ widget.h	1 Nov 2003 22:21:18 -0000	1.21
@@ -203,7 +203,7 @@
 	int		_valueMin, _valueMax;
 	bool	_isDragging;
 public:
-	SliderWidget(Dialog *boss, int x, int y, int w, int h, const String &label, uint32 cmd = 0, uint8 hotkey = 0);
+	SliderWidget(Dialog *boss, int x, int y, int w, int h, uint32 cmd = 0, uint8 hotkey = 0);
 	void setValue(int value)	{ _value = value; }
 	int getValue() const		{ return _value; }
 





More information about the Scummvm-git-logs mailing list