#define wxICON_INFORMATION 0x00000800
#define wxICON_STOP wxICON_HAND
#define wxICON_ASTERISK wxICON_INFORMATION
-#define wxICON_MASK (0x00000100|0x00000200|0x00000400|0x00000800)
+#define wxICON_MASK (wxICON_EXCLAMATION|wxICON_HAND|wxICON_QUESTION|wxICON_INFORMATION)
#define wxFORWARD 0x00001000
#define wxBACKWARD 0x00002000
#define wxHELP 0x00008000
#define wxMORE 0x00010000
#define wxSETUP 0x00020000
+#define wxICON_NONE 0x00040000
/*
* Background styles. See wxWindow::SetBackgroundStyle
@style{wxOK_DEFAULT}
Makes the "OK" button default, this is the default behaviour and
this flag exists solely for symmetry with @c wxCANCEL_DEFAULT.
+ @style{wxICON_NONE}
+ Displays no icon in the dialog if possible (an icon might still be
+ displayed if the current platform mandates its use). This style may be
+ used to prevent the dialog from using the default icon based on @c
+ wxYES_NO presence as explained in @c wxICON_QUESTION and @c
+ wxICON_INFORMATION documentation below.
@style{wxICON_EXCLAMATION}
- Displays an exclamation mark symbol.
+ Displays an exclamation, or warning, icon in the dialog.
@style{wxICON_ERROR}
- Displays an error symbol.
+ Displays an error icon in the dialog.
@style{wxICON_HAND}
Displays an error symbol, this is a MSW-inspired synonym for @c wxICON_ERROR.
@style{wxICON_QUESTION}
// icon choice
const wxString icons[] = {
- "&Information", "&Question", "&Warning", "&Error"
+ "&None", "&Information", "&Question", "&Warning", "&Error"
};
- m_icons = new wxRadioBox(this, wxID_ANY, "&Icon:",
+ m_icons = new wxRadioBox(this, wxID_ANY, "&Icons",
wxDefaultPosition, wxDefaultSize,
WXSIZEOF(icons), icons);
+ // Make the 'Information' icon the default one:
+ m_icons->SetSelection(1);
sizerTop->Add(m_icons, wxSizerFlags().Expand().Border());
switch ( m_icons->GetSelection() )
{
- case 0: style |= wxICON_INFORMATION; break;
- case 1: style |= wxICON_QUESTION; break;
- case 2: style |= wxICON_WARNING; break;
- case 3: style |= wxICON_ERROR; break;
+ case 0: style |= wxICON_NONE; break;
+ case 1: style |= wxICON_INFORMATION; break;
+ case 2: style |= wxICON_QUESTION; break;
+ case 3: style |= wxICON_WARNING; break;
+ case 4: style |= wxICON_ERROR; break;
}
if ( m_chkCentre->IsChecked() )
int wxMessageBox(const wxString& message, const wxString& caption, long style,
wxWindow *parent, int WXUNUSED(x), int WXUNUSED(y) )
{
- long decorated_style = style;
-
- if ( ( style & ( wxICON_EXCLAMATION | wxICON_HAND | wxICON_INFORMATION | wxICON_QUESTION ) ) == 0 )
+ // add the appropriate icon unless this was explicitly disabled by use of
+ // wxICON_NONE
+ if ( !(style & wxICON_NONE) && !(style & wxICON_MASK) )
{
- decorated_style |= ( style & wxYES ) ? wxICON_QUESTION : wxICON_INFORMATION ;
+ style |= style & wxYES ? wxICON_QUESTION : wxICON_INFORMATION;
}
- wxMessageDialog dialog(parent, message, caption, decorated_style);
+ wxMessageDialog dialog(parent, message, caption, style);
int ans = dialog.ShowModal();
switch ( ans )
#if wxUSE_LIBHILDON
const char *stockIcon;
- if ( m_dialogStyle & wxICON_ERROR )
+ if ( m_dialogStyle & wxICON_NONE )
+ stockIcon = "";
+ else if ( m_dialogStyle & wxICON_ERROR )
stockIcon = "qgn_note_gene_syserror";
else if ( m_dialogStyle & wxICON_EXCLAMATION )
stockIcon = "qgn_note_gene_syswarning";
}
}
+#ifdef __WXGTK210__
+ if ( gtk_check_version(2, 10, 0) == NULL && (m_dialogStyle & wxICON_NONE))
+ type = GTK_MESSAGE_OTHER;
+ else
+#endif // __WXGTK210__
if (m_dialogStyle & wxICON_EXCLAMATION)
type = GTK_MESSAGE_WARNING;
else if (m_dialogStyle & wxICON_ERROR)
type = GTK_MESSAGE_QUESTION;
else
{
- // GTK+ doesn't have a "typeless" msg box, so try to auto detect...
+ // 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;
}