X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/62068535c57c64732d49c7d8cf770c05903402c0..6178debcd342963974dbdce6ac2ddb2fbe89e42a:/src/osx/dialog_osx.cpp?ds=sidebyside diff --git a/src/osx/dialog_osx.cpp b/src/osx/dialog_osx.cpp index e605e95f3f..b1b50b980a 100644 --- a/src/osx/dialog_osx.cpp +++ b/src/osx/dialog_osx.cpp @@ -23,10 +23,23 @@ #include "wx/osx/private.h" -// Lists to keep track of windows, so we can disable/enable them -// for modal dialogs +static int s_openDialogs = 0; +bool wxDialog::OSXHasModalDialogsOpen() +{ + return s_openDialogs > 0; +} + +void wxDialog::OSXBeginModalDialog() +{ + s_openDialogs++; +} + +void wxDialog::OSXEndModalDialog() +{ + wxASSERT_MSG( s_openDialogs > 0, "incorrect internal modal dialog count"); + s_openDialogs--; +} -wxList wxModalDialogs; IMPLEMENT_DYNAMIC_CLASS(wxDialog, wxTopLevelWindow) @@ -130,7 +143,9 @@ int wxDialog::ShowModal() wxModalEventLoop modalLoop(this); m_eventLoop = &modalLoop; + wxDialog::OSXBeginModalDialog(); modalLoop.Run(); + wxDialog::OSXEndModalDialog(); m_eventLoop = NULL;