]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/widgets/datepick.cpp
Always rearrange wxListBook and send out size event, otherwise scrollbar overlaps...
[wxWidgets.git] / samples / widgets / datepick.cpp
index 12ee2f8fcdb7dd41e800e917304f17cd87390033..e553c3581f967fae39b313d79516e1eb2403dc5c 100644 (file)
@@ -223,15 +223,15 @@ void DatePickerWidgetsPage::OnButtonReset(wxCommandEvent& WXUNUSED(event))
 
 void DatePickerWidgetsPage::OnButtonSet(wxCommandEvent& WXUNUSED(event))
 {
-    long day = 0, month = 0, year = 0;
+    long day = 0,
+         month = 0,
+         year = 0;
     if ( m_day->GetValue().ToLong(&day) &&
          m_month->GetValue().ToLong(&month) &&
          m_year->GetValue().ToLong(&year) )
     {
-        const wxDateTime someDay(wxDateTime::wxDateTime_t(day),
-                                 wxDateTime::Month(month),
-                                 year);
-        if(someDay.IsValid())
+        const wxDateTime someDay(day, wxDateTime::Month(month - 1), year);
+        if ( someDay.IsValid() )
         {
             m_datePicker->SetValue(someDay);
         }