X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6c70323fcbc6e1e58934647edcc14c95bcb4242c..cf4ce62c26bcbd5a707e3054f611d0164617b012:/src/generic/datectlg.cpp diff --git a/src/generic/datectlg.cpp b/src/generic/datectlg.cpp index 825b162617..f951b948ea 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); @@ -255,8 +260,8 @@ private: if (year_cnt == 1 && month_cnt == 1 && day_cnt == 1) return fmt; - else - return x_format; + + return x_format; } bool SetFormat(const wxString& fmt) @@ -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(); }