diff options
-rw-r--r-- | gui/newgui.cpp | 21 | ||||
-rw-r--r-- | gui/object.cpp | 21 |
2 files changed, 21 insertions, 21 deletions
diff --git a/gui/newgui.cpp b/gui/newgui.cpp index a2b76606dd..3fe0ffacb0 100644 --- a/gui/newgui.cpp +++ b/gui/newgui.cpp @@ -54,27 +54,6 @@ enum { kCursorAnimateDelay = 250 }; -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); - } -} - // Constructor NewGui::NewGui() : _redrawStatus(kRedrawDisabled), _stateIsSaved(false), _cursorAnimateCounter(0), _cursorAnimateTimer(0) { 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 |