summaryrefslogtreecommitdiff
path: root/src/gui/windowcontainer.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2005-05-18 22:20:08 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2005-05-18 22:20:08 +0000
commit32ca8ca9551070ba1086cd5b6c973620052061ed (patch)
treeac3909b6ed48d51e367094bb7e908fdd98ee9807 /src/gui/windowcontainer.cpp
parent15b899a6651fcdb79ff7a2040327564c2a99124f (diff)
downloadmana-client-32ca8ca9551070ba1086cd5b6c973620052061ed.tar.gz
mana-client-32ca8ca9551070ba1086cd5b6c973620052061ed.tar.bz2
mana-client-32ca8ca9551070ba1086cd5b6c973620052061ed.tar.xz
mana-client-32ca8ca9551070ba1086cd5b6c973620052061ed.zip
Upgrade to Guichan 0.4.0, TMW can no longer compile, link or run against 0.3.0.
Diffstat (limited to 'src/gui/windowcontainer.cpp')
-rw-r--r--src/gui/windowcontainer.cpp124
1 files changed, 1 insertions, 123 deletions
diff --git a/src/gui/windowcontainer.cpp b/src/gui/windowcontainer.cpp
index fad46137..9fd9b002 100644
--- a/src/gui/windowcontainer.cpp
+++ b/src/gui/windowcontainer.cpp
@@ -25,9 +25,7 @@
#include "windowcontainer.h"
#include "window.h"
-WindowContainer::WindowContainer():
- mouseDown(false),
- modalWindow(NULL)
+WindowContainer::WindowContainer()
{
}
@@ -41,128 +39,8 @@ void WindowContainer::logic()
gcn::Container::logic();
}
-/*
-void WindowContainer::_mouseInputMessage(const gcn::MouseInput &mouseInput)
-{
- if (mouseInput.getType() == gcn::MouseInput::PRESS)
- {
- mouseDown = true;
- }
- else if (mouseInput.getType() == gcn::MouseInput::RELEASE)
- {
- mouseDown = false;
- }
-
- // Make drag events not change widget with mouse. The Window instances
- // need this behaviour to be able to handle window dragging.
- if (!(mouseInput.getType() == gcn::MouseInput::MOTION && mouseDown))
- {
- Widget* tempWidgetWithMouse = NULL;
-
- WidgetIterator iter;
- for (iter = mWidgets.begin(); iter != mWidgets.end(); iter++)
- {
- if ((*iter)->getDimension().isPointInRect(
- mouseInput.x, mouseInput.y) &&
- (*iter)->isVisible())
- {
- tempWidgetWithMouse = (*iter);
- }
- }
-
- if (tempWidgetWithMouse != mWidgetWithMouse)
- {
- if (mWidgetWithMouse) {
- mWidgetWithMouse->_mouseOutMessage();
- }
-
- if (tempWidgetWithMouse) {
- tempWidgetWithMouse->_mouseInMessage();
- }
-
- mWidgetWithMouse = tempWidgetWithMouse;
- }
- }
-
- if (mWidgetWithMouse && !mWidgetWithMouse->hasFocus() &&
- (!modalWindow || (gcn::Widget*)modalWindow == mWidgetWithMouse)) {
- gcn::MouseInput mi = mouseInput;
- mi.x -= mWidgetWithMouse->getX();
- mi.y -= mWidgetWithMouse->getY();
- mWidgetWithMouse->_mouseInputMessage(mi);
- }
-
- if (mWidgetWithMouse == NULL) {
- gcn::Widget::_mouseInputMessage(mouseInput);
- }
-}
-*/
-void WindowContainer::add(gcn::Widget *widget)
-{
- gcn::Container::add(widget);
-}
-
-void WindowContainer::add(Window *window, bool modal)
-{
- gcn::Container::add(window);
- if (modal) {
- setModalWindow(window);
- }
-}
-
-void WindowContainer::remove(gcn::Widget *widget)
-{
- if (modalWindow == widget) {
- setModalWindow(NULL);
- }
- gcn::Container::remove(widget);
-}
-
-void WindowContainer::_announceDeath(gcn::Widget *widget)
-{
- if (modalWindow == widget) {
- setModalWindow(NULL);
- }
- gcn::Container::_announceDeath(widget);
-}
-
-void WindowContainer::clear()
-{
- modalWindow = NULL;
- gcn::Container::clear();
-}
-
-void WindowContainer::setModalWindow(Window *window)
-{
- if (modalWindow != window) {
- if (!window) {
- // Removing modal window, at this point there must be a modal
- // window set.
- Window *modalParent = modalWindow->getParentWindow();
- if (modalParent && modalParent->isModal()) {
- // Return modality to parent.
- modalWindow = modalParent;
- return;
- }
- }
- else if (modalWindow && window->getParentWindow() != modalWindow) {
- // Adding a modal window, but failed sanity check.
- std::cerr << "Error: existing modal window not parent.\n";
- return;
- }
- modalWindow = window;
- }
-}
-
-gcn::Widget *WindowContainer::getModalWindow()
-{
- return modalWindow;
-}
void WindowContainer::scheduleDelete(gcn::Widget *widget)
{
- if (widget == (gcn::Widget*)modalWindow) {
- setModalWindow(NULL);
- }
deathList.push_back(widget);
}