+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--;
+}