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

sev at users.sourceforge.net sev at users.sourceforge.net
Tue Mar 7 05:43:01 CET 2006


Revision: 21123
Author:   sev
Date:     2006-03-07 05:41:36 -0800 (Tue, 07 Mar 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=21123&view=rev

Log Message:
-----------
GUI widget positions:
o Add 'true' and 'false' constants
o add .visible widget property
o allow dots to be part of section and key names in configs

Modified Paths:
--------------
    scummvm/trunk/common/config-file.cpp
    scummvm/trunk/gui/eval.cpp
    scummvm/trunk/gui/newgui.cpp
    scummvm/trunk/gui/object.h
    scummvm/trunk/gui/widget.cpp
    scummvm/trunk/gui/widget.h
Modified: scummvm/trunk/common/config-file.cpp
===================================================================
--- scummvm/trunk/common/config-file.cpp	2006-03-07 10:14:04 UTC (rev 21122)
+++ scummvm/trunk/common/config-file.cpp	2006-03-07 13:41:36 UTC (rev 21123)
@@ -51,7 +51,7 @@
  */
 bool ConfigFile::isValidName(const Common::String &name) {
 	const char *p = name.c_str();
-	while (*p && (isalnum(*p) || *p == '-' || *p == '_'))
+	while (*p && (isalnum(*p) || *p == '-' || *p == '_' || *p == '.'))
 		p++;
 	return *p == 0;
 }

Modified: scummvm/trunk/gui/eval.cpp
===================================================================
--- scummvm/trunk/gui/eval.cpp	2006-03-07 10:14:04 UTC (rev 21122)
+++ scummvm/trunk/gui/eval.cpp	2006-03-07 13:41:36 UTC (rev 21123)
@@ -236,6 +236,9 @@
 	{"kBigButtonHeight", GUI::kBigButtonHeight},
 	{"kBigSliderWidth", GUI::kBigSliderWidth},
 	{"kBigSliderHeight", GUI::kBigSliderHeight},
+
+	{"false", 0},
+	{"true", 1},
 	{NULL, 0}
 };
 

Modified: scummvm/trunk/gui/newgui.cpp
===================================================================
--- scummvm/trunk/gui/newgui.cpp	2006-03-07 10:14:04 UTC (rev 21122)
+++ scummvm/trunk/gui/newgui.cpp	2006-03-07 13:41:36 UTC (rev 21123)
@@ -62,6 +62,7 @@
 	_y = g_gui.evaluator()->getVar(name + ".y");
 	_w = g_gui.evaluator()->getVar(name + ".w");
 	_h = g_gui.evaluator()->getVar(name + ".h");
+	_name = name;
 }
 
 

Modified: scummvm/trunk/gui/object.h
===================================================================
--- scummvm/trunk/gui/object.h	2006-03-07 10:14:04 UTC (rev 21122)
+++ scummvm/trunk/gui/object.h	2006-03-07 13:41:36 UTC (rev 21123)
@@ -59,11 +59,12 @@
 protected:
 	int16		_x, _y;
 	uint16		_w, _h;
+	Common::String _name;
 
 	Widget		*_firstWidget;
 
 public:
-	GuiObject(int x, int y, int w, int h) : _x(x), _y(y), _w(w), _h(h), _firstWidget(0) { }
+	GuiObject(int x, int y, int w, int h) : _x(x), _y(y), _w(w), _h(h), _firstWidget(0), _name("") { }
 	GuiObject(Common::String name);
 
 	virtual int16	getAbsX() const		{ return _x; }

Modified: scummvm/trunk/gui/widget.cpp
===================================================================
--- scummvm/trunk/gui/widget.cpp	2006-03-07 10:14:04 UTC (rev 21122)
+++ scummvm/trunk/gui/widget.cpp	2006-03-07 13:41:36 UTC (rev 21123)
@@ -113,6 +113,14 @@
 	return w;
 }
 
+bool Widget::isVisible() const {
+	if (g_gui.evaluator()->getVar(_name + ".visible") == 0)
+		return false;
+
+	return !(_flags & WIDGET_INVISIBLE);
+}
+
+
 #pragma mark -
 
 StaticTextWidget::StaticTextWidget(GuiObject *boss, int x, int y, int w, int h, const String &text, TextAlignment align, WidgetSize ws)

Modified: scummvm/trunk/gui/widget.h
===================================================================
--- scummvm/trunk/gui/widget.h	2006-03-07 10:14:04 UTC (rev 21122)
+++ scummvm/trunk/gui/widget.h	2006-03-07 13:41:36 UTC (rev 21123)
@@ -137,7 +137,7 @@
 
 	void setEnabled(bool e)		{ if (e) setFlags(WIDGET_ENABLED); else clearFlags(WIDGET_ENABLED); }
 	bool isEnabled() const		{ return _flags & WIDGET_ENABLED; }
-	bool isVisible() const		{ return !(_flags & WIDGET_INVISIBLE); }
+	bool isVisible() const;
 
 protected:
 	virtual void drawWidget(bool hilite) {}


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