m_btnModeless = new wxButton(this, wxID_ANY, _T("Mode&less dialog"));
m_btnDelete = new wxButton(this, wxID_ANY, _T("&Delete button"));
- wxButton *btnOk = new wxButton(this, wxID_CANCEL, _T("&Close"));
sizerTop->Add(m_btnModal, 0, wxALIGN_CENTER | wxALL, 5);
sizerTop->Add(m_btnModeless, 0, wxALIGN_CENTER | wxALL, 5);
sizerTop->Add(m_btnDelete, 0, wxALIGN_CENTER | wxALL, 5);
- sizerTop->Add(btnOk, 0, wxALIGN_CENTER | wxALL, 5);
+ sizerTop->Add(new wxButton(this, wxID_CLOSE), 0, wxALIGN_CENTER | wxALL, 5);
SetSizerAndFit(sizerTop);
+ SetEscapeId(wxID_CLOSE);
+
m_btnModal->SetFocus();
m_btnModal->SetDefault();
}
// 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() )