From b7e542bee896f74d7a7aef769335b2e90384e8ca Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 13 Feb 2005 13:08:13 +0000 Subject: [PATCH] fixes for wxDP_ALLOWNONE case git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31989 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/calendar/calendar.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/samples/calendar/calendar.cpp b/samples/calendar/calendar.cpp index 59fff7cfeb..fb34cfe280 100644 --- a/samples/calendar/calendar.cpp +++ b/samples/calendar/calendar.cpp @@ -599,9 +599,10 @@ MyDialog::MyDialog(wxWindow *parent, const wxDateTime& dt, int dtpStyle) 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 @@ -638,7 +639,8 @@ MyDialog::MyDialog(wxWindow *parent, const wxDateTime& dt, int dtpStyle) 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 -- 2.50.0