summaryrefslogtreecommitdiff
path: root/src/gui/window.h
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2005-01-11 16:15:10 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2005-01-11 16:15:10 +0000
commitcaeba363798727f75972ce6b8625fd9754bee903 (patch)
tree619fbff5801278d5b4f98413e354ea73a87f34bc /src/gui/window.h
parent24bf86763cdba47e9a88124a3394882667169185 (diff)
downloadmana-client-caeba363798727f75972ce6b8625fd9754bee903.tar.gz
mana-client-caeba363798727f75972ce6b8625fd9754bee903.tar.bz2
mana-client-caeba363798727f75972ce6b8625fd9754bee903.tar.xz
mana-client-caeba363798727f75972ce6b8625fd9754bee903.zip
Implemented parent relationship for Window class and converted more ok dialogs
to the OkDialog class.
Diffstat (limited to 'src/gui/window.h')
-rw-r--r--src/gui/window.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/gui/window.h b/src/gui/window.h
index b80a14c1..39d04ddb 100644
--- a/src/gui/window.h
+++ b/src/gui/window.h
@@ -38,12 +38,14 @@ class Window : public gcn::Container, public gcn::MouseListener
{
protected:
gcn::Container *chrome; /**< Contained container */
+ Window *parent; /**< The parent window */
std::string caption; /**< Title bar caption */
int z; /**< Z position of the window */
int mousePX; /**< Mouse down location */
int mousePY; /**< Mouse down location */
int snapSize; /**< Snap distance to window edge */
bool mouseDown; /**< Mouse button state */
+ bool modal; /**< Window is modal */
gcn::Color titlebarColor; /**< Title bar color */
int titlebarHeight; /**< Height of title bar */
@@ -62,7 +64,8 @@ class Window : public gcn::Container, public gcn::MouseListener
* @param text The initial window title, "Window" by default.
* @param modal Block input to other windows.
*/
- Window(const std::string& text = "Window", bool modal = false);
+ Window(const std::string& text = "Window", bool modal = false,
+ Window *parent = NULL);
/**
* Destructor.
@@ -119,6 +122,19 @@ class Window : public gcn::Container, public gcn::MouseListener
*/
void setSize(int width, int height);
+ /**
+ * Returns the parent window.
+ *
+ * @return The parent window or <code>NULL</code> if there is none.
+ */
+ Window *getParentWindow();
+
+ /**
+ * Returns wether this window is modal. This doesn't necessarily mean
+ * that is gets input as a child modal window could get it.
+ */
+ bool isModal();
+
// Mouse handling
void mousePress(int mx, int my, int button);