-wxGenericMessageDialog::wxGenericMessageDialog( wxWindow *parent, const wxString& message,
- const wxString& caption, long style, const wxPoint& pos) :
- wxDialog( parent, -1, caption, pos, wxDefaultSize, wxDEFAULT_DIALOG_STYLE )
-{
- m_dialogStyle = style;
-
- int text_pos_x = 15;
-
- if (m_dialogStyle & wxICON_MASK)
- text_pos_x += 80;
-
- wxSize message_size( wxSplitMessage2( message, this, text_pos_x ) );
-
- if (m_dialogStyle & wxICON_MASK)
- if (message_size.y < 50) message_size.y = 50;
-
- if (m_dialogStyle & wxICON_INFORMATION)
- (void) new wxStaticBitmap( this, -1, wxBitmap( info_xpm ), wxPoint(15,message_size.y/2-16) );
- else
- if (m_dialogStyle & wxICON_HAND)
- (void) new wxStaticBitmap( this, -1, wxBitmap( error_xpm ), wxPoint(15,message_size.y/2-16) );
- else
- if (m_dialogStyle & wxICON_QUESTION)
- (void) new wxStaticBitmap( this, -1, wxBitmap( question_xpm ), wxPoint(15,message_size.y/2-16) );
- else
- if (m_dialogStyle & wxICON_EXCLAMATION)
- (void) new wxStaticBitmap( this, -1, wxBitmap( warning_xpm ), wxPoint(15,message_size.y/2-16) );
-
- wxButton *ok = (wxButton *) NULL;
- wxButton *cancel = (wxButton *) NULL;
- wxButton *yes = (wxButton *) NULL;
- wxButton *no = (wxButton *) NULL;
-
- int y = message_size.y + 30;
-
- if (style & wxYES_NO)
+ 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() )
+ {
+ 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) )