X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c173e541b8ffb01ad0992a4f4c991be9e95db2ba..ca21a4e72927167815450b77155ec31fae590115:/samples/dialogs/dialogs.cpp diff --git a/samples/dialogs/dialogs.cpp b/samples/dialogs/dialogs.cpp index f9dbb0a3cc..b334211622 100644 --- a/samples/dialogs/dialogs.cpp +++ b/samples/dialogs/dialogs.cpp @@ -1998,14 +1998,15 @@ MyModalDialog::MyModalDialog(wxWindow *parent) 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(); } @@ -2457,12 +2458,14 @@ TestMessageBoxDialog::TestMessageBoxDialog(wxWindow *parent) // 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()); @@ -2523,10 +2526,11 @@ void TestMessageBoxDialog::OnApply(wxCommandEvent& WXUNUSED(event)) 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() )