From 6a7d3f9343f29bd9b46f3bbac917aa190b42b14d Mon Sep 17 00:00:00 2001 From: Jared Adams Date: Fri, 1 May 2009 14:35:41 -0600 Subject: Merge the NPC dialogs into one Also add support for the new TMWServ NPC packets --- src/gui/widgets/window.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/gui/widgets/window.cpp') diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp index 7de09994..87051686 100644 --- a/src/gui/widgets/window.cpp +++ b/src/gui/widgets/window.cpp @@ -687,6 +687,19 @@ Layout &Window::getLayout() return *mLayout; } +void Window::clearLayout() +{ + clear(); // This removes widgets from the container + + while (!mWidgets.empty()) + delete mWidgets.front(); + + if (!mLayout) + delete mLayout; + mLayout = new Layout; + +} + LayoutCell &Window::place(int x, int y, gcn::Widget *wg, int w, int h) { add(wg); @@ -707,6 +720,17 @@ void Window::reflowLayout(int w, int h) setContentSize(w, h); } +void Window::redraw() +{ + if (mLayout) + { + const gcn::Rectangle area = getChildrenArea(); + int w = area.width; + int h = area.height; + mLayout->reflow(w, h); + } +} + void Window::center() { setLocationRelativeTo(getParent()); -- cgit v1.2.3-70-g09d2