aboutsummaryrefslogtreecommitdiff
path: root/gui/object.cpp
diff options
context:
space:
mode:
authorMax Horn2008-11-03 16:42:23 +0000
committerMax Horn2008-11-03 16:42:23 +0000
commit646666125232064f2c4657c4025433b243e42af9 (patch)
tree6858ae3802687207b0821923e468e9aaaf5af532 /gui/object.cpp
parent55da1fdd290554bd79b39981182bb7a536799580 (diff)
downloadscummvm-rg350-646666125232064f2c4657c4025433b243e42af9.tar.gz
scummvm-rg350-646666125232064f2c4657c4025433b243e42af9.tar.bz2
scummvm-rg350-646666125232064f2c4657c4025433b243e42af9.zip
Moved GuiObject::reflowLayout from newgui.cpp to object.cpp
svn-id: r34882
Diffstat (limited to 'gui/object.cpp')
-rw-r--r--gui/object.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/gui/object.cpp b/gui/object.cpp
index 8b22338801..f3022ad61a 100644
--- a/gui/object.cpp
+++ b/gui/object.cpp
@@ -25,6 +25,7 @@
#include "common/system.h"
#include "gui/object.h"
#include "gui/widget.h"
+#include "gui/newgui.h"
namespace GUI {
@@ -41,5 +42,25 @@ uint32 GuiObject::getMillis() {
return g_system->getMillis();
}
+void GuiObject::reflowLayout() {
+ if (!_name.empty()) {
+ if (!g_gui.xmlEval()->getWidgetData(_name, _x, _y, _w, _h)) {
+ error("Could not load widget position for '%s'", _name.c_str());
+ }
+
+ if (_x < 0)
+ error("Widget <%s> has x < 0: %d", _name.c_str(), _x);
+ if (_x >= g_system->getOverlayWidth())
+ error("Widget <%s> has x > %d", _name.c_str(), g_system->getOverlayWidth());
+ if (_x + _w > g_system->getOverlayWidth())
+ error("Widget <%s> has x + w > %d (%d)", _name.c_str(), g_system->getOverlayWidth(), _x + _w);
+ if (_y < 0)
+ error("Widget <%s> has y < 0", _name.c_str());
+ if (_y >= g_system->getOverlayHeight())
+ error("Widget <%s> has y > %d", _name.c_str(), g_system->getOverlayHeight());
+ if (_y + _h > g_system->getOverlayHeight())
+ error("Widget <%s> has y + h > %d (%d)", _name.c_str(), g_system->getOverlayHeight(), _y + _h);
+ }
+}
} // End of namespace GUI