]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/msgdlg.cpp
Rework idle handling so that NSApplication does not need to be subclassed or posed as.
[wxWidgets.git] / src / gtk / msgdlg.cpp
index fa66968937476f0e61976fd80b2d79437d44273e..ddbecfa54a02620f999e38cd308c1e4e79f045ad 100644 (file)
@@ -38,14 +38,18 @@ wxMessageDialog::wxMessageDialog(wxWindow *parent,
     m_caption = caption;
     m_message = message;
     SetMessageDialogStyle(style);
-    m_parent = wxGetTopLevelParent(parent);
+
+    m_parent = GetParentForModalDialog(parent);
 
     GtkMessageType type = GTK_MESSAGE_ERROR;
     GtkButtonsType buttons = GTK_BUTTONS_OK;
 
     if (style & wxYES_NO)
     {
-        buttons = GTK_BUTTONS_YES_NO;
+        if (style & wxCANCEL)
+            buttons = GTK_BUTTONS_NONE;
+        else
+            buttons = GTK_BUTTONS_YES_NO;
     }
 
     if (style & wxOK)
@@ -81,8 +85,14 @@ wxMessageDialog::wxMessageDialog(wxWindow *parent,
     if (style & wxYES_NO)
     {
         if (style & wxCANCEL)
+        {
+            gtk_dialog_add_button(GTK_DIALOG(m_widget), GTK_STOCK_NO,
+                                  GTK_RESPONSE_NO);
             gtk_dialog_add_button(GTK_DIALOG(m_widget), GTK_STOCK_CANCEL,
                                   GTK_RESPONSE_CANCEL);
+            gtk_dialog_add_button(GTK_DIALOG(m_widget), GTK_STOCK_YES,
+                                  GTK_RESPONSE_YES);
+        }
         if (style & wxNO_DEFAULT)
             gtk_dialog_set_default_response(GTK_DIALOG(m_widget), GTK_RESPONSE_NO);
         else