From 67e678094b9fddd21fb3c690130e772937ab2746 Mon Sep 17 00:00:00 2001 From: Jared Adams Date: Mon, 1 Mar 2010 15:47:15 -0700 Subject: Merge WindowContainer into Viewport and remove extra members Reviewed-by: Chuck Miller --- src/gui/widgets/popup.cpp | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) (limited to 'src/gui/widgets/popup.cpp') diff --git a/src/gui/widgets/popup.cpp b/src/gui/widgets/popup.cpp index 970b21ec..1bfd7fd2 100644 --- a/src/gui/widgets/popup.cpp +++ b/src/gui/widgets/popup.cpp @@ -29,8 +29,6 @@ #include "gui/skin.h" #include "gui/viewport.h" -#include "gui/widgets/windowcontainer.h" - #include "resources/image.h" #include @@ -45,16 +43,16 @@ Popup::Popup(const std::string &name, const std::string &skin): { logger->log("Popup::Popup(\"%s\")", name.c_str()); - if (!windowContainer) - throw GCN_EXCEPTION("Popup::Popup(): no windowContainer set"); + if (!viewport) + throw GCN_EXCEPTION("Popup::Popup(): no viewport set"); setPadding(3); // 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); // Popups are invisible by default setVisible(false); @@ -69,11 +67,6 @@ Popup::~Popup() mSkin->instances--; } -void Popup::setWindowContainer(WindowContainer *wc) -{ - windowContainer = wc; -} - void Popup::loadPopupConfiguration() { if (mPopupName.empty()) @@ -168,7 +161,7 @@ void Popup::setMaxHeight(int height) void Popup::scheduleDelete() { - windowContainer->scheduleDelete(this); + viewport->scheduleDelete(this); } void Popup::position(int x, int y) @@ -187,9 +180,3 @@ void Popup::position(int x, int y) setVisible(true); requestMoveToTop(); } - -void Popup::mouseMoved(gcn::MouseEvent &event) -{ - if (viewport) - viewport->hideBeingPopup(); -} -- cgit v1.2.3-70-g09d2