summaryrefslogtreecommitdiff
path: root/src/gui/windowcontainer.h
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2005-01-08 01:33:53 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2005-01-08 01:33:53 +0000
commitee416a5f3de03a689247a290077e7fdf451e1a23 (patch)
treef456df99f954919ac7a425606df51f010aa4ef2d /src/gui/windowcontainer.h
parent4070dda1560bc729c3e272f0a5c03d77391e2661 (diff)
downloadmana-client-ee416a5f3de03a689247a290077e7fdf451e1a23.tar.gz
mana-client-ee416a5f3de03a689247a290077e7fdf451e1a23.tar.bz2
mana-client-ee416a5f3de03a689247a290077e7fdf451e1a23.tar.xz
mana-client-ee416a5f3de03a689247a290077e7fdf451e1a23.zip
Well improved window container and window widgets a bit, and made a start
on support for modal dialogs. Still some issues to work out. Tell me if you experience something unsettling.
Diffstat (limited to 'src/gui/windowcontainer.h')
-rw-r--r--src/gui/windowcontainer.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/gui/windowcontainer.h b/src/gui/windowcontainer.h
index e74b1831..8b5753a5 100644
--- a/src/gui/windowcontainer.h
+++ b/src/gui/windowcontainer.h
@@ -39,13 +39,64 @@ class WindowContainer : public gcn::Container {
WindowContainer();
/**
+ * Do GUI logic. This functions adds automatic deletion of objects that
+ * volunteered to be deleted.
+ */
+ void logic();
+
+ /**
* Handles mouse input messages. Differs from standard behaviour in
* that widget with mouse doesn't change while a button is pressed.
*/
void _mouseInputMessage(const gcn::MouseInput &mouseInput);
+ /**
+ * Adds a widget. The widget can be set to be modal, which will ensure
+ * only that widget will receive input.
+ */
+ void add(gcn::Widget *widget, bool modal = false);
+
+ /**
+ * Removes a widget.
+ */
+ void remove(gcn::Widget *widget);
+
+ /**
+ * This function is called by the containers children when they get
+ * destroyed.
+ */
+ void _announceDeath(gcn::Widget *widget);
+
+ /**
+ * Clears the container of all widgets.
+ */
+ void clear();
+
+ /**
+ * Sets the modal widget. This will ensure only this widget will
+ * receive mouse or keyboard input events.
+ *
+ * @see Window::Window
+ */
+ void setModalWidget(gcn::Widget *widget);
+
+ /**
+ * Returns the current modal widget, or <code>NULL</code> if there
+ * is none.
+ */
+ gcn::Widget *getModalWidget();
+
+ /**
+ * Schedule a widget for deletion. It will be deleted at the start of
+ * the next logic update.
+ */
+ void scheduleDelete(gcn::Widget *widget);
+
protected:
bool mouseDown;
+ gcn::Widget *modalWidget;
+
+ std::list<gcn::Widget*> deathList;
};
#endif