From 71fd4e8d3255e15c16a4f4b51c87222c661a5b33 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 5 May 2015 18:29:07 +0300 Subject: Add strong typed bool type for modal bool flag. --- src/gui/widgets/window.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/gui/widgets/window.cpp') diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp index f29027566..c438b5475 100644 --- a/src/gui/widgets/window.cpp +++ b/src/gui/widgets/window.cpp @@ -98,8 +98,10 @@ const int resizeMask = 8 + 4 + 2 + 1; int Window::windowInstances = 0; int Window::mouseResize = 0; -Window::Window(const std::string &caption, const bool modal, - Window *const parent, std::string skin) : +Window::Window(const std::string &caption, + const Modal modal, + Window *const parent, + std::string skin) : BasicContainer2(nullptr), MouseListener(), WidgetListener(), @@ -137,8 +139,8 @@ Window::Window(const std::string &caption, const bool modal, mResizeHandles(-1), mOldResizeHandles(-1), mCaptionFont(getFont()), - mShowTitle(true), mModal(modal), + mShowTitle(true), mCloseWindowButton(false), mDefaultVisible(false), mSaveVisible(false), @@ -201,7 +203,7 @@ Window::Window(const std::string &caption, const bool modal, if (windowContainer) windowContainer->add(this); - if (mModal) + if (mModal == Modal_true) { gui->setCursorType(Cursor::CURSOR_POINTER); requestModalFocus(); @@ -938,12 +940,12 @@ void Window::mouseDragged(MouseEvent &event) } } -void Window::setModal(const bool modal) +void Window::setModal(const Modal modal) { if (mModal != modal) { mModal = modal; - if (mModal) + if (mModal == Modal_true) { if (gui) gui->setCursorType(Cursor::CURSOR_POINTER); -- cgit v1.2.3-60-g2f50