From caeba363798727f75972ce6b8625fd9754bee903 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Tue, 11 Jan 2005 16:15:10 +0000 Subject: Implemented parent relationship for Window class and converted more ok dialogs to the OkDialog class. --- src/gui/window.cpp | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'src/gui/window.cpp') 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); -- cgit v1.2.3-70-g09d2