X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/232b2162776e08c0b16d5280b90f5c075f38c667..7c36630b570a7e8754d720313b6ea37724f561b0:/include/wx/generic/calctrlg.h

diff --git a/include/wx/generic/calctrlg.h b/include/wx/generic/calctrlg.h
index 9ff4e89b54..8ef42977a3 100644
--- a/include/wx/generic/calctrlg.h
+++ b/include/wx/generic/calctrlg.h
@@ -1,5 +1,5 @@
 ///////////////////////////////////////////////////////////////////////////////
-// Name:        generic/calctrlg.h
+// Name:        wx/generic/calctrlg.h
 // Purpose:     generic implementation of date-picker control
 // Author:      Vadim Zeitlin
 // Modified by:
@@ -125,14 +125,14 @@ public:
 
     virtual wxCalendarDateAttr *GetAttr(size_t day) const
     {
-        wxCHECK_MSG( day > 0 && day < 32, NULL, _T("invalid day") );
+        wxCHECK_MSG( day > 0 && day < 32, NULL, wxT("invalid day") );
 
         return m_attrs[day - 1];
     }
 
     virtual void SetAttr(size_t day, wxCalendarDateAttr *attr)
     {
-        wxCHECK_RET( day > 0 && day < 32, _T("invalid day") );
+        wxCHECK_RET( day > 0 && day < 32, wxT("invalid day") );
 
         delete m_attrs[day - 1];
         m_attrs[day - 1] = attr;
@@ -199,15 +199,29 @@ private:
     // get the date from which we start drawing days
     wxDateTime GetStartDate() const;
 
+    // get the first/last days of the week corresponding to the current style
+    wxDateTime::WeekDay GetWeekStart() const
+    {
+        return HasFlag(wxCAL_MONDAY_FIRST) ? wxDateTime::Mon
+                                           : wxDateTime::Sun;
+    }
+
+    wxDateTime::WeekDay GetWeekEnd() const
+    {
+        return HasFlag(wxCAL_MONDAY_FIRST) ? wxDateTime::Sun
+                                           : wxDateTime::Sat;
+    }
+
+
     // is this date shown?
     bool IsDateShown(const wxDateTime& date) const;
 
-    // is this date in the given range?
+    // is this date in the currently allowed range?
     bool IsDateInRange(const wxDateTime& date) const;
 
-    // range helpers
-    bool ChangeYear(wxDateTime* target) const;
-    bool ChangeMonth(wxDateTime* target) const;
+    // adjust the date to the currently allowed range, return true if it was
+    // changed
+    bool AdjustDateToRange(wxDateTime *date) const;
 
     // redraw the given date
     void RefreshDate(const wxDateTime& date);
@@ -297,7 +311,7 @@ private:
 
     DECLARE_DYNAMIC_CLASS(wxGenericCalendarCtrl)
     DECLARE_EVENT_TABLE()
-    DECLARE_NO_COPY_CLASS(wxGenericCalendarCtrl)
+    wxDECLARE_NO_COPY_CLASS(wxGenericCalendarCtrl);
 };
 
 #endif // _WX_GENERIC_CALCTRLG_H