wxSizer *sizerText = new wxBoxSizer(wxHORIZONTAL);
sizerText->Add(new wxStaticText(this, -1, _T("Date in ISO format: ")),
- wxSizerFlags().Border());
+ wxSizerFlags().Border().Align(wxALIGN_CENTRE_VERTICAL));
m_text = new wxTextCtrl(this, -1);
- sizerText->Add(m_text, wxSizerFlags().Expand().Border());
+ sizerText->Add(m_text, wxSizerFlags().
+ Expand().Border().Align(wxALIGN_CENTRE_VERTICAL));
wxSizer *sizerTop = new wxBoxSizer(wxVERTICAL);
sizerTop->Add(new wxStaticText
void MyDialog::OnDateChange(wxDateEvent& event)
{
- m_text->SetValue(event.GetDate().FormatISODate());
+ const wxDateTime dt = event.GetDate();
+ m_text->SetValue(dt.IsValid()? dt.FormatISODate() : wxString());
}
#endif // wxUSE_DATEPICKCTRL