diff options
author | Jared Adams <jaxad0127@gmail.com> | 2010-03-02 13:42:14 +0000 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2010-03-02 13:42:14 +0000 |
commit | 0c8c8cf7ea63def0d454f30227584a5f3062c013 (patch) | |
tree | 9929ddd6c0ecaffef0d75411eeaea2f9fa7fbdfd /src/gui/widgets/window.cpp | |
parent | 4ff5c3b854215b1f55e70106a4c53225fc953619 (diff) | |
download | mana-0c8c8cf7ea63def0d454f30227584a5f3062c013.tar.gz mana-0c8c8cf7ea63def0d454f30227584a5f3062c013.tar.bz2 mana-0c8c8cf7ea63def0d454f30227584a5f3062c013.tar.xz mana-0c8c8cf7ea63def0d454f30227584a5f3062c013.zip |
Revert "Merge WindowContainer into Viewport and remove extra members"
This reverts commit 67e678094b9fddd21fb3c690130e772937ab2746.
Conflicts:
src/gui/gui.cpp
src/gui/viewport.cpp
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) |