X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6c70323fcbc6e1e58934647edcc14c95bcb4242c..1f2f732921b6456c87ab8d180c5bd14456a5b35f:/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(); }