summaryrefslogtreecommitdiff
path: root/lib/wx/doc/src/wxCalendarCtrl.xml
blob: 22d6b031217903bae69e3818977ff82e6cefe851 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">

<!-- THIS FILE IS GENERATED DO NOT EDIT -->


<erlref>
<header>
  <copyright>
    <year>2020</year>
    <holder>Ericsson AB. All Rights Reserved.</holder></copyright>
  <legalnotice>
      Licensed under the Apache License, Version 2.0 (the "License");
      you may not use this file except in compliance with the License.
      You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

      Unless required by applicable law or agreed to in writing, software
      distributed under the License is distributed on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
      See the License for the specific language governing permissions and
      limitations under the License.

  </legalnotice>
  <title>wxCalendarCtrl</title>
</header>
<module>wxCalendarCtrl</module>
<modulesummary>Functions for wxCalendarCtrl class</modulesummary>
<description><p>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 <c>EVT_CALENDAR</c> event) by pressing <c>&lt;Return&gt;</c> or double clicking it.
      </p><p>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 <seeerl marker="wxCalendarCtrl"><c>wxCalendarCtrl</c></seeerl>.
      </p><p>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 <seeerl marker="wxCalendarDateAttr"><c>wxCalendarDateAttr</c></seeerl> class.
      </p><p>An item without custom attributes is drawn with the default colours and font and without border, but setting custom attributes with <seemfa marker="#setAttr/3"><c>setAttr/3</c></seemfa> 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 <seetype marker="wx#wx_datetime"><c>wx_datetime()</c></seetype> using the <seemfa marker="wxCalendarDateAttr#setHoliday/2"><c>wxCalendarDateAttr:setHoliday/2</c></seemfa> method.
      </p><p>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 <c>EVT_CALENDAR_PAGE_CHANGED</c> event handler.
      </p><p>If neither the <c>wxCAL_SUNDAY_FIRST</c> or <c>wxCAL_MONDAY_FIRST</c> 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.
      </p><p>Styles</p><p>This class supports the following styles:
      </p><p>Note: Changing the selected date will trigger an EVT_CALENDAR_DAY, MONTH or YEAR event as well as an EVT_CALENDAR_SEL_CHANGED event.
      </p><p>See: <url href="https://docs.wxwidgets.org/3.1/page_samples.html#page_samples_calendar">Examples</url>, <seeerl marker="wxCalendarDateAttr"><c>wxCalendarDateAttr</c></seeerl>, <seeerl marker="wxCalendarEvent"><c>wxCalendarEvent</c></seeerl>, <seeerl marker="wxDatePickerCtrl"><c>wxDatePickerCtrl</c></seeerl>
      </p>
  <p>This class is derived (and can use functions) from: 
    <seeerl marker="wxControl"><c>wxControl</c></seeerl> <seeerl marker="wxWindow"><c>wxWindow</c></seeerl> <seeerl marker="wxEvtHandler"><c>wxEvtHandler</c></seeerl></p>
  
  <p>wxWidgets docs: <url href="https://docs.wxwidgets.org/3.1/classwx_calendar_ctrl.html">wxCalendarCtrl</url></p>
  </description><section><title>Events</title><p>Event types emitted from this class: <seeerl marker="wxCalendarEvent"><c>calendar_sel_changed</c></seeerl>, <seeerl marker="wxCalendarEvent"><c>calendar_weekday_clicked</c></seeerl></p></section>
<datatypes><datatype><name name="wxCalendarCtrl"/></datatype></datatypes>

<funcs>
  <func>
    <name name="new" arity="0" clause_i="1" since=""/>
    <fsummary>Default constructor. </fsummary>
    <desc><p>Default constructor. 
      </p></desc>
  </func>
  
  <func>
    <name name="new" arity="2" clause_i="1" since=""/>
    <fsummary>See: <c>new/3</c></fsummary>
  </func>
  
  <func>
    <name name="new" arity="3" clause_i="1" since=""/>
    <fsummary>Does the same as <c>create/4</c> method. </fsummary>
    <desc><p>Does the same as <seemfa marker="#create/4"><c>create/4</c></seemfa> method. 
      </p></desc>
  </func>
  
  <func>
    <name name="create" arity="3" clause_i="1" since=""/>
    <fsummary>See: <c>create/4</c></fsummary>
  </func>
  
  <func>
    <name name="create" arity="4" clause_i="1" since=""/>
    <fsummary>Creates the control. </fsummary>
    <desc><p>Creates the control. 
      </p><p>See <seemfa marker="wxWindow#new/3"><c>wxWindow:new/3</c></seemfa> for the meaning of the parameters and the control overview for the possible styles. 
      </p></desc>
  </func>
  
  <func>
    <name name="destroy" arity="1" clause_i="1" since=""/>
    <fsummary>Destroys the control. </fsummary>
    <desc><p>Destroys the control. 
      </p></desc>
  </func>
  
  <func>
    <name name="setDate" arity="2" clause_i="1" since=""/>
    <fsummary>Sets the current date. </fsummary>
    <desc><p>Sets the current date. 
      </p><p>The <c>date</c> parameter must be valid and in the currently valid range as set by <c>SetDateRange()</c> (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. 
      </p></desc>
  </func>
  
  <func>
    <name name="getDate" arity="1" clause_i="1" since=""/>
    <fsummary>Gets the currently selected date. </fsummary>
    <desc><p>Gets the currently selected date. 
      </p></desc>
  </func>
  
  <func>
    <name name="enableYearChange" arity="1" clause_i="1" since=""/>
    <fsummary>See: <c>enableYearChange/2</c></fsummary>
  </func>
  
  <func>
    <name name="enableYearChange" arity="2" clause_i="1" since=""/>
    <fsummary/>
    <desc><p>Deprecated: 
      
      </p><p>This function should be used instead of changing <c>wxCAL_NO_YEAR_CHANGE</c> style bit directly. It allows or disallows the user to change the year interactively. Only in generic <seeerl marker="wxCalendarCtrl"><c>wxCalendarCtrl</c></seeerl>. 
      </p></desc>
  </func>
  
  <func>
    <name name="enableMonthChange" arity="1" clause_i="1" since=""/>
    <fsummary>See: <c>enableMonthChange/2</c></fsummary>
  </func>
  
  <func>
    <name name="enableMonthChange" arity="2" clause_i="1" since=""/>
    <fsummary>This function should be used instead of changing <c>wxCAL_NO_MONTH_CHANGE</c> style bit. </fsummary>
    <desc><p>This function should be used instead of changing <c>wxCAL_NO_MONTH_CHANGE</c> style bit. 
      </p><p>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.
      </p><p>Return: true if the value of this option really changed or false if it was already set to the requested value. 
      </p></desc>
  </func>
  
  <func>
    <name name="enableHolidayDisplay" arity="1" clause_i="1" since=""/>
    <fsummary>See: <c>enableHolidayDisplay/2</c></fsummary>
  </func>
  
  <func>
    <name name="enableHolidayDisplay" arity="2" clause_i="1" since=""/>
    <fsummary>This function should be used instead of changing <c>wxCAL_SHOW_HOLIDAYS</c> style bit directly. </fsummary>
    <desc><p>This function should be used instead of changing <c>wxCAL_SHOW_HOLIDAYS</c> style bit directly. 
      </p><p>It enables or disables the special highlighting of the holidays. 
      </p></desc>
  </func>
  
  <func>
    <name name="setHeaderColours" arity="3" clause_i="1" since=""/>
    <fsummary>Set the colours used for painting the weekdays at the top of the control. </fsummary>
    <desc><p>Set the colours used for painting the weekdays at the top of the control. 
      </p><p>This method is currently only implemented in generic <seeerl marker="wxCalendarCtrl"><c>wxCalendarCtrl</c></seeerl> and does nothing in the native versions. 
      </p></desc>
  </func>
  
  <func>
    <name name="getHeaderColourFg" arity="1" clause_i="1" since=""/>
    <fsummary>Gets the foreground colour of the header part of the calendar window. </fsummary>
    <desc><p>Gets the foreground colour of the header part of the calendar window. 
      </p><p>This method is currently only implemented in generic <seeerl marker="wxCalendarCtrl"><c>wxCalendarCtrl</c></seeerl> and always returns <c>wxNullColour</c> in the native versions.
      </p><p>See: <seemfa marker="#setHeaderColours/3"><c>setHeaderColours/3</c></seemfa>
      </p></desc>
  </func>
  
  <func>
    <name name="getHeaderColourBg" arity="1" clause_i="1" since=""/>
    <fsummary>Gets the background colour of the header part of the calendar window. </fsummary>
    <desc><p>Gets the background colour of the header part of the calendar window. 
      </p><p>This method is currently only implemented in generic <seeerl marker="wxCalendarCtrl"><c>wxCalendarCtrl</c></seeerl> and always returns <c>wxNullColour</c> in the native versions.
      </p><p>See: <seemfa marker="#setHeaderColours/3"><c>setHeaderColours/3</c></seemfa>
      </p></desc>
  </func>
  
  <func>
    <name name="setHighlightColours" arity="3" clause_i="1" since=""/>
    <fsummary>Set the colours to be used for highlighting the currently selected date. </fsummary>
    <desc><p>Set the colours to be used for highlighting the currently selected date. 
      </p><p>This method is currently only implemented in generic <seeerl marker="wxCalendarCtrl"><c>wxCalendarCtrl</c></seeerl> and does nothing in the native versions. 
      </p></desc>
  </func>
  
  <func>
    <name name="getHighlightColourFg" arity="1" clause_i="1" since=""/>
    <fsummary>Gets the foreground highlight colour. </fsummary>
    <desc><p>Gets the foreground highlight colour. 
      </p><p>Only in generic <seeerl marker="wxCalendarCtrl"><c>wxCalendarCtrl</c></seeerl>.
      </p><p>This method is currently only implemented in generic <seeerl marker="wxCalendarCtrl"><c>wxCalendarCtrl</c></seeerl> and always returns <c>wxNullColour</c> in the native versions.
      </p><p>See: <seemfa marker="#setHighlightColours/3"><c>setHighlightColours/3</c></seemfa>
      </p></desc>
  </func>
  
  <func>
    <name name="getHighlightColourBg" arity="1" clause_i="1" since=""/>
    <fsummary>Gets the background highlight colour. </fsummary>
    <desc><p>Gets the background highlight colour. 
      </p><p>Only in generic <seeerl marker="wxCalendarCtrl"><c>wxCalendarCtrl</c></seeerl>.
      </p><p>This method is currently only implemented in generic <seeerl marker="wxCalendarCtrl"><c>wxCalendarCtrl</c></seeerl> and always returns <c>wxNullColour</c> in the native versions.
      </p><p>See: <seemfa marker="#setHighlightColours/3"><c>setHighlightColours/3</c></seemfa>
      </p></desc>
  </func>
  
  <func>
    <name name="setHolidayColours" arity="3" clause_i="1" since=""/>
    <fsummary>Sets the colours to be used for the holidays highlighting. </fsummary>
    <desc><p>Sets the colours to be used for the holidays highlighting. 
      </p><p>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 <c>wxCAL_SHOW_HOLIDAYS</c> flag or <seemfa marker="#enableHolidayDisplay/2"><c>enableHolidayDisplay/2</c></seemfa> had been called. 
      </p></desc>
  </func>
  
  <func>
    <name name="getHolidayColourFg" arity="1" clause_i="1" since=""/>
    <fsummary>Return the foreground colour currently used for holiday highlighting. </fsummary>
    <desc><p>Return the foreground colour currently used for holiday highlighting. 
      </p><p>Only useful with generic <seeerl marker="wxCalendarCtrl"><c>wxCalendarCtrl</c></seeerl> as native versions currently don't support holidays display at all and always return <c>wxNullColour</c>.
      </p><p>See: <seemfa marker="#setHolidayColours/3"><c>setHolidayColours/3</c></seemfa>
      </p></desc>
  </func>
  
  <func>
    <name name="getHolidayColourBg" arity="1" clause_i="1" since=""/>
    <fsummary>Return the background colour currently used for holiday highlighting. </fsummary>
    <desc><p>Return the background colour currently used for holiday highlighting. 
      </p><p>Only useful with generic <seeerl marker="wxCalendarCtrl"><c>wxCalendarCtrl</c></seeerl> as native versions currently don't support holidays display at all and always return <c>wxNullColour</c>.
      </p><p>See: <seemfa marker="#setHolidayColours/3"><c>setHolidayColours/3</c></seemfa>
      </p></desc>
  </func>
  
  <func>
    <name name="getAttr" arity="2" clause_i="1" since=""/>
    <fsummary>Returns the attribute for the given date (should be in the range 1...31). </fsummary>
    <desc><p>Returns the attribute for the given date (should be in the range 1...31). 
      </p><p>The returned pointer may be NULL. Only in generic <seeerl marker="wxCalendarCtrl"><c>wxCalendarCtrl</c></seeerl>. 
      </p></desc>
  </func>
  
  <func>
    <name name="setAttr" arity="3" clause_i="1" since=""/>
    <fsummary>Associates the attribute with the specified date (in the range 1...31). </fsummary>
    <desc><p>Associates the attribute with the specified date (in the range 1...31). 
      </p><p>If the pointer is NULL, the items attribute is cleared. Only in generic <seeerl marker="wxCalendarCtrl"><c>wxCalendarCtrl</c></seeerl>. 
      </p></desc>
  </func>
  
  <func>
    <name name="setHoliday" arity="2" clause_i="1" since=""/>
    <fsummary>Marks the specified day as being a holiday in the current month. </fsummary>
    <desc><p>Marks the specified day as being a holiday in the current month. 
      </p><p>This method is only implemented in the generic version of the control and does nothing in the native ones. 
      </p></desc>
  </func>
  
  <func>
    <name name="resetAttr" arity="2" clause_i="1" since=""/>
    <fsummary>Clears any attributes associated with the given day (in the range 1...31). </fsummary>
    <desc><p>Clears any attributes associated with the given day (in the range 1...31). 
      </p><p>Only in generic <seeerl marker="wxCalendarCtrl"><c>wxCalendarCtrl</c></seeerl>. 
      </p></desc>
  </func>
  
  <func>
    <name name="hitTest" arity="2" clause_i="1" since=""/>
    <fsummary>Returns one of wxCalendarHitTestResult constants and fills either <c>date</c> or <c>wd</c> pointer with the corresponding value depending on the hit test code. </fsummary>
    <desc><p>Returns one of wxCalendarHitTestResult constants and fills either <c>date</c> or <c>wd</c> pointer with the corresponding value depending on the hit test code. 
      </p><p>Not implemented in wxGTK currently. 
      </p></desc>
  </func>
  </funcs>
</erlref>