X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4ea2d0d5731ee4ec3f4f7407d48eee719d10c50c..11a23db53128bf244a089123b7fd27deb577a889:/src/gtk/dialog.cpp diff --git a/src/gtk/dialog.cpp b/src/gtk/dialog.cpp index 33a4d6b53f..98f08d7d6f 100644 --- a/src/gtk/dialog.cpp +++ b/src/gtk/dialog.cpp @@ -2,7 +2,6 @@ // Name: src/gtk/dialog.cpp // Purpose: // Author: Robert Roebling -// Id: $Id$ // Copyright: (c) 1998 Robert Roebling // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -19,13 +18,11 @@ #include "wx/evtloop.h" #include "wx/scopedptr.h" -#include "wx/testing.h" +#include "wx/modalhook.h" #include #include "wx/gtk/private/gtk2-compat.h" - -// this is defined in src/gtk/toplevel.cpp -extern int wxOpenModalDialogsCount; +#include "wx/gtk/private/dialogcount.h" wxDEFINE_TIED_SCOPED_PTR_TYPE(wxGUIEventLoop) @@ -37,9 +34,7 @@ wxDEFINE_TIED_SCOPED_PTR_TYPE(wxGUIEventLoop) void wxDialog::Init() { m_modalLoop = NULL; - m_returnCode = 0; m_modalShowing = false; - m_themeEnabled = true; } wxDialog::wxDialog( wxWindow *parent, @@ -95,11 +90,6 @@ bool wxDialog::IsModal() const return m_modalShowing; } -void wxDialog::SetModal( bool WXUNUSED(flag) ) -{ - wxFAIL_MSG( wxT("wxDialog:SetModal obsolete now") ); -} - // Workaround for Ubuntu overlay scrollbar, which adds our GtkWindow to a // private window group in a GtkScrollbar realize handler. This breaks the grab // done by gtk_window_set_modal(), and allows menus and toolbars in the parent @@ -140,7 +130,7 @@ realize_hook(GSignalInvocationHint*, unsigned, const GValue* param_values, void* int wxDialog::ShowModal() { - WX_TESTING_SHOW_MODAL_HOOK(); + WX_HOOK_MODAL_DIALOG(); wxASSERT_MSG( !IsModal(), "ShowModal() can't be called twice" ); @@ -177,7 +167,7 @@ int wxDialog::ShowModal() m_modalShowing = true; - wxOpenModalDialogsCount++; + wxOpenModalDialogLocker modalLock; // NOTE: gtk_window_set_modal internally calls gtk_grab_add() ! gtk_window_set_modal(GTK_WINDOW(m_widget), TRUE); @@ -195,8 +185,6 @@ int wxDialog::ShowModal() gtk_window_set_modal(GTK_WINDOW(m_widget), FALSE); - wxOpenModalDialogsCount--; - return GetReturnCode(); }