wCalendarCtrl

The calendar control allows the user to pick a date.

Appearance:
Superclass:wControl
Styles:
StylesDescription
wCalSundayFirstShow Sunday as the first day in the week.
wCalMondayFirstShow Monday as the first day in the week.
wCalNoTodayDoes not display the "today" date at the bottom of the control.
wCalNoMonthChangeDisable the month (and, implicitly, the year) changing.
wCalShowWeekNumbersShow week numbers on the left side of the calendar.
wCalMultiSelectEnables the user to select a range of dates within the control.
Events:wCommandEvent
wCommandEventDescription
wEvent_CalendarSelChangedThe selected date changed.
wEvent_CalendarViewChangedThe control view changed.

Consts

wCalSundayFirst = 0
wCalMondayFirst = 1152921504606846976'i64
wCalNoToday = 0x00000010
wCalNoMonthChange = 2305843009213693952'i64
wCalShowWeekNumbers = 0x00000004
wCalMultiSelect = 0x00000002

Procs

proc getDate(self: wCalendarCtrl): wTime {...}{.raises: [], tags: [].}
Gets the currently selected date.
proc getDates(self: wCalendarCtrl): (wTime, wTime) {...}{.raises: [], tags: [].}
Gets the currently selected date range.
proc setDate(self: wCalendarCtrl; time: wTime) {...}{.raises: [], tags: [].}
Sets the current date.
proc setDates(self: wCalendarCtrl; time1: wTime; time2: wTime) {...}{.raises: [], tags: [].}
Sets the selected date range.
proc setDates(self: wCalendarCtrl; time: (wTime, wTime)) {...}{.raises: [], tags: [].}
Sets the selected date range.
proc getToday(self: wCalendarCtrl): wTime {...}{.raises: [], tags: [].}
Retrieves the date information for the date specified as "today"
proc setToday(self: wCalendarCtrl; time: wTime) {...}{.raises: [], tags: [].}
Sets the "today" value.
proc getDateRange(self: wCalendarCtrl): (wTime, wTime) {...}{.raises: [], tags: [].}
If the control had been previously limited to a range of dates, returns the lower and upper bounds of this range.
proc setDateRange(self: wCalendarCtrl; time1 = wDefaultTime; time2 = wDefaultTime) {...}{.
    raises: [], tags: [].}
Sets the valid range for the date selection.
proc setDateRange(self: wCalendarCtrl; time: (wTime, wTime)) {...}{.raises: [], tags: [].}
Sets the valid range for the date selection.
proc enableMonthChange(self: wCalendarCtrl; flag = true) {...}{.raises: [],
    tags: [TimeEffect].}
Enable or Disable the month changing.
proc setMaxSelectCount(self: wCalendarCtrl; max: int) {...}{.raises: [], tags: [].}
Sets the maximum number of days that can be selected.
proc getMaxSelectCount(self: wCalendarCtrl): int {...}{.raises: [], tags: [].}
Retrieves the maximum date range that can be selected
proc init(self: wCalendarCtrl; parent: wWindow; id = wDefaultID; date = wDefaultTime;
         pos = wDefaultPoint; size = wDefaultSize; style: wStyle = 0) {...}{.raises: [
    wNilAccess, wWindowError, wCursorError, wBrushError, Exception, IndexDefect,
    wFontError], tags: [RootEffect, TimeEffect].}
Initializes a calendar control.
ParametersDescription
parentParent window.
idThe identifier for the control.
dateThe initial value of the control, if an invalid date (such as the default value) is used, the control is set to today.
posInitial position.
sizeInitial size. If left at default value, the control chooses its own best size.
styleThe window style.
proc CalendarCtrl(parent: wWindow; id = wDefaultID; date = wDefaultTime;
                 pos = wDefaultPoint; size = wDefaultSize; style: wStyle = 0): wCalendarCtrl {...}{.
    inline, discardable, raises: [wNilAccess, wWindowError, wCursorError, wBrushError,
                               Exception, IndexDefect, wFontError],
    tags: [RootEffect, TimeEffect].}
Constructor.

Methods

method getBestSize(self: wCalendarCtrl): wSize {...}{.raises: [], tags: [].}
Returns the best acceptable minimal size for the control.
method getDefaultSize(self: wCalendarCtrl): wSize {...}{.inline, raises: [], tags: [].}
Returns the default size for the control.
method release(self: wCalendarCtrl) {...}{.raises: [], tags: [].}
Release all the resources during destroying. Used internally.