diff options
| author | Max Horn | 2008-11-12 12:53:53 +0000 | 
|---|---|---|
| committer | Max Horn | 2008-11-12 12:53:53 +0000 | 
| commit | fa942c42cc780f34b96fc308a2b7fdde52088e42 (patch) | |
| tree | 9da5c5d5e2b6d057a7f713f281ff1d461aeaa004 | |
| parent | 201c26fcd0ad71568a3581a5520c094d93ec6d06 (diff) | |
| download | scummvm-rg350-fa942c42cc780f34b96fc308a2b7fdde52088e42.tar.gz scummvm-rg350-fa942c42cc780f34b96fc308a2b7fdde52088e42.tar.bz2 scummvm-rg350-fa942c42cc780f34b96fc308a2b7fdde52088e42.zip | |
GUI: Got rid of most 'built-in' variables
svn-id: r35018
| -rw-r--r-- | gui/ThemeEval.cpp | 10 | ||||
| -rw-r--r-- | gui/dialog.cpp | 14 | ||||
| -rw-r--r-- | gui/dialog.h | 2 | ||||
| -rw-r--r-- | gui/message.cpp | 25 | ||||
| -rw-r--r-- | gui/message.h | 3 | ||||
| -rw-r--r-- | gui/themes/default.inc | 8 | ||||
| -rw-r--r-- | gui/themes/scummclassic.zip | bin | 43768 -> 43674 bytes | |||
| -rw-r--r-- | gui/themes/scummclassic/classic_layout.stx | 4 | ||||
| -rw-r--r-- | gui/themes/scummclassic/classic_layout_320.stx | 4 | ||||
| -rw-r--r-- | gui/themes/scummmodern.zip | bin | 144225 -> 144131 bytes | |||
| -rw-r--r-- | gui/themes/scummmodern/scummmodern_layout.stx | 4 | ||||
| -rw-r--r-- | gui/themes/scummmodern/scummmodern_layout_320.stx | 4 | ||||
| -rw-r--r-- | gui/widget.h | 13 | 
13 files changed, 40 insertions, 51 deletions
| diff --git a/gui/ThemeEval.cpp b/gui/ThemeEval.cpp index 229077722c..a448048d60 100644 --- a/gui/ThemeEval.cpp +++ b/gui/ThemeEval.cpp @@ -39,16 +39,6 @@ void ThemeEval::buildBuiltinVars() {  	_builtin["kThumbnailHeight"] = kThumbnailHeight1;  	_builtin["kThumbnailHeight2"] = kThumbnailHeight2; -	_builtin["kButtonWidth"] = GUI::kButtonWidth; -	_builtin["kButtonHeight"] = GUI::kButtonHeight; -	_builtin["kSliderWidth"] = GUI::kSliderWidth; -	_builtin["kSliderHeight"] = GUI::kSliderHeight; -	_builtin["kBigButtonWidth"] = GUI::kBigButtonWidth; -	_builtin["kBigButtonHeight"] = GUI::kBigButtonHeight; -	_builtin["kBigSliderWidth"] = GUI::kBigSliderWidth; -	_builtin["kBigSliderWidth"] = GUI::kBigSliderWidth; -	_builtin["kBigSliderHeight"] = GUI::kBigSliderHeight; -	  	_builtin["kNormalWidgetSize"] = GUI::kNormalWidgetSize;  	_builtin["kBigWidgetSize"] = GUI::kBigWidgetSize;  } diff --git a/gui/dialog.cpp b/gui/dialog.cpp index b11bf5bf26..ce3e5d609c 100644 --- a/gui/dialog.cpp +++ b/gui/dialog.cpp @@ -344,18 +344,4 @@ void Dialog::removeWidget(Widget *del) {  	}  } -ButtonWidget *Dialog::addButton(GuiObject *boss, int x, int y, const Common::String &label, uint32 cmd, char hotkey) { -	int w, h; - -	if (g_gui.getWidgetSize() == kBigWidgetSize) { -		w = kBigButtonWidth; -		h = kBigButtonHeight; -	} else { -		w = kButtonWidth; -		h = kButtonHeight; -	} - -	return new ButtonWidget(boss, x, y, w, h, label, cmd, hotkey); -} -  } // End of namespace GUI diff --git a/gui/dialog.h b/gui/dialog.h index 26e71cc600..0aa52c4972 100644 --- a/gui/dialog.h +++ b/gui/dialog.h @@ -86,8 +86,6 @@ protected:  	Widget *findWidget(const char *name);  	void removeWidget(Widget *widget); -	ButtonWidget *addButton(GuiObject *boss, int x, int y, const Common::String &label, uint32 cmd, char hotkey); -  	void setResult(int result) { _result = result; }  	int getResult() const { return _result; }  }; diff --git a/gui/message.cpp b/gui/message.cpp index b4e0f8407b..3fe277c7eb 100644 --- a/gui/message.cpp +++ b/gui/message.cpp @@ -36,6 +36,16 @@ enum {  	kCancelCmd = 'CNCL'  }; + +enum { +	kButtonWidth = 72,	// FIXME: Get rid of this +	kButtonHeight = 16,	// FIXME: Get rid of this + +	kBigButtonWidth = 108,	// FIXME: Get rid of this +	kBigButtonHeight = 24	// FIXME: Get rid of this +}; + +  // TODO: The default button should be visibly distinct from the alternate button  MessageDialog::MessageDialog(const Common::String &message, const char *defaultButton, const char *altButton) @@ -113,6 +123,21 @@ void MessageDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data  	}  } +ButtonWidget *MessageDialog::addButton(GuiObject *boss, int x, int y, const Common::String &label, uint32 cmd, char hotkey) { +	// FIXME: Get rid of this method: Use theme stuff instead. +	int w, h; + +	if (g_gui.getWidgetSize() == kBigWidgetSize) { +		w = kBigButtonWidth; +		h = kBigButtonHeight; +	} else { +		w = kButtonWidth; +		h = kButtonHeight; +	} + +	return new ButtonWidget(boss, x, y, w, h, label, cmd, hotkey); +} +  TimedMessageDialog::TimedMessageDialog(const Common::String &message, uint32 duration)  	: MessageDialog(message, 0, 0) {  	_timer = getMillis() + duration; diff --git a/gui/message.h b/gui/message.h index 912e3b0785..cb27a615c3 100644 --- a/gui/message.h +++ b/gui/message.h @@ -44,6 +44,9 @@ public:  	MessageDialog(const Common::String &message, const char *defaultButton = "OK", const char *altButton = 0);  	void handleCommand(CommandSender *sender, uint32 cmd, uint32 data); + +protected: +	ButtonWidget *addButton(GuiObject *boss, int x, int y, const Common::String &label, uint32 cmd, char hotkey);  };  /** diff --git a/gui/themes/default.inc b/gui/themes/default.inc index 989ae46695..7a5637d85d 100644 --- a/gui/themes/default.inc +++ b/gui/themes/default.inc @@ -327,10 +327,10 @@  "size='60,Globals.Line.Height' "  "/> "  "<widget name='Button' " -"size='kBigButtonWidth,kBigButtonHeight' " +"size='108,24' "  "/> "  "<widget name='Slider' " -"size='kBigSliderWidth,kBigSliderHeight' " +"size='128,18' "  "/> "  "<widget name='PopUp' "  "size='-1,19' " @@ -930,10 +930,10 @@  "<def var='ShowGlobalMenuLogo' value='0'/> "  "<def var='ScummSaveLoad.ExtInfo.Visible' value='0'/> "  "<widget name='Button' " -"size='kButtonWidth,kButtonHeight' " +"size='72,16' "  "/> "  "<widget name='Slider' " -"size='kSliderWidth,kSliderHeight' " +"size='85,12' "  "/> "  "<widget name='OptionsLabel' "  "size='110,Globals.Line.Height' " diff --git a/gui/themes/scummclassic.zip b/gui/themes/scummclassic.zipBinary files differ index 23c24b0fc7..8f5435bb1c 100644 --- a/gui/themes/scummclassic.zip +++ b/gui/themes/scummclassic.zip diff --git a/gui/themes/scummclassic/classic_layout.stx b/gui/themes/scummclassic/classic_layout.stx index 83fa8d91bc..46c1ee105e 100644 --- a/gui/themes/scummclassic/classic_layout.stx +++ b/gui/themes/scummclassic/classic_layout.stx @@ -51,10 +51,10 @@  		/>  		<widget name = 'Button' -				size = 'kBigButtonWidth, kBigButtonHeight' +				size = '108, 24'  		/>  		<widget name = 'Slider' -				size = 'kBigSliderWidth, kBigSliderHeight' +				size = '128, 18'  		/>  		<widget name = 'PopUp' diff --git a/gui/themes/scummclassic/classic_layout_320.stx b/gui/themes/scummclassic/classic_layout_320.stx index 853a6a0327..c2694665a6 100644 --- a/gui/themes/scummclassic/classic_layout_320.stx +++ b/gui/themes/scummclassic/classic_layout_320.stx @@ -40,11 +40,11 @@  		<def var = 'ScummSaveLoad.ExtInfo.Visible' value = '0'/>  		<widget name = 'Button' -				size = 'kButtonWidth, kButtonHeight' +				size = '72, 16'  		/>  		<widget name = 'Slider' -				size = 'kSliderWidth, kSliderHeight' +				size = '85, 12'  		/>  		<widget name = 'OptionsLabel' diff --git a/gui/themes/scummmodern.zip b/gui/themes/scummmodern.zipBinary files differ index f62b2764aa..e4af50c133 100644 --- a/gui/themes/scummmodern.zip +++ b/gui/themes/scummmodern.zip diff --git a/gui/themes/scummmodern/scummmodern_layout.stx b/gui/themes/scummmodern/scummmodern_layout.stx index afeef51d55..ea83a9c291 100644 --- a/gui/themes/scummmodern/scummmodern_layout.stx +++ b/gui/themes/scummmodern/scummmodern_layout.stx @@ -55,12 +55,12 @@  		/>  		<widget name = 'Button' -				size = 'kBigButtonWidth, kBigButtonHeight' +				size = '108, 24'  		/>  		<widget name = 'Slider' -				size = 'kBigSliderWidth, kBigSliderHeight' +				size = '128, 18'  		/>  		<widget name = 'PopUp'  				size = '-1, 19' diff --git a/gui/themes/scummmodern/scummmodern_layout_320.stx b/gui/themes/scummmodern/scummmodern_layout_320.stx index 22a9899b47..89aa3e4012 100644 --- a/gui/themes/scummmodern/scummmodern_layout_320.stx +++ b/gui/themes/scummmodern/scummmodern_layout_320.stx @@ -38,11 +38,11 @@  		<def var = 'ScummSaveLoad.ExtInfo.Visible' value = '0'/>  		<widget name = 'Button' -				size = 'kButtonWidth, kButtonHeight' +				size = '72, 16'  		/>  		<widget name = 'Slider' -				size = 'kSliderWidth, kSliderHeight' +				size = '85, 12'  		/>  		<widget name = 'OptionsLabel' diff --git a/gui/widget.h b/gui/widget.h index f2a6bca751..07c5964207 100644 --- a/gui/widget.h +++ b/gui/widget.h @@ -72,19 +72,6 @@ enum WidgetSize {  	kBigWidgetSize  }; -enum { -	kButtonWidth = 72, -	kButtonHeight = 16, -	kSliderWidth = 85, -	kSliderHeight = 12, - -	kBigButtonWidth = 108, -	kBigButtonHeight = 24, -	kBigSliderWidth = 128, -	kBigSliderHeight = 18 -}; - -  /* Widget */  class Widget : public GuiObject {  	friend class Dialog; | 
