X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6c70323fcbc6e1e58934647edcc14c95bcb4242c..aced1133b1da4f1da6d785bd3521b6835f3b2ff0:/src/generic/datectlg.cpp 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(); }