From 70cbdccac913638f8c153676b56428fcb39b6728 Mon Sep 17 00:00:00 2001 From: David Elliott Date: Wed, 14 Apr 2004 16:26:24 +0000 Subject: [PATCH] Quick hack removing wxDIALOG_MODAL git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26775 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/mac/classic/dialog.h | 10 +++++++--- src/mac/classic/dialog.cpp | 10 +++++----- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/include/wx/mac/classic/dialog.h b/include/wx/mac/classic/dialog.h index e6834011c5..490cd0af5c 100644 --- a/include/wx/mac/classic/dialog.h +++ b/include/wx/mac/classic/dialog.h @@ -30,7 +30,7 @@ class WXDLLEXPORT wxDialog : public wxDialogBase DECLARE_DYNAMIC_CLASS(wxDialog) public: - wxDialog(); + wxDialog() { Init(); } // Constructor with a modal flag, but no window id - the old convention wxDialog(wxWindow *parent, @@ -39,9 +39,10 @@ public: long style = wxDEFAULT_DIALOG_STYLE, const wxString& name = wxDialogNameStr) { - long modalStyle = modal ? wxDIALOG_MODAL : wxDIALOG_MODELESS ; + Init(); + m_isModalStyle = modal; Create(parent, -1, title, wxPoint(x, y), wxSize(width, height), - style | modalStyle, name); + style, name); } // Constructor with no modal flag - the new convention. @@ -52,6 +53,7 @@ public: long style = wxDEFAULT_DIALOG_STYLE, const wxString& name = wxDialogNameStr) { + Init(); Create(parent, id, title, pos, size, style, name); } @@ -98,6 +100,8 @@ public: void DoShowModal(); private: + void Init(); + bool m_isModalStyle; DECLARE_EVENT_TABLE() }; diff --git a/src/mac/classic/dialog.cpp b/src/mac/classic/dialog.cpp index f29ed3e59e..c5f6c57119 100644 --- a/src/mac/classic/dialog.cpp +++ b/src/mac/classic/dialog.cpp @@ -44,9 +44,9 @@ END_EVENT_TABLE() #endif -wxDialog::wxDialog() +wxDialog::Init() { - m_isShown = FALSE; + m_isModalStyle = false; SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE)); } @@ -75,7 +75,7 @@ void wxDialog::SetModal(bool flag) { if ( flag ) { - m_windowStyle |= wxDIALOG_MODAL; + m_isModalStyle = true; wxModelessWindows.DeleteObject(this); #if TARGET_CARBON @@ -84,7 +84,7 @@ void wxDialog::SetModal(bool flag) } else { - m_windowStyle &= ~wxDIALOG_MODAL; + m_isModalStyle = false; wxModelessWindows.Append(this); } @@ -117,7 +117,7 @@ void wxDialog::OnCharHook(wxKeyEvent& event) bool wxDialog::IsModal() const { - return (GetWindowStyleFlag() & wxDIALOG_MODAL) != 0; + return m_isModalStyle; } -- 2.45.2