]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/datectlg.cpp
update from Dennis Prochko
[wxWidgets.git] / src / generic / datectlg.cpp
index b08865412933e0ac7297fe7fc5ee0a8e00351840..2c2a33d58aafe0ce796240277a0936b66b8262c8 100644 (file)
@@ -29,7 +29,8 @@
 
 // use this version if we're explicitly requested to do it or if it's the only
 // one we have
-#if wxUSE_DATEPICKCTRL_GENERIC || !defined(wxHAS_NATIVE_DATEPICKCTRL)
+#if !defined(wxHAS_NATIVE_DATEPICKCTRL) || \
+        (defined(wxUSE_DATEPICKCTRL_GENERIC) && wxUSE_DATEPICKCTRL_GENERIC)
 
 #ifndef WX_PRECOMP
     #include "wx/bmpbuttn.h"
@@ -867,7 +868,7 @@ void wxDatePickerCtrlGeneric::OnKillFocus(wxFocusEvent &ev)
         m_txt->SetValue(wxEmptyString);
 
     // notify that we had to change the date after validation
-    if ( (dt.IsValid() && m_currentDate != dt) ||
+    if ( (dt.IsValid() && (!m_currentDate.IsValid() || m_currentDate != dt)) ||
             (!dt.IsValid() && m_currentDate.IsValid()) )
     {
         m_currentDate = dt;