Add a "not specified" icon style to the message box test dialog.
The sample allowed to test the behaviour with all wxICON_XXX including wxICON_NONE but not without any icon styles at all. Do allow it now. Also use symbolic names for the radiobox indices for clarity. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63681 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -2589,15 +2589,24 @@ TestMessageBoxDialog::TestMessageBoxDialog(wxWindow *parent)
|
|||||||
|
|
||||||
|
|
||||||
// icon choice
|
// icon choice
|
||||||
const wxString icons[] = {
|
const wxString icons[] =
|
||||||
"&None", "&Information", "&Question", "&Warning", "&Error"
|
{
|
||||||
|
"&Not specified",
|
||||||
|
"E&xplicitly none",
|
||||||
|
"&Information icon",
|
||||||
|
"&Question icon",
|
||||||
|
"&Warning icon",
|
||||||
|
"&Error icon"
|
||||||
};
|
};
|
||||||
|
|
||||||
m_icons = new wxRadioBox(this, wxID_ANY, "&Icons",
|
wxCOMPILE_TIME_ASSERT( WXSIZEOF(icons) == MsgDlgIcon_Max, IconMismatch );
|
||||||
|
|
||||||
|
m_icons = new wxRadioBox(this, wxID_ANY, "&Icon style",
|
||||||
wxDefaultPosition, wxDefaultSize,
|
wxDefaultPosition, wxDefaultSize,
|
||||||
WXSIZEOF(icons), icons);
|
WXSIZEOF(icons), icons,
|
||||||
|
2, wxRA_SPECIFY_ROWS);
|
||||||
// Make the 'Information' icon the default one:
|
// Make the 'Information' icon the default one:
|
||||||
m_icons->SetSelection(1);
|
m_icons->SetSelection(MsgDlgIcon_Info);
|
||||||
sizerTop->Add(m_icons, wxSizerFlags().Expand().Border());
|
sizerTop->Add(m_icons, wxSizerFlags().Expand().Border());
|
||||||
|
|
||||||
|
|
||||||
@@ -2658,11 +2667,31 @@ void TestMessageBoxDialog::OnApply(wxCommandEvent& WXUNUSED(event))
|
|||||||
|
|
||||||
switch ( m_icons->GetSelection() )
|
switch ( m_icons->GetSelection() )
|
||||||
{
|
{
|
||||||
case 0: style |= wxICON_NONE; break;
|
case MsgDlgIcon_Max:
|
||||||
case 1: style |= wxICON_INFORMATION; break;
|
wxFAIL_MSG( "unexpected selection" );
|
||||||
case 2: style |= wxICON_QUESTION; break;
|
|
||||||
case 3: style |= wxICON_WARNING; break;
|
case MsgDlgIcon_No:
|
||||||
case 4: style |= wxICON_ERROR; break;
|
break;
|
||||||
|
|
||||||
|
case MsgDlgIcon_None:
|
||||||
|
style |= wxICON_NONE;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case MsgDlgIcon_Info:
|
||||||
|
style |= wxICON_INFORMATION;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case MsgDlgIcon_Question:
|
||||||
|
style |= wxICON_QUESTION;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case MsgDlgIcon_Warning:
|
||||||
|
style |= wxICON_WARNING;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case MsgDlgIcon_Error:
|
||||||
|
style |= wxICON_ERROR;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( m_chkCentre->IsChecked() )
|
if ( m_chkCentre->IsChecked() )
|
||||||
|
@@ -214,6 +214,17 @@ private:
|
|||||||
|
|
||||||
static const BtnInfo ms_btnInfo[Btn_Max];
|
static const BtnInfo ms_btnInfo[Btn_Max];
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
MsgDlgIcon_No,
|
||||||
|
MsgDlgIcon_None,
|
||||||
|
MsgDlgIcon_Info,
|
||||||
|
MsgDlgIcon_Question,
|
||||||
|
MsgDlgIcon_Warning,
|
||||||
|
MsgDlgIcon_Error,
|
||||||
|
MsgDlgIcon_Max
|
||||||
|
};
|
||||||
|
|
||||||
wxTextCtrl *m_textMsg,
|
wxTextCtrl *m_textMsg,
|
||||||
*m_textExtMsg;
|
*m_textExtMsg;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user