+ // do we allow changing the month/year?
+ bool AllowMonthChange() const
+ {
+ return (GetWindowStyle() & wxCAL_NO_MONTH_CHANGE)
+ != wxCAL_NO_MONTH_CHANGE;
+ }
+ bool AllowYearChange() const
+ {
+ return !(GetWindowStyle() & wxCAL_NO_YEAR_CHANGE);
+ }
+
+ // show the correct controls
+ void ShowCurrentControls();
+
+public:
+ // get the currently shown control for month/year
+ wxControl *GetMonthControl() const;
+ wxControl *GetYearControl() const;
+
+private:
+ // OnPaint helper-methods
+
+ // Highlight the [fromdate : todate] range using pen and brush
+ void HighlightRange(wxPaintDC* dc, const wxDateTime& fromdate, const wxDateTime& todate, wxPen* pen, wxBrush* brush);
+
+ // Get the "coordinates" for the date relative to the month currently displayed.
+ // using (day, week): upper left coord is (1, 1), lower right coord is (7, 6)
+ // if the date isn't visible (-1, -1) is put in (day, week) and false is returned
+ bool GetDateCoord(const wxDateTime& date, int *day, int *week) const;
+
+ // Set the flag for SetDate(): otherwise it would overwrite the year
+ // typed in by the user
+ void SetUserChangedYear() { m_userChangedYear = true; }
+