diff options
Diffstat (limited to 'src/gui/widgets/window.cpp')
-rw-r--r-- | src/gui/widgets/window.cpp | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp index 4d70df84..83c918cf 100644 --- a/src/gui/widgets/window.cpp +++ b/src/gui/widgets/window.cpp @@ -31,6 +31,7 @@ #include "gui/widgets/layout.h" #include "gui/widgets/resizegrip.h" +#include "gui/widgets/windowcontainer.h" #include "resources/image.h" @@ -62,8 +63,8 @@ Window::Window(const std::string &caption, bool modal, Window *parent, { logger->log("Window::Window(\"%s\")", caption.c_str()); - if (!viewport) - throw GCN_EXCEPTION("Window::Window(): no viewport set"); + if (!windowContainer) + throw GCN_EXCEPTION("Window::Window(): no windowContainer set"); instances++; @@ -74,8 +75,8 @@ Window::Window(const std::string &caption, bool modal, Window *parent, // Loads the skin mSkin = SkinLoader::instance()->load(skin, mDefaultSkinPath); - // Add this window to the viewport - viewport->add(this); + // Add this window to the window container + windowContainer->add(this); if (mModal) { @@ -87,8 +88,6 @@ Window::Window(const std::string &caption, bool modal, Window *parent, setVisible(false); addWidgetListener(this); - - setFocusable(true); } Window::~Window() @@ -109,6 +108,11 @@ Window::~Window() mSkin->instances--; } +void Window::setWindowContainer(WindowContainer *wc) +{ + windowContainer = wc; +} + void Window::draw(gcn::Graphics *graphics) { Graphics *g = static_cast<Graphics*>(graphics); @@ -332,7 +336,7 @@ void Window::setVisible(bool visible, bool forceSticky) void Window::scheduleDelete() { - viewport->scheduleDelete(this); + windowContainer->scheduleDelete(this); } void Window::mousePressed(gcn::MouseEvent &event) @@ -427,6 +431,9 @@ void Window::mouseMoved(gcn::MouseEvent &event) default: gui->setCursorType(Gui::CURSOR_POINTER); } + + if (viewport) + viewport->hideBeingPopup(); } void Window::mouseDragged(gcn::MouseEvent &event) |