]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/widgets/datepick.cpp
Use template class instead of template function in wxVectorSort().
[wxWidgets.git] / samples / widgets / datepick.cpp
index 12ee2f8fcdb7dd41e800e917304f17cd87390033..80261da8f5c2082bda7283cdcbd2a37b24a2bbf1 100644 (file)
@@ -185,9 +185,9 @@ void DatePickerWidgetsPage::Reset()
     const wxDateTime today = wxDateTime::Today();
 
     m_datePicker->SetValue(today);
-    m_day->SetValue(wxString::Format(_T("%d"), today.GetDay()));
-    m_month->SetValue(wxString::Format(_T("%d"), today.GetMonth()));
-    m_year->SetValue(wxString::Format(_T("%d"), today.GetYear()));
+    m_day->SetValue(wxString::Format(wxT("%d"), today.GetDay()));
+    m_month->SetValue(wxString::Format(wxT("%d"), today.GetMonth()));
+    m_year->SetValue(wxString::Format(wxT("%d"), today.GetYear()));
 }
 
 void DatePickerWidgetsPage::CreateDatePicker()
@@ -223,26 +223,26 @@ 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);
         }
         else
         {
-            wxLogError(_T("Date is invalid"));
+            wxLogError(wxT("Date is invalid"));
         }
     }
     else
     {
-        wxLogError(_T("One of inputs is not number"));
+        wxLogError(wxT("One of inputs is not number"));
     }
 }