]> git.saurik.com Git - wxWidgets.git/commitdiff
auto detect the icon if none given instead of asserting (MSW and Mac do allow this)
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 22 Mar 2004 17:42:49 +0000 (17:42 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 22 Mar 2004 17:42:49 +0000 (17:42 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26293 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/msgdlg.cpp
src/gtk1/msgdlg.cpp

index 9026e34f6714c184925571e81a00077e6a48e6ad..610b4ec11ad84996a08fda0bbe30392557ea3cca 100644 (file)
@@ -70,7 +70,10 @@ int wxMessageDialog::ShowModal()
     else if (m_dialogStyle & wxICON_QUESTION)
         type = GTK_MESSAGE_QUESTION;
     else
-        wxFAIL_MSG( _T("Unknown wxMessageDialog type") );
+    {
+        // GTK+ doesn't have a "typeless" msg box, so try to auto detect...
+        type = m_dialogStyle & wxYES ? GTK_MESSAGE_QUESTION : GTK_MESSAGE_INFO;
+    }
 
     dlg = gtk_message_dialog_new(m_parent ?
                                     GTK_WINDOW(m_parent->m_widget) : NULL,
index 9026e34f6714c184925571e81a00077e6a48e6ad..610b4ec11ad84996a08fda0bbe30392557ea3cca 100644 (file)
@@ -70,7 +70,10 @@ int wxMessageDialog::ShowModal()
     else if (m_dialogStyle & wxICON_QUESTION)
         type = GTK_MESSAGE_QUESTION;
     else
-        wxFAIL_MSG( _T("Unknown wxMessageDialog type") );
+    {
+        // GTK+ doesn't have a "typeless" msg box, so try to auto detect...
+        type = m_dialogStyle & wxYES ? GTK_MESSAGE_QUESTION : GTK_MESSAGE_INFO;
+    }
 
     dlg = gtk_message_dialog_new(m_parent ?
                                     GTK_WINDOW(m_parent->m_widget) : NULL,