+ return GTK_STOCK_CANCEL;
+}
+
+wxString wxMessageDialog::GetDefaultHelpLabel() const
+{
+ return GTK_STOCK_HELP;
+}
+
+void wxMessageDialog::DoSetCustomLabel(wxString& var, const ButtonLabel& label)
+{
+ int stockId = label.GetStockId();
+ if ( stockId == wxID_NONE )
+ {
+ wxMessageDialogBase::DoSetCustomLabel(var, label);
+ var = wxConvertMnemonicsToGTK(var);
+ }
+ else // stock label
+ {
+ var = wxGetStockGtkID(stockId);
+ }
+}
+
+void wxMessageDialog::GTKCreateMsgDialog()
+{
+ GtkWindow * const parent = m_parent ? GTK_WINDOW(m_parent->m_widget) : NULL;
+
+#if wxUSE_LIBHILDON || wxUSE_LIBHILDON2
+ const char *stockIcon = "";
+
+ switch ( GetEffectiveIcon() )
+ {
+ case wxICON_ERROR:
+ stockIcon = "qgn_note_gene_syserror";
+ break;
+
+ case wxICON_WARNING:
+ stockIcon = "qgn_note_gene_syswarning";
+ break;
+
+ case wxICON_QUESTION:
+ stockIcon = "qgn_note_confirm";
+ break;
+
+ case wxICON_INFORMATION:
+ stockIcon = "qgn_note_info";
+ break;
+ }
+
+ // there is no generic note creation function in public API so we have no
+ // choice but to use g_object_new() directly
+ m_widget = (GtkWidget *)g_object_new
+ (
+ HILDON_TYPE_NOTE,
+#if wxUSE_LIBHILDON
+ "note_type", HILDON_NOTE_CONFIRMATION_BUTTON_TYPE,
+#else // wxUSE_LIBHILDON
+ "note_type", HILDON_NOTE_TYPE_CONFIRMATION_BUTTON,
+#endif // wxUSE_LIBHILDON /wxUSE_LIBHILDON2
+ "description", (const char *)GetFullMessage().utf8_str(),
+ "icon", stockIcon,
+ NULL
+ );
+#else // !wxUSE_LIBHILDON && !wxUSE_LIBHILDON2
+ GtkMessageType type = GTK_MESSAGE_ERROR;
+ GtkButtonsType buttons = GTK_BUTTONS_NONE;
+
+ // when using custom labels, we have to add all the buttons ourselves
+ if ( !HasCustomLabels() )
+ {
+ // "Help" button is not supported by predefined combinations so we
+ // always need to create the buttons manually when it's used.
+ if ( !(m_dialogStyle & wxHELP) )
+ {
+ if ( m_dialogStyle & wxYES_NO )
+ {
+ if ( !(m_dialogStyle & wxCANCEL) )
+ buttons = GTK_BUTTONS_YES_NO;
+ //else: no standard GTK_BUTTONS_YES_NO_CANCEL so leave as NONE
+ }
+ else if ( m_dialogStyle & wxOK )
+ {
+ buttons = m_dialogStyle & wxCANCEL ? GTK_BUTTONS_OK_CANCEL
+ : GTK_BUTTONS_OK;
+ }
+ }
+ }
+
+ if ( !wxGTKImpl::ConvertMessageTypeFromWX(GetEffectiveIcon(), &type) )
+ {
+ // if no style is explicitly specified, detect the suitable icon
+ // ourselves (this can be disabled by using wxICON_NONE)
+ type = m_dialogStyle & wxYES ? GTK_MESSAGE_QUESTION : GTK_MESSAGE_INFO;
+ }
+
+ wxString message;
+#if GTK_CHECK_VERSION(2, 6, 0)
+ bool needsExtMessage = false;
+ if ( gtk_check_version(2, 6, 0) == NULL && !m_extendedMessage.empty() )
+ {
+ message = m_message;
+ needsExtMessage = true;
+ }
+ else // extended message not needed or not supported
+#endif // GTK+ 2.6+