]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/datectrl.cpp
compare charset strings case-insensitively (and so avoid conversions between utf...
[wxWidgets.git] / src / msw / datectrl.cpp
index c9129f87565be99bb5679012dc028edd206d74ec..8191af9fc37c098471381718464e12805efe57a6 100644 (file)
@@ -156,6 +156,8 @@ wxDatePickerCtrl::Create(wxWindow *parent,
 
     if ( dt.IsValid() || (style & wxDP_ALLOWNONE) )
         SetValue(dt);
+    else
+        SetValue(wxDateTime::Today());
 
     return true;
 }
@@ -341,7 +343,8 @@ wxDatePickerCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
 
             // filter out duplicate DTN_DATETIMECHANGE events which the native
             // control sends us when using wxDP_DROPDOWN style
-            if ( !m_date.IsValid() || dt != m_date )
+            if ( (m_date.IsValid() != dt.IsValid()) ||
+                    (m_date.IsValid() && dt != m_date) )
             {
                 m_date = dt;
                 wxDateEvent event(this, dt, wxEVT_DATE_CHANGED);
@@ -351,6 +354,7 @@ wxDatePickerCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
                     return true;
                 }
             }
+            //else: both the old and new values are invalid, nothing changed
         }
     }