summaryrefslogtreecommitdiff
path: root/src/gui/window.cpp
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.cpp
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.cpp')
-rw-r--r--src/gui/window.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/gui/window.cpp b/src/gui/window.cpp
index 19621c07..9ab17799 100644
--- a/src/gui/window.cpp
+++ b/src/gui/window.cpp
@@ -27,14 +27,20 @@
WindowContainer *Window::windowContainer = NULL;
-Window::Window(const std::string& text, bool modal):
+Window::Window(const std::string& text, bool modal, Window *parent):
+ parent(parent),
caption(text),
mousePX(0),
mousePY(0),
snapSize(8),
mouseDown(false),
+ modal(modal),
titlebarHeight(20)
{
+#ifdef __DEBUG
+ std::cout << "Window::Window(\"" << caption << "\")\n";
+#endif
+
titlebarColor.r = 203;
titlebarColor.g = 203;
titlebarColor.b = 203;
@@ -66,6 +72,10 @@ Window::Window(const std::string& text, bool modal):
Window::~Window()
{
+#ifdef __DEBUG
+ std::cout << "Window::~Window(\"" << caption << "\")\n";
+#endif
+
// Free dialog bitmaps
release_bitmap(dLeft);
release_bitmap(dMid);
@@ -172,6 +182,16 @@ void Window::setSize(int width, int height)
setHeight(height);
}
+Window *Window::getParentWindow()
+{
+ return parent;
+}
+
+bool Window::isModal()
+{
+ return modal;
+}
+
void Window::add(gcn::Widget *w)
{
chrome->add(w);