diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-01-08 01:33:53 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-01-08 01:33:53 +0000 |
commit | ee416a5f3de03a689247a290077e7fdf451e1a23 (patch) | |
tree | f456df99f954919ac7a425606df51f010aa4ef2d /src/gui/window.cpp | |
parent | 4070dda1560bc729c3e272f0a5c03d77391e2661 (diff) | |
download | mana-ee416a5f3de03a689247a290077e7fdf451e1a23.tar.gz mana-ee416a5f3de03a689247a290077e7fdf451e1a23.tar.bz2 mana-ee416a5f3de03a689247a290077e7fdf451e1a23.tar.xz mana-ee416a5f3de03a689247a290077e7fdf451e1a23.zip |
Well improved window container and window widgets a bit, and made a start
on support for modal dialogs. Still some issues to work out. Tell me if you
experience something unsettling.
Diffstat (limited to 'src/gui/window.cpp')
-rw-r--r-- | src/gui/window.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/gui/window.cpp b/src/gui/window.cpp index 52665213..19621c07 100644 --- a/src/gui/window.cpp +++ b/src/gui/window.cpp @@ -25,7 +25,9 @@ #include "gui.h" #include <guichan/allegro.hpp> -Window::Window(gcn::Container *parent, const std::string& text) : +WindowContainer *Window::windowContainer = NULL; + +Window::Window(const std::string& text, bool modal): caption(text), mousePX(0), mousePY(0), @@ -53,8 +55,13 @@ Window::Window(gcn::Container *parent, const std::string& text) : chrome->setY(titlebarHeight); gcn::Container::add(chrome); - // Add this window to the parent container - parent->add(this); + // Add this window to the window container + if (windowContainer) { + windowContainer->add(this, modal); + } + else { + throw GCN_EXCEPTION("Window::Window. no windowContainer set"); + } } Window::~Window() @@ -67,6 +74,11 @@ Window::~Window() delete chrome; } +void Window::setWindowContainer(WindowContainer *wc) +{ + windowContainer = wc; +} + void Window::draw(gcn::Graphics* graphics) { // Draw container background when opaque |