.TH wxCalendarCtrl 3erl "wx 2.2.1" "wxWidgets team." "Erlang Module Definition" .SH NAME wxCalendarCtrl \- Functions for wxCalendarCtrl class .SH DESCRIPTION .LP The calendar control allows the user to pick a date\&. The user can move the current selection using the keyboard and select the date (generating \fIEVT_CALENDAR\fR\& event) by pressing \fI\fR\& or double clicking it\&. .LP Generic calendar has advanced possibilities for the customization of its display, described below\&. If you want to use these possibilities on every platform, use wxGenericCalendarCtrl instead of \fIwxCalendarCtrl\fR\&\&. .LP All global settings (such as colours and fonts used) can, of course, be changed\&. But also, the display style for each day in the month can be set independently using \fIwxCalendarDateAttr\fR\& class\&. .LP An item without custom attributes is drawn with the default colours and font and without border, but setting custom attributes with \fIsetAttr/3\fR\& allows modifying its appearance\&. Just create a custom attribute object and set it for the day you want to be displayed specially (note that the control will take ownership of the pointer, i\&.e\&. it will delete it itself)\&. A day may be marked as being a holiday, even if it is not recognized as one by \fIwx_datetime()\fR\& using the \fIwxCalendarDateAttr:setHoliday/2\fR\& method\&. .LP As the attributes are specified for each day, they may change when the month is changed, so you will often want to update them in \fIEVT_CALENDAR_PAGE_CHANGED\fR\& event handler\&. .LP If neither the \fIwxCAL_SUNDAY_FIRST\fR\& or \fIwxCAL_MONDAY_FIRST\fR\& style is given, the first day of the week is determined from operating system\&'s settings, if possible\&. The native wxGTK calendar chooses the first weekday based on locale, and these styles have no effect on it\&. .LP Styles .LP This class supports the following styles: .LP Note: Changing the selected date will trigger an EVT_CALENDAR_DAY, MONTH or YEAR event as well as an EVT_CALENDAR_SEL_CHANGED event\&. .LP See: Examples, \fIwxCalendarDateAttr\fR\&, \fIwxCalendarEvent\fR\&, \fIwxDatePickerCtrl\fR\& .LP This class is derived (and can use functions) from: \fIwxControl\fR\& \fIwxWindow\fR\& \fIwxEvtHandler\fR\& .LP wxWidgets docs: wxCalendarCtrl .SH "EVENTS" .LP Event types emitted from this class: \fIcalendar_sel_changed\fR\&, \fIcalendar_weekday_clicked\fR\& .SH DATA TYPES .nf \fBwxCalendarCtrl()\fR\& = wx:wx_object() .br .fi .SH EXPORTS .LP .nf .B new() -> wxCalendarCtrl() .br .fi .br .RS .LP Default constructor\&. .RE .LP .nf .B new(Parent, Id) -> wxCalendarCtrl() .br .fi .br .RS .LP Types: .RS 3 Parent = wxWindow:wxWindow() .br Id = integer() .br .RE .RE .LP .nf .B new(Parent, Id, Options :: [Option]) -> wxCalendarCtrl() .br .fi .br .RS .LP Types: .RS 3 Parent = wxWindow:wxWindow() .br Id = integer() .br Option = .br {date, wx:wx_datetime()} | .br {pos, {X :: integer(), Y :: integer()}} | .br {size, {W :: integer(), H :: integer()}} | .br {style, integer()} .br .RE .RE .RS .LP Does the same as \fIcreate/4\fR\& method\&. .RE .LP .nf .B create(This, Parent, Id) -> boolean() .br .fi .br .RS .LP Types: .RS 3 This = wxCalendarCtrl() .br Parent = wxWindow:wxWindow() .br Id = integer() .br .RE .RE .LP .nf .B create(This, Parent, Id, Options :: [Option]) -> boolean() .br .fi .br .RS .LP Types: .RS 3 This = wxCalendarCtrl() .br Parent = wxWindow:wxWindow() .br Id = integer() .br Option = .br {date, wx:wx_datetime()} | .br {pos, {X :: integer(), Y :: integer()}} | .br {size, {W :: integer(), H :: integer()}} | .br {style, integer()} .br .RE .RE .RS .LP Creates the control\&. .LP See \fIwxWindow:new/3\fR\& for the meaning of the parameters and the control overview for the possible styles\&. .RE .LP .nf .B destroy(This :: wxCalendarCtrl()) -> ok .br .fi .br .RS .LP Destroys the control\&. .RE .LP .nf .B setDate(This, Date) -> boolean() .br .fi .br .RS .LP Types: .RS 3 This = wxCalendarCtrl() .br Date = wx:wx_datetime() .br .RE .RE .RS .LP Sets the current date\&. .LP The \fIdate\fR\& parameter must be valid and in the currently valid range as set by \fISetDateRange()\fR\& (not implemented in wx), otherwise the current date is not changed and the function returns false and, additionally, triggers an assertion failure if the date is invalid\&. .RE .LP .nf .B getDate(This) -> wx:wx_datetime() .br .fi .br .RS .LP Types: .RS 3 This = wxCalendarCtrl() .br .RE .RE .RS .LP Gets the currently selected date\&. .RE .LP .nf .B enableYearChange(This) -> ok .br .fi .br .RS .LP Types: .RS 3 This = wxCalendarCtrl() .br .RE .RE .LP .nf .B enableYearChange(This, Options :: [Option]) -> ok .br .fi .br .RS .LP Types: .RS 3 This = wxCalendarCtrl() .br Option = {enable, boolean()} .br .RE .RE .RS .LP Deprecated: .LP This function should be used instead of changing \fIwxCAL_NO_YEAR_CHANGE\fR\& style bit directly\&. It allows or disallows the user to change the year interactively\&. Only in generic \fIwxCalendarCtrl\fR\&\&. .RE .LP .nf .B enableMonthChange(This) -> boolean() .br .fi .br .RS .LP Types: .RS 3 This = wxCalendarCtrl() .br .RE .RE .LP .nf .B enableMonthChange(This, Options :: [Option]) -> boolean() .br .fi .br .RS .LP Types: .RS 3 This = wxCalendarCtrl() .br Option = {enable, boolean()} .br .RE .RE .RS .LP This function should be used instead of changing \fIwxCAL_NO_MONTH_CHANGE\fR\& style bit\&. .LP It allows or disallows the user to change the month interactively\&. Note that if the month cannot be changed, the year cannot be changed neither\&. .LP Return: true if the value of this option really changed or false if it was already set to the requested value\&. .RE .LP .nf .B enableHolidayDisplay(This) -> ok .br .fi .br .RS .LP Types: .RS 3 This = wxCalendarCtrl() .br .RE .RE .LP .nf .B enableHolidayDisplay(This, Options :: [Option]) -> ok .br .fi .br .RS .LP Types: .RS 3 This = wxCalendarCtrl() .br Option = {display, boolean()} .br .RE .RE .RS .LP This function should be used instead of changing \fIwxCAL_SHOW_HOLIDAYS\fR\& style bit directly\&. .LP It enables or disables the special highlighting of the holidays\&. .RE .LP .nf .B setHeaderColours(This, ColFg, ColBg) -> ok .br .fi .br .RS .LP Types: .RS 3 This = wxCalendarCtrl() .br ColFg = ColBg = wx:wx_colour() .br .RE .RE .RS .LP Set the colours used for painting the weekdays at the top of the control\&. .LP This method is currently only implemented in generic \fIwxCalendarCtrl\fR\& and does nothing in the native versions\&. .RE .LP .nf .B getHeaderColourFg(This) -> wx:wx_colour4() .br .fi .br .RS .LP Types: .RS 3 This = wxCalendarCtrl() .br .RE .RE .RS .LP Gets the foreground colour of the header part of the calendar window\&. .LP This method is currently only implemented in generic \fIwxCalendarCtrl\fR\& and always returns \fIwxNullColour\fR\& in the native versions\&. .LP See: \fIsetHeaderColours/3\fR\& .RE .LP .nf .B getHeaderColourBg(This) -> wx:wx_colour4() .br .fi .br .RS .LP Types: .RS 3 This = wxCalendarCtrl() .br .RE .RE .RS .LP Gets the background colour of the header part of the calendar window\&. .LP This method is currently only implemented in generic \fIwxCalendarCtrl\fR\& and always returns \fIwxNullColour\fR\& in the native versions\&. .LP See: \fIsetHeaderColours/3\fR\& .RE .LP .nf .B setHighlightColours(This, ColFg, ColBg) -> ok .br .fi .br .RS .LP Types: .RS 3 This = wxCalendarCtrl() .br ColFg = ColBg = wx:wx_colour() .br .RE .RE .RS .LP Set the colours to be used for highlighting the currently selected date\&. .LP This method is currently only implemented in generic \fIwxCalendarCtrl\fR\& and does nothing in the native versions\&. .RE .LP .nf .B getHighlightColourFg(This) -> wx:wx_colour4() .br .fi .br .RS .LP Types: .RS 3 This = wxCalendarCtrl() .br .RE .RE .RS .LP Gets the foreground highlight colour\&. .LP Only in generic \fIwxCalendarCtrl\fR\&\&. .LP This method is currently only implemented in generic \fIwxCalendarCtrl\fR\& and always returns \fIwxNullColour\fR\& in the native versions\&. .LP See: \fIsetHighlightColours/3\fR\& .RE .LP .nf .B getHighlightColourBg(This) -> wx:wx_colour4() .br .fi .br .RS .LP Types: .RS 3 This = wxCalendarCtrl() .br .RE .RE .RS .LP Gets the background highlight colour\&. .LP Only in generic \fIwxCalendarCtrl\fR\&\&. .LP This method is currently only implemented in generic \fIwxCalendarCtrl\fR\& and always returns \fIwxNullColour\fR\& in the native versions\&. .LP See: \fIsetHighlightColours/3\fR\& .RE .LP .nf .B setHolidayColours(This, ColFg, ColBg) -> ok .br .fi .br .RS .LP Types: .RS 3 This = wxCalendarCtrl() .br ColFg = ColBg = wx:wx_colour() .br .RE .RE .RS .LP Sets the colours to be used for the holidays highlighting\&. .LP This method is only implemented in the generic version of the control and does nothing in the native ones\&. It should also only be called if the window style includes \fIwxCAL_SHOW_HOLIDAYS\fR\& flag or \fIenableHolidayDisplay/2\fR\& had been called\&. .RE .LP .nf .B getHolidayColourFg(This) -> wx:wx_colour4() .br .fi .br .RS .LP Types: .RS 3 This = wxCalendarCtrl() .br .RE .RE .RS .LP Return the foreground colour currently used for holiday highlighting\&. .LP Only useful with generic \fIwxCalendarCtrl\fR\& as native versions currently don\&'t support holidays display at all and always return \fIwxNullColour\fR\&\&. .LP See: \fIsetHolidayColours/3\fR\& .RE .LP .nf .B getHolidayColourBg(This) -> wx:wx_colour4() .br .fi .br .RS .LP Types: .RS 3 This = wxCalendarCtrl() .br .RE .RE .RS .LP Return the background colour currently used for holiday highlighting\&. .LP Only useful with generic \fIwxCalendarCtrl\fR\& as native versions currently don\&'t support holidays display at all and always return \fIwxNullColour\fR\&\&. .LP See: \fIsetHolidayColours/3\fR\& .RE .LP .nf .B getAttr(This, Day) -> wxCalendarDateAttr:wxCalendarDateAttr() .br .fi .br .RS .LP Types: .RS 3 This = wxCalendarCtrl() .br Day = integer() .br .RE .RE .RS .LP Returns the attribute for the given date (should be in the range 1\&.\&.\&.31)\&. .LP The returned pointer may be NULL\&. Only in generic \fIwxCalendarCtrl\fR\&\&. .RE .LP .nf .B setAttr(This, Day, Attr) -> ok .br .fi .br .RS .LP Types: .RS 3 This = wxCalendarCtrl() .br Day = integer() .br Attr = wxCalendarDateAttr:wxCalendarDateAttr() .br .RE .RE .RS .LP Associates the attribute with the specified date (in the range 1\&.\&.\&.31)\&. .LP If the pointer is NULL, the items attribute is cleared\&. Only in generic \fIwxCalendarCtrl\fR\&\&. .RE .LP .nf .B setHoliday(This, Day) -> ok .br .fi .br .RS .LP Types: .RS 3 This = wxCalendarCtrl() .br Day = integer() .br .RE .RE .RS .LP Marks the specified day as being a holiday in the current month\&. .LP This method is only implemented in the generic version of the control and does nothing in the native ones\&. .RE .LP .nf .B resetAttr(This, Day) -> ok .br .fi .br .RS .LP Types: .RS 3 This = wxCalendarCtrl() .br Day = integer() .br .RE .RE .RS .LP Clears any attributes associated with the given day (in the range 1\&.\&.\&.31)\&. .LP Only in generic \fIwxCalendarCtrl\fR\&\&. .RE .LP .nf .B hitTest(This, Pos) -> Result .br .fi .br .RS .LP Types: .RS 3 Result = .br {Res :: wx:wx_enum(), .br Date :: wx:wx_datetime(), .br Wd :: wx:wx_enum()} .br This = wxCalendarCtrl() .br Pos = {X :: integer(), Y :: integer()} .br .RE .RE .RS .LP Returns one of wxCalendarHitTestResult constants and fills either \fIdate\fR\& or \fIwd\fR\& pointer with the corresponding value depending on the hit test code\&. .LP Not implemented in wxGTK currently\&. .RE