]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/msgdlg.cpp
partially fix bug [ wxwindows-Bugs-1145813 ] Centre() Doesn't Work With Dual Monitors...
[wxWidgets.git] / src / gtk / msgdlg.cpp
index 97ce07c6166d9c1b14d82e8b47eb943dd312c5c4..6ca49154810bada7180376d09d45ba4b0f230abe 100644 (file)
 
 #if wxUSE_MSGDLG && defined(__WXGTK20__) && !defined(__WXGPE__)
 
 
 #if wxUSE_MSGDLG && defined(__WXGTK20__) && !defined(__WXGPE__)
 
+#include "wx/msgdlg.h"
 #include "wx/gtk/private.h"
 #include <gtk/gtk.h>
 
 #include "wx/gtk/private.h"
 #include <gtk/gtk.h>
 
-#include "wx/msgdlg.h"
 #include "wx/intl.h"
 
 IMPLEMENT_CLASS(wxMessageDialog, wxDialog)
 #include "wx/intl.h"
 
 IMPLEMENT_CLASS(wxMessageDialog, wxDialog)
@@ -89,8 +89,16 @@ wxMessageDialog::wxMessageDialog(wxWindow *parent,
         else
             gtk_dialog_set_default_response(GTK_DIALOG(m_widget), GTK_RESPONSE_YES);
     }
         else
             gtk_dialog_set_default_response(GTK_DIALOG(m_widget), GTK_RESPONSE_YES);
     }
+
+    if (parent)
+        gtk_window_set_transient_for(GTK_WINDOW(m_widget),
+                                     GTK_WINDOW(m_parent->m_widget));
 }
  
 }
  
+wxMessageDialog::~wxMessageDialog()
+{
+}
+
 int wxMessageDialog::ShowModal()
 {
     gint result = gtk_dialog_run(GTK_DIALOG(m_widget));
 int wxMessageDialog::ShowModal()
 {
     gint result = gtk_dialog_run(GTK_DIALOG(m_widget));
@@ -104,6 +112,8 @@ int wxMessageDialog::ShowModal()
             // fall through
 
         case GTK_RESPONSE_CANCEL:
             // fall through
 
         case GTK_RESPONSE_CANCEL:
+        case GTK_RESPONSE_DELETE_EVENT:
+        case GTK_RESPONSE_CLOSE:
             return wxID_CANCEL;
         case GTK_RESPONSE_OK:
             return wxID_OK;
             return wxID_CANCEL;
         case GTK_RESPONSE_OK:
             return wxID_OK;