]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/dialog.cpp
Misc validity fixes to samples/xrc/rc/*.xrc.
[wxWidgets.git] / src / gtk / dialog.cpp
index c7ae206ec3affadafe8bb4e144fc92e80276bf3a..98f08d7d6facc8eb50855ddb951462061a41c4ca 100644 (file)
@@ -2,7 +2,6 @@
 // Name:        src/gtk/dialog.cpp
 // Purpose:
 // Author:      Robert Roebling
-// Id:          $Id$
 // Copyright:   (c) 1998 Robert Roebling
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 #include "wx/evtloop.h"
 
 #include "wx/scopedptr.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
 
 #include <gtk/gtk.h>
 #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,
@@ -135,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" );
 
@@ -172,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);
@@ -190,8 +185,6 @@ int wxDialog::ShowModal()
 
     gtk_window_set_modal(GTK_WINDOW(m_widget), FALSE);
 
-    wxOpenModalDialogsCount--;
-
     return GetReturnCode();
 }