diff options
author | Jared Adams <jaxad0127@gmail.com> | 2010-03-01 15:47:15 -0700 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2010-03-01 17:26:24 -0700 |
commit | 67e678094b9fddd21fb3c690130e772937ab2746 (patch) | |
tree | 75b2ee140dcdc1e5be24f47f38ec724a47df7103 /src/gui/widgets/window.cpp | |
parent | 3acb148b6d5fe3b342e4397e2c7de020de6005ff (diff) | |
download | mana-client-67e678094b9fddd21fb3c690130e772937ab2746.tar.gz mana-client-67e678094b9fddd21fb3c690130e772937ab2746.tar.bz2 mana-client-67e678094b9fddd21fb3c690130e772937ab2746.tar.xz mana-client-67e678094b9fddd21fb3c690130e772937ab2746.zip |
Merge WindowContainer into Viewport and remove extra members
Reviewed-by: Chuck Miller
Diffstat (limited to 'src/gui/widgets/window.cpp')
-rw-r--r-- | src/gui/widgets/window.cpp | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp index 83c918cf..4d70df84 100644 --- a/src/gui/widgets/window.cpp +++ b/src/gui/widgets/window.cpp @@ -31,7 +31,6 @@ #include "gui/widgets/layout.h" #include "gui/widgets/resizegrip.h" -#include "gui/widgets/windowcontainer.h" #include "resources/image.h" @@ -63,8 +62,8 @@ Window::Window(const std::string &caption, bool modal, Window *parent, { logger->log("Window::Window(\"%s\")", caption.c_str()); - if (!windowContainer) - throw GCN_EXCEPTION("Window::Window(): no windowContainer set"); + if (!viewport) + throw GCN_EXCEPTION("Window::Window(): no viewport set"); instances++; @@ -75,8 +74,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 window container - windowContainer->add(this); + // Add this window to the viewport + viewport->add(this); if (mModal) { @@ -88,6 +87,8 @@ Window::Window(const std::string &caption, bool modal, Window *parent, setVisible(false); addWidgetListener(this); + + setFocusable(true); } Window::~Window() @@ -108,11 +109,6 @@ Window::~Window() mSkin->instances--; } -void Window::setWindowContainer(WindowContainer *wc) -{ - windowContainer = wc; -} - void Window::draw(gcn::Graphics *graphics) { Graphics *g = static_cast<Graphics*>(graphics); @@ -336,7 +332,7 @@ void Window::setVisible(bool visible, bool forceSticky) void Window::scheduleDelete() { - windowContainer->scheduleDelete(this); + viewport->scheduleDelete(this); } void Window::mousePressed(gcn::MouseEvent &event) @@ -431,9 +427,6 @@ void Window::mouseMoved(gcn::MouseEvent &event) default: gui->setCursorType(Gui::CURSOR_POINTER); } - - if (viewport) - viewport->hideBeingPopup(); } void Window::mouseDragged(gcn::MouseEvent &event) |