summaryrefslogtreecommitdiff
path: root/src/gui/widgets/popup.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2010-03-02 13:42:14 +0000
committerJared Adams <jaxad0127@gmail.com>2010-03-02 13:42:14 +0000
commit0c8c8cf7ea63def0d454f30227584a5f3062c013 (patch)
tree9929ddd6c0ecaffef0d75411eeaea2f9fa7fbdfd /src/gui/widgets/popup.cpp
parent4ff5c3b854215b1f55e70106a4c53225fc953619 (diff)
downloadMana-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/popup.cpp')
-rw-r--r--src/gui/widgets/popup.cpp23
1 files changed, 18 insertions, 5 deletions
diff --git a/src/gui/widgets/popup.cpp b/src/gui/widgets/popup.cpp
index 1bfd7fd2..970b21ec 100644
--- a/src/gui/widgets/popup.cpp
+++ b/src/gui/widgets/popup.cpp
@@ -29,6 +29,8 @@
#include "gui/skin.h"
#include "gui/viewport.h"
+#include "gui/widgets/windowcontainer.h"
+
#include "resources/image.h"
#include <guichan/exception.hpp>
@@ -43,16 +45,16 @@ Popup::Popup(const std::string &name, const std::string &skin):
{
logger->log("Popup::Popup(\"%s\")", name.c_str());
- if (!viewport)
- throw GCN_EXCEPTION("Popup::Popup(): no viewport set");
+ if (!windowContainer)
+ throw GCN_EXCEPTION("Popup::Popup(): no windowContainer set");
setPadding(3);
// 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);
// Popups are invisible by default
setVisible(false);
@@ -67,6 +69,11 @@ Popup::~Popup()
mSkin->instances--;
}
+void Popup::setWindowContainer(WindowContainer *wc)
+{
+ windowContainer = wc;
+}
+
void Popup::loadPopupConfiguration()
{
if (mPopupName.empty())
@@ -161,7 +168,7 @@ void Popup::setMaxHeight(int height)
void Popup::scheduleDelete()
{
- viewport->scheduleDelete(this);
+ windowContainer->scheduleDelete(this);
}
void Popup::position(int x, int y)
@@ -180,3 +187,9 @@ void Popup::position(int x, int y)
setVisible(true);
requestMoveToTop();
}
+
+void Popup::mouseMoved(gcn::MouseEvent &event)
+{
+ if (viewport)
+ viewport->hideBeingPopup();
+}