X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3c99e2fd1b3432974b892be508c0757da5b6ad49..92c0fc34c104c8d7c12d6a3b78ea232690fc23f4:/interface/wx/calctrl.h diff --git a/interface/wx/calctrl.h b/interface/wx/calctrl.h index 536c5a3f11..a59e64f5e0 100644 --- a/interface/wx/calctrl.h +++ b/interface/wx/calctrl.h @@ -2,10 +2,39 @@ // Name: calctrl.h // Purpose: interface of wxCalendarCtrl // Author: wxWidgets team -// RCS-ID: $Id$ -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// +enum +{ + // show Sunday as the first day of the week (default) + wxCAL_SUNDAY_FIRST = 0x0000, + + // show Monday as the first day of the week + wxCAL_MONDAY_FIRST = 0x0001, + + // highlight holidays + wxCAL_SHOW_HOLIDAYS = 0x0002, + + // disable the year change control, show only the month change one + // deprecated + wxCAL_NO_YEAR_CHANGE = 0x0004, + + // don't allow changing neither month nor year (implies + // wxCAL_NO_YEAR_CHANGE) + wxCAL_NO_MONTH_CHANGE = 0x000c, + + // use MS-style month-selection instead of combo-spin combination + wxCAL_SEQUENTIAL_MONTH_SELECTION = 0x0010, + + // show the neighbouring weeks in the previous and next month + wxCAL_SHOW_SURROUNDING_WEEKS = 0x0020, + + // show week numbers on the left side of the calendar. + wxCAL_SHOW_WEEK_NUMBERS = 0x0040 +}; + + /** @class wxCalendarEvent @@ -19,6 +48,9 @@ class wxCalendarEvent : public wxDateEvent { public: + wxCalendarEvent(); + wxCalendarEvent(wxWindow *win, const wxDateTime& dt, wxEventType type); + /** Returns the week day on which the user clicked in @c EVT_CALENDAR_WEEKDAY_CLICKED handler. It doesn't make sense to call @@ -33,6 +65,12 @@ public: void SetWeekDay(const wxDateTime::WeekDay day); }; +wxEventType wxEVT_CALENDAR_SEL_CHANGED; +wxEventType wxEVT_CALENDAR_PAGE_CHANGED; +wxEventType wxEVT_CALENDAR_DOUBLECLICKED; +wxEventType wxEVT_CALENDAR_WEEKDAY_CLICKED; +wxEventType wxEVT_CALENDAR_WEEK_CLICKED; + /** @@ -106,7 +144,7 @@ public: bool HasBackgroundColour() const; /** - Returns @true if a non-default (i.e. any) border is set. + Returns @true if a non-default (i.e.\ any) border is set. */ bool HasBorder() const; @@ -170,7 +208,7 @@ public: Set the attributes that will be used to Mark() days on the generic wxCalendarCtrl. */ - static void SetMark(wxCalendarDateAttr const& m); + static void SetMark(const wxCalendarDateAttr& m); }; @@ -255,7 +293,7 @@ enum wxCalendarHitTestResult @library{wxadv} @category{ctrl} - @appearance{calendarctrl.png} + @appearance{calendarctrl} @nativeimpl{wxgtk,wxmsw} @@ -306,8 +344,8 @@ public: /** This function should be used instead of changing @c wxCAL_NO_MONTH_CHANGE style bit. It allows or disallows the user to - change the month interactively. Note that if the month can not be - changed, the year can not be changed neither. + change the month interactively. Note that if the month cannot be + changed, the year cannot be changed neither. @return @true if the value of this option really changed or @false if it was already set to the requested value. @@ -424,7 +462,9 @@ public: /** Sets the current date. - The @a date parameter must be valid. + The @a date parameter must be valid and in the currently valid range as + set by SetDateRange(), otherwise the current date is not changed and + the function returns @false. */ virtual bool SetDate(const wxDateTime& date); @@ -476,14 +516,12 @@ public: /** @name Date Range Functions - - The functions in this section are currently implemented in the generic - and MSW versions and do nothing in the native GTK implementation. */ //@{ /** - Restrict the dates shown by the control to the specified range. + Restrict the dates that can be selected in the control to the specified + range. If either date is set, the corresponding limit will be enforced and @true returned. If none are set, the existing restrictions are removed @@ -493,10 +531,10 @@ public: @param lowerdate The low limit for the dates shown by the control or - @c wxDefaultDateTime. + ::wxDefaultDateTime. @param upperdate The high limit for the dates shown by the control or - @c wxDefaultDateTime. + ::wxDefaultDateTime. @return @true if either limit is valid, @false otherwise */ @@ -510,11 +548,11 @@ public: @param lowerdate If non-@NULL, the value of the low limit for the dates shown by the - control is returned (which may be @c wxDefaultDateTime if no limit + control is returned (which may be ::wxDefaultDateTime if no limit is set). @param upperdate If non-@NULL, the value of the upper limit for the dates shown by - the control is returned (which may be @c wxDefaultDateTime if no + the control is returned (which may be ::wxDefaultDateTime if no limit is set). @return @true if either limit is set, @false otherwise