From ee416a5f3de03a689247a290077e7fdf451e1a23 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Sat, 8 Jan 2005 01:33:53 +0000 Subject: 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. --- src/gui/windowcontainer.h | 51 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) (limited to 'src/gui/windowcontainer.h') 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 @@ -38,14 +38,65 @@ 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 NULL 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 deathList; }; #endif -- cgit v1.2.3-70-g09d2