From 2ccc6650ca6287152ad0ef48cca674a4dee6ff9b Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 28 Jun 2008 18:58:07 +0000 Subject: [PATCH] support wxDP_ALLOWNONE in generic wxDatePickerCtrl (#3164) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54407 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/datectlg.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/generic/datectlg.cpp b/src/generic/datectlg.cpp index 825b162617..fc0e0ab720 100644 --- a/src/generic/datectlg.cpp +++ b/src/generic/datectlg.cpp @@ -116,6 +116,11 @@ public: } } + bool IsTextEmpty() const + { + return m_combo->GetTextCtrl()->IsEmpty(); + } + bool ParseDateTime(const wxString& s, wxDateTime* pDt) { wxASSERT(pDt); @@ -435,6 +440,8 @@ wxDatePickerCtrlGeneric::SetDateRange(const wxDateTime& lowerdate, wxDateTime wxDatePickerCtrlGeneric::GetValue() const { + if ( HasFlag(wxDP_ALLOWNONE) && m_popup->IsTextEmpty() ) + return wxInvalidDateTime; return m_popup->GetDate(); } -- 2.45.2