]>
Commit | Line | Data |
---|---|---|
f6bcfd97 | 1 | # This file was created automatically by SWIG. |
d14a1e28 RD |
2 | # Don't modify this file, modify the SWIG interface instead. |
3 | ||
db3e571a RD |
4 | """ |
5 | Classes for an interactive Calendar control. | |
6 | """ | |
7 | ||
d14a1e28 RD |
8 | import _calendar |
9 | ||
54f9ee45 RD |
10 | import _misc |
11 | import _core | |
12 | wx = _core | |
66c033b4 | 13 | __docfilter__ = wx.__DocFilter(globals()) |
d14a1e28 RD |
14 | CAL_SUNDAY_FIRST = _calendar.CAL_SUNDAY_FIRST |
15 | CAL_MONDAY_FIRST = _calendar.CAL_MONDAY_FIRST | |
16 | CAL_SHOW_HOLIDAYS = _calendar.CAL_SHOW_HOLIDAYS | |
17 | CAL_NO_YEAR_CHANGE = _calendar.CAL_NO_YEAR_CHANGE | |
18 | CAL_NO_MONTH_CHANGE = _calendar.CAL_NO_MONTH_CHANGE | |
19 | CAL_SEQUENTIAL_MONTH_SELECTION = _calendar.CAL_SEQUENTIAL_MONTH_SELECTION | |
20 | CAL_SHOW_SURROUNDING_WEEKS = _calendar.CAL_SHOW_SURROUNDING_WEEKS | |
21 | CAL_HITTEST_NOWHERE = _calendar.CAL_HITTEST_NOWHERE | |
22 | CAL_HITTEST_HEADER = _calendar.CAL_HITTEST_HEADER | |
23 | CAL_HITTEST_DAY = _calendar.CAL_HITTEST_DAY | |
24 | CAL_HITTEST_INCMONTH = _calendar.CAL_HITTEST_INCMONTH | |
25 | CAL_HITTEST_DECMONTH = _calendar.CAL_HITTEST_DECMONTH | |
26 | CAL_HITTEST_SURROUNDING_WEEK = _calendar.CAL_HITTEST_SURROUNDING_WEEK | |
27 | CAL_BORDER_NONE = _calendar.CAL_BORDER_NONE | |
28 | CAL_BORDER_SQUARE = _calendar.CAL_BORDER_SQUARE | |
29 | CAL_BORDER_ROUND = _calendar.CAL_BORDER_ROUND | |
30 | class CalendarDateAttr(object): | |
98e665d3 | 31 | """ |
66c033b4 RD |
32 | A set of customization attributes for a calendar date, which can be |
33 | used to control the look of the Calendar object. | |
98e665d3 | 34 | """ |
e811c8ce RD |
35 | def __repr__(self): |
36 | return "<%s.%s; proxy of C++ wxCalendarDateAttr instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 37 | def __init__(self, *args, **kwargs): |
0df68c9f | 38 | """ |
a95a7133 | 39 | __init__(self, Colour colText=wxNullColour, Colour colBack=wxNullColour, |
98e665d3 | 40 | Colour colBorder=wxNullColour, Font font=wxNullFont, |
196addbf | 41 | int border=CAL_BORDER_NONE) -> CalendarDateAttr |
98e665d3 RD |
42 | |
43 | Create a CalendarDateAttr. | |
0df68c9f | 44 | """ |
d14a1e28 RD |
45 | newobj = _calendar.new_CalendarDateAttr(*args, **kwargs) |
46 | self.this = newobj.this | |
f6bcfd97 | 47 | self.thisown = 1 |
d14a1e28 | 48 | del newobj.thisown |
e811c8ce | 49 | def SetTextColour(*args, **kwargs): |
a95a7133 | 50 | """SetTextColour(self, Colour colText)""" |
e811c8ce RD |
51 | return _calendar.CalendarDateAttr_SetTextColour(*args, **kwargs) |
52 | ||
53 | def SetBackgroundColour(*args, **kwargs): | |
a95a7133 | 54 | """SetBackgroundColour(self, Colour colBack)""" |
e811c8ce RD |
55 | return _calendar.CalendarDateAttr_SetBackgroundColour(*args, **kwargs) |
56 | ||
57 | def SetBorderColour(*args, **kwargs): | |
a95a7133 | 58 | """SetBorderColour(self, Colour col)""" |
e811c8ce RD |
59 | return _calendar.CalendarDateAttr_SetBorderColour(*args, **kwargs) |
60 | ||
61 | def SetFont(*args, **kwargs): | |
a95a7133 | 62 | """SetFont(self, Font font)""" |
e811c8ce RD |
63 | return _calendar.CalendarDateAttr_SetFont(*args, **kwargs) |
64 | ||
65 | def SetBorder(*args, **kwargs): | |
a95a7133 | 66 | """SetBorder(self, int border)""" |
e811c8ce RD |
67 | return _calendar.CalendarDateAttr_SetBorder(*args, **kwargs) |
68 | ||
69 | def SetHoliday(*args, **kwargs): | |
a95a7133 | 70 | """SetHoliday(self, bool holiday)""" |
e811c8ce RD |
71 | return _calendar.CalendarDateAttr_SetHoliday(*args, **kwargs) |
72 | ||
73 | def HasTextColour(*args, **kwargs): | |
a95a7133 | 74 | """HasTextColour(self) -> bool""" |
e811c8ce RD |
75 | return _calendar.CalendarDateAttr_HasTextColour(*args, **kwargs) |
76 | ||
77 | def HasBackgroundColour(*args, **kwargs): | |
a95a7133 | 78 | """HasBackgroundColour(self) -> bool""" |
e811c8ce RD |
79 | return _calendar.CalendarDateAttr_HasBackgroundColour(*args, **kwargs) |
80 | ||
81 | def HasBorderColour(*args, **kwargs): | |
a95a7133 | 82 | """HasBorderColour(self) -> bool""" |
e811c8ce RD |
83 | return _calendar.CalendarDateAttr_HasBorderColour(*args, **kwargs) |
84 | ||
85 | def HasFont(*args, **kwargs): | |
a95a7133 | 86 | """HasFont(self) -> bool""" |
e811c8ce RD |
87 | return _calendar.CalendarDateAttr_HasFont(*args, **kwargs) |
88 | ||
89 | def HasBorder(*args, **kwargs): | |
a95a7133 | 90 | """HasBorder(self) -> bool""" |
e811c8ce RD |
91 | return _calendar.CalendarDateAttr_HasBorder(*args, **kwargs) |
92 | ||
93 | def IsHoliday(*args, **kwargs): | |
a95a7133 | 94 | """IsHoliday(self) -> bool""" |
e811c8ce RD |
95 | return _calendar.CalendarDateAttr_IsHoliday(*args, **kwargs) |
96 | ||
97 | def GetTextColour(*args, **kwargs): | |
a95a7133 | 98 | """GetTextColour(self) -> Colour""" |
e811c8ce RD |
99 | return _calendar.CalendarDateAttr_GetTextColour(*args, **kwargs) |
100 | ||
101 | def GetBackgroundColour(*args, **kwargs): | |
a95a7133 | 102 | """GetBackgroundColour(self) -> Colour""" |
e811c8ce RD |
103 | return _calendar.CalendarDateAttr_GetBackgroundColour(*args, **kwargs) |
104 | ||
105 | def GetBorderColour(*args, **kwargs): | |
a95a7133 | 106 | """GetBorderColour(self) -> Colour""" |
e811c8ce RD |
107 | return _calendar.CalendarDateAttr_GetBorderColour(*args, **kwargs) |
108 | ||
109 | def GetFont(*args, **kwargs): | |
a95a7133 | 110 | """GetFont(self) -> Font""" |
e811c8ce RD |
111 | return _calendar.CalendarDateAttr_GetFont(*args, **kwargs) |
112 | ||
113 | def GetBorder(*args, **kwargs): | |
a95a7133 | 114 | """GetBorder(self) -> int""" |
e811c8ce RD |
115 | return _calendar.CalendarDateAttr_GetBorder(*args, **kwargs) |
116 | ||
f6bcfd97 | 117 | |
d14a1e28 RD |
118 | class CalendarDateAttrPtr(CalendarDateAttr): |
119 | def __init__(self, this): | |
120 | self.this = this | |
121 | if not hasattr(self,"thisown"): self.thisown = 0 | |
122 | self.__class__ = CalendarDateAttr | |
123 | _calendar.CalendarDateAttr_swigregister(CalendarDateAttrPtr) | |
f6bcfd97 | 124 | |
54f9ee45 | 125 | class CalendarEvent(_core.CommandEvent): |
e811c8ce RD |
126 | def __repr__(self): |
127 | return "<%s.%s; proxy of C++ wxCalendarEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 128 | def __init__(self, *args, **kwargs): |
a95a7133 | 129 | """__init__(self, CalendarCtrl cal, wxEventType type) -> CalendarEvent""" |
d14a1e28 RD |
130 | newobj = _calendar.new_CalendarEvent(*args, **kwargs) |
131 | self.this = newobj.this | |
f6bcfd97 | 132 | self.thisown = 1 |
d14a1e28 | 133 | del newobj.thisown |
e811c8ce | 134 | def GetDate(*args, **kwargs): |
a95a7133 | 135 | """GetDate(self) -> DateTime""" |
e811c8ce RD |
136 | return _calendar.CalendarEvent_GetDate(*args, **kwargs) |
137 | ||
c9c7117a | 138 | def SetDate(*args, **kwargs): |
a95a7133 | 139 | """SetDate(self, DateTime date)""" |
c9c7117a RD |
140 | return _calendar.CalendarEvent_SetDate(*args, **kwargs) |
141 | ||
142 | def SetWeekDay(*args, **kwargs): | |
a95a7133 | 143 | """SetWeekDay(self, int wd)""" |
c9c7117a RD |
144 | return _calendar.CalendarEvent_SetWeekDay(*args, **kwargs) |
145 | ||
e811c8ce | 146 | def GetWeekDay(*args, **kwargs): |
a95a7133 | 147 | """GetWeekDay(self) -> int""" |
e811c8ce RD |
148 | return _calendar.CalendarEvent_GetWeekDay(*args, **kwargs) |
149 | ||
f6bcfd97 | 150 | |
d14a1e28 RD |
151 | class CalendarEventPtr(CalendarEvent): |
152 | def __init__(self, this): | |
f6bcfd97 | 153 | self.this = this |
d14a1e28 RD |
154 | if not hasattr(self,"thisown"): self.thisown = 0 |
155 | self.__class__ = CalendarEvent | |
156 | _calendar.CalendarEvent_swigregister(CalendarEventPtr) | |
157 | ||
158 | wxEVT_CALENDAR_DOUBLECLICKED = _calendar.wxEVT_CALENDAR_DOUBLECLICKED | |
159 | wxEVT_CALENDAR_SEL_CHANGED = _calendar.wxEVT_CALENDAR_SEL_CHANGED | |
160 | wxEVT_CALENDAR_DAY_CHANGED = _calendar.wxEVT_CALENDAR_DAY_CHANGED | |
161 | wxEVT_CALENDAR_MONTH_CHANGED = _calendar.wxEVT_CALENDAR_MONTH_CHANGED | |
162 | wxEVT_CALENDAR_YEAR_CHANGED = _calendar.wxEVT_CALENDAR_YEAR_CHANGED | |
163 | wxEVT_CALENDAR_WEEKDAY_CLICKED = _calendar.wxEVT_CALENDAR_WEEKDAY_CLICKED | |
164 | EVT_CALENDAR = wx.PyEventBinder( wxEVT_CALENDAR_DOUBLECLICKED, 1) | |
165 | EVT_CALENDAR_SEL_CHANGED = wx.PyEventBinder( wxEVT_CALENDAR_SEL_CHANGED, 1) | |
166 | EVT_CALENDAR_DAY = wx.PyEventBinder( wxEVT_CALENDAR_DAY_CHANGED, 1) | |
167 | EVT_CALENDAR_MONTH = wx.PyEventBinder( wxEVT_CALENDAR_MONTH_CHANGED, 1) | |
168 | EVT_CALENDAR_YEAR = wx.PyEventBinder( wxEVT_CALENDAR_YEAR_CHANGED, 1) | |
169 | EVT_CALENDAR_WEEKDAY_CLICKED = wx.PyEventBinder( wxEVT_CALENDAR_WEEKDAY_CLICKED, 1) | |
170 | ||
54f9ee45 | 171 | class CalendarCtrl(_core.Control): |
66c033b4 RD |
172 | """ |
173 | The calendar control allows the user to pick a date interactively. | |
174 | ||
175 | The CalendarCtrl displays a window containing several parts: the | |
176 | control to pick the month and the year at the top (either or both of | |
177 | them may be disabled) and a month area below them which shows all the | |
178 | days in the month. The user can move the current selection using the | |
179 | keyboard and select the date (generating EVT_CALENDAR event) by | |
180 | pressing <Return> or double clicking it. | |
181 | ||
182 | It has advanced possibilities for the customization of its | |
183 | display. All global settings (such as colours and fonts used) can, of | |
184 | course, be changed. But also, the display style for each day in the | |
185 | month can be set independently using CalendarDateAttr class. | |
186 | ||
187 | An item without custom attributes is drawn with the default colours | |
188 | and font and without border, but setting custom attributes with | |
189 | SetAttr allows to modify its appearance. Just create a custom | |
190 | attribute object and set it for the day you want to be displayed | |
191 | specially A day may be marked as being a holiday, (even if it is not | |
192 | recognized as one by wx.DateTime) by using the SetHoliday method. | |
193 | ||
194 | As the attributes are specified for each day, they may change when the | |
195 | month is changed, so you will often want to update them in an | |
196 | EVT_CALENDAR_MONTH event handler. | |
db3e571a RD |
197 | |
198 | Window Styles | |
199 | ------------- | |
200 | ============================== ============================ | |
201 | CAL_SUNDAY_FIRST Show Sunday as the first day | |
202 | in the week | |
203 | CAL_MONDAY_FIRST Show Monday as the first day | |
204 | in the week | |
205 | CAL_SHOW_HOLIDAYS Highlight holidays in the | |
206 | calendar | |
207 | CAL_NO_YEAR_CHANGE Disable the year changing | |
208 | CAL_NO_MONTH_CHANGE Disable the month (and, | |
209 | implicitly, the year) changing | |
210 | CAL_SHOW_SURROUNDING_WEEKS Show the neighbouring weeks in | |
211 | the previous and next months | |
212 | CAL_SEQUENTIAL_MONTH_SELECTION Use alternative, more compact, | |
213 | style for the month and year | |
214 | selection controls. | |
215 | ============================== ============================ | |
216 | ||
217 | The default calendar style is CAL_SHOW_HOLIDAYS. | |
218 | ||
219 | Events | |
220 | ------- | |
221 | ============================= ============================== | |
222 | EVT_CALENDAR A day was double clicked in the | |
223 | calendar. | |
224 | EVT_CALENDAR_SEL_CHANGED The selected date changed. | |
225 | EVT_CALENDAR_DAY The selected day changed. | |
226 | EVT_CALENDAR_MONTH The selected month changed. | |
227 | EVT_CALENDAR_YEAR The selected year changed. | |
228 | EVT_CALENDAR_WEEKDAY_CLICKED User clicked on the week day | |
229 | header | |
230 | ============================= ============================== | |
231 | ||
232 | Note that changing the selected date will result in one of | |
233 | EVT_CALENDAR_DAY, MONTH or YEAR events and an EVT_CALENDAR_SEL_CHANGED | |
234 | event. | |
235 | ||
236 | ||
66c033b4 | 237 | """ |
e811c8ce RD |
238 | def __repr__(self): |
239 | return "<%s.%s; proxy of C++ wxCalendarCtrl instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 240 | def __init__(self, *args, **kwargs): |
0df68c9f | 241 | """ |
a95a7133 | 242 | __init__(self, Window parent, int id=-1, DateTime date=DefaultDateTime, |
0df68c9f RD |
243 | Point pos=DefaultPosition, Size size=DefaultSize, |
244 | long style=wxCAL_SHOW_HOLIDAYS|wxWANTS_CHARS, | |
b2dc1044 | 245 | String name=CalendarNameStr) -> CalendarCtrl |
98e665d3 RD |
246 | |
247 | Create and show a calendar control. | |
0df68c9f | 248 | """ |
d14a1e28 RD |
249 | newobj = _calendar.new_CalendarCtrl(*args, **kwargs) |
250 | self.this = newobj.this | |
f6bcfd97 | 251 | self.thisown = 1 |
d14a1e28 | 252 | del newobj.thisown |
0220cbc1 | 253 | self._setOORInfo(self) |
e811c8ce RD |
254 | |
255 | def Create(*args, **kwargs): | |
0df68c9f | 256 | """ |
a95a7133 | 257 | Create(self, Window parent, int id, DateTime date=DefaultDateTime, |
0df68c9f RD |
258 | Point pos=DefaultPosition, Size size=DefaultSize, |
259 | long style=wxCAL_SHOW_HOLIDAYS|wxWANTS_CHARS, | |
b2dc1044 | 260 | String name=CalendarNameStr) -> bool |
98e665d3 | 261 | |
66c033b4 RD |
262 | Acutally create the GUI portion of the CalendarCtrl for 2-phase |
263 | creation. | |
0df68c9f | 264 | """ |
e811c8ce RD |
265 | return _calendar.CalendarCtrl_Create(*args, **kwargs) |
266 | ||
267 | def SetDate(*args, **kwargs): | |
98e665d3 | 268 | """ |
a95a7133 | 269 | SetDate(self, DateTime date) |
98e665d3 RD |
270 | |
271 | Sets the current date. | |
272 | """ | |
e811c8ce RD |
273 | return _calendar.CalendarCtrl_SetDate(*args, **kwargs) |
274 | ||
275 | def GetDate(*args, **kwargs): | |
98e665d3 | 276 | """ |
a95a7133 | 277 | GetDate(self) -> DateTime |
98e665d3 RD |
278 | |
279 | Gets the currently selected date. | |
280 | """ | |
e811c8ce RD |
281 | return _calendar.CalendarCtrl_GetDate(*args, **kwargs) |
282 | ||
283 | def SetLowerDateLimit(*args, **kwargs): | |
98e665d3 | 284 | """ |
a95a7133 | 285 | SetLowerDateLimit(self, DateTime date=DefaultDateTime) -> bool |
e811c8ce | 286 | |
98e665d3 RD |
287 | set the range in which selection can occur |
288 | """ | |
289 | return _calendar.CalendarCtrl_SetLowerDateLimit(*args, **kwargs) | |
e811c8ce RD |
290 | |
291 | def SetUpperDateLimit(*args, **kwargs): | |
98e665d3 | 292 | """ |
a95a7133 | 293 | SetUpperDateLimit(self, DateTime date=DefaultDateTime) -> bool |
98e665d3 RD |
294 | |
295 | set the range in which selection can occur | |
296 | """ | |
e811c8ce RD |
297 | return _calendar.CalendarCtrl_SetUpperDateLimit(*args, **kwargs) |
298 | ||
98e665d3 RD |
299 | def GetLowerDateLimit(*args, **kwargs): |
300 | """ | |
a95a7133 | 301 | GetLowerDateLimit(self) -> DateTime |
98e665d3 RD |
302 | |
303 | get the range in which selection can occur | |
304 | """ | |
305 | return _calendar.CalendarCtrl_GetLowerDateLimit(*args, **kwargs) | |
306 | ||
e811c8ce | 307 | def GetUpperDateLimit(*args, **kwargs): |
98e665d3 | 308 | """ |
a95a7133 | 309 | GetUpperDateLimit(self) -> DateTime |
98e665d3 RD |
310 | |
311 | get the range in which selection can occur | |
312 | """ | |
e811c8ce RD |
313 | return _calendar.CalendarCtrl_GetUpperDateLimit(*args, **kwargs) |
314 | ||
315 | def SetDateRange(*args, **kwargs): | |
98e665d3 | 316 | """ |
a95a7133 | 317 | SetDateRange(self, DateTime lowerdate=DefaultDateTime, DateTime upperdate=DefaultDateTime) -> bool |
98e665d3 RD |
318 | |
319 | set the range in which selection can occur | |
320 | """ | |
e811c8ce RD |
321 | return _calendar.CalendarCtrl_SetDateRange(*args, **kwargs) |
322 | ||
323 | def EnableYearChange(*args, **kwargs): | |
98e665d3 | 324 | """ |
a95a7133 | 325 | EnableYearChange(self, bool enable=True) |
98e665d3 RD |
326 | |
327 | This function should be used instead of changing CAL_NO_YEAR_CHANGE | |
328 | style bit directly. It allows or disallows the user to change the year | |
329 | interactively. | |
330 | """ | |
e811c8ce RD |
331 | return _calendar.CalendarCtrl_EnableYearChange(*args, **kwargs) |
332 | ||
333 | def EnableMonthChange(*args, **kwargs): | |
98e665d3 | 334 | """ |
a95a7133 | 335 | EnableMonthChange(self, bool enable=True) |
98e665d3 | 336 | |
66c033b4 RD |
337 | This function should be used instead of changing CAL_NO_MONTH_CHANGE |
338 | style bit. It allows or disallows the user to change the month | |
339 | interactively. Note that if the month can not be changed, the year can | |
340 | not be changed either. | |
98e665d3 | 341 | """ |
e811c8ce RD |
342 | return _calendar.CalendarCtrl_EnableMonthChange(*args, **kwargs) |
343 | ||
344 | def EnableHolidayDisplay(*args, **kwargs): | |
98e665d3 | 345 | """ |
a95a7133 | 346 | EnableHolidayDisplay(self, bool display=True) |
98e665d3 | 347 | |
66c033b4 RD |
348 | This function should be used instead of changing CAL_SHOW_HOLIDAYS |
349 | style bit directly. It enables or disables the special highlighting of | |
350 | the holidays. | |
98e665d3 | 351 | """ |
e811c8ce RD |
352 | return _calendar.CalendarCtrl_EnableHolidayDisplay(*args, **kwargs) |
353 | ||
354 | def SetHeaderColours(*args, **kwargs): | |
98e665d3 | 355 | """ |
a95a7133 | 356 | SetHeaderColours(self, Colour colFg, Colour colBg) |
98e665d3 | 357 | |
66c033b4 | 358 | Header colours are used for painting the weekdays at the top. |
98e665d3 | 359 | """ |
e811c8ce RD |
360 | return _calendar.CalendarCtrl_SetHeaderColours(*args, **kwargs) |
361 | ||
362 | def GetHeaderColourFg(*args, **kwargs): | |
98e665d3 | 363 | """ |
a95a7133 | 364 | GetHeaderColourFg(self) -> Colour |
98e665d3 | 365 | |
66c033b4 | 366 | Header colours are used for painting the weekdays at the top. |
98e665d3 | 367 | """ |
e811c8ce RD |
368 | return _calendar.CalendarCtrl_GetHeaderColourFg(*args, **kwargs) |
369 | ||
370 | def GetHeaderColourBg(*args, **kwargs): | |
98e665d3 | 371 | """ |
a95a7133 | 372 | GetHeaderColourBg(self) -> Colour |
98e665d3 | 373 | |
66c033b4 | 374 | Header colours are used for painting the weekdays at the top. |
98e665d3 | 375 | """ |
e811c8ce RD |
376 | return _calendar.CalendarCtrl_GetHeaderColourBg(*args, **kwargs) |
377 | ||
378 | def SetHighlightColours(*args, **kwargs): | |
98e665d3 | 379 | """ |
a95a7133 | 380 | SetHighlightColours(self, Colour colFg, Colour colBg) |
98e665d3 | 381 | |
66c033b4 | 382 | Highlight colour is used for the currently selected date. |
98e665d3 | 383 | """ |
e811c8ce RD |
384 | return _calendar.CalendarCtrl_SetHighlightColours(*args, **kwargs) |
385 | ||
386 | def GetHighlightColourFg(*args, **kwargs): | |
98e665d3 | 387 | """ |
a95a7133 | 388 | GetHighlightColourFg(self) -> Colour |
98e665d3 | 389 | |
66c033b4 | 390 | Highlight colour is used for the currently selected date. |
98e665d3 | 391 | """ |
e811c8ce RD |
392 | return _calendar.CalendarCtrl_GetHighlightColourFg(*args, **kwargs) |
393 | ||
394 | def GetHighlightColourBg(*args, **kwargs): | |
98e665d3 | 395 | """ |
a95a7133 | 396 | GetHighlightColourBg(self) -> Colour |
98e665d3 | 397 | |
66c033b4 | 398 | Highlight colour is used for the currently selected date. |
98e665d3 | 399 | """ |
e811c8ce RD |
400 | return _calendar.CalendarCtrl_GetHighlightColourBg(*args, **kwargs) |
401 | ||
402 | def SetHolidayColours(*args, **kwargs): | |
98e665d3 | 403 | """ |
a95a7133 | 404 | SetHolidayColours(self, Colour colFg, Colour colBg) |
98e665d3 | 405 | |
66c033b4 RD |
406 | Holiday colour is used for the holidays (if CAL_SHOW_HOLIDAYS style is |
407 | used). | |
98e665d3 | 408 | """ |
e811c8ce RD |
409 | return _calendar.CalendarCtrl_SetHolidayColours(*args, **kwargs) |
410 | ||
411 | def GetHolidayColourFg(*args, **kwargs): | |
98e665d3 | 412 | """ |
a95a7133 | 413 | GetHolidayColourFg(self) -> Colour |
98e665d3 | 414 | |
66c033b4 RD |
415 | Holiday colour is used for the holidays (if CAL_SHOW_HOLIDAYS style is |
416 | used). | |
98e665d3 | 417 | """ |
e811c8ce RD |
418 | return _calendar.CalendarCtrl_GetHolidayColourFg(*args, **kwargs) |
419 | ||
420 | def GetHolidayColourBg(*args, **kwargs): | |
98e665d3 | 421 | """ |
a95a7133 | 422 | GetHolidayColourBg(self) -> Colour |
98e665d3 | 423 | |
66c033b4 RD |
424 | Holiday colour is used for the holidays (if CAL_SHOW_HOLIDAYS style is |
425 | used). | |
98e665d3 | 426 | """ |
e811c8ce RD |
427 | return _calendar.CalendarCtrl_GetHolidayColourBg(*args, **kwargs) |
428 | ||
429 | def GetAttr(*args, **kwargs): | |
98e665d3 | 430 | """ |
a95a7133 | 431 | GetAttr(self, size_t day) -> CalendarDateAttr |
98e665d3 | 432 | |
66c033b4 RD |
433 | Returns the attribute for the given date (should be in the range |
434 | 1...31). The returned value may be None | |
98e665d3 | 435 | """ |
e811c8ce RD |
436 | return _calendar.CalendarCtrl_GetAttr(*args, **kwargs) |
437 | ||
438 | def SetAttr(*args, **kwargs): | |
98e665d3 | 439 | """ |
a95a7133 | 440 | SetAttr(self, size_t day, CalendarDateAttr attr) |
98e665d3 | 441 | |
66c033b4 RD |
442 | Associates the attribute with the specified date (in the range |
443 | 1...31). If the attribute passed is None, the items attribute is | |
444 | cleared. | |
98e665d3 | 445 | """ |
e811c8ce RD |
446 | return _calendar.CalendarCtrl_SetAttr(*args, **kwargs) |
447 | ||
448 | def SetHoliday(*args, **kwargs): | |
98e665d3 | 449 | """ |
a95a7133 | 450 | SetHoliday(self, size_t day) |
98e665d3 RD |
451 | |
452 | Marks the specified day as being a holiday in the current month. | |
453 | """ | |
e811c8ce RD |
454 | return _calendar.CalendarCtrl_SetHoliday(*args, **kwargs) |
455 | ||
456 | def ResetAttr(*args, **kwargs): | |
98e665d3 | 457 | """ |
a95a7133 | 458 | ResetAttr(self, size_t day) |
98e665d3 | 459 | |
66c033b4 RD |
460 | Clears any attributes associated with the given day (in the range |
461 | 1...31). | |
98e665d3 | 462 | """ |
e811c8ce RD |
463 | return _calendar.CalendarCtrl_ResetAttr(*args, **kwargs) |
464 | ||
465 | def HitTest(*args, **kwargs): | |
98e665d3 RD |
466 | """ |
467 | HitTest(Point pos) -> (result, date, weekday) | |
468 | ||
66c033b4 RD |
469 | Returns 3-tuple with information about the given position on the |
470 | calendar control. The first value of the tuple is a result code and | |
41e2b43e | 471 | determines the validity of the remaining two values. |
db3e571a RD |
472 | The result codes are: |
473 | ||
474 | =================== ============================================ | |
475 | CAL_HITTEST_NOWHERE hit outside of anything | |
476 | CAL_HITTEST_HEADER hit on the header, weekday is valid | |
477 | CAL_HITTEST_DAY hit on a day in the calendar, date is set. | |
478 | =================== ============================================ | |
479 | ||
98e665d3 RD |
480 | """ |
481 | return _calendar.CalendarCtrl_HitTest(*args, **kwargs) | |
e811c8ce | 482 | |
c9c7117a | 483 | def GetMonthControl(*args, **kwargs): |
98e665d3 | 484 | """ |
a95a7133 | 485 | GetMonthControl(self) -> Control |
98e665d3 | 486 | |
66c033b4 | 487 | Get the currently shown control for month. |
98e665d3 | 488 | """ |
c9c7117a RD |
489 | return _calendar.CalendarCtrl_GetMonthControl(*args, **kwargs) |
490 | ||
491 | def GetYearControl(*args, **kwargs): | |
98e665d3 | 492 | """ |
a95a7133 | 493 | GetYearControl(self) -> Control |
98e665d3 | 494 | |
66c033b4 | 495 | Get the currently shown control for year. |
98e665d3 | 496 | """ |
c9c7117a RD |
497 | return _calendar.CalendarCtrl_GetYearControl(*args, **kwargs) |
498 | ||
22bfe96c RD |
499 | def GetClassDefaultAttributes(*args, **kwargs): |
500 | """ | |
501 | GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes | |
502 | ||
41e2b43e RD |
503 | Get the default attributes for this class. This is useful if you want |
504 | to use the same font or colour in your own control as in a standard | |
505 | control -- which is a much better idea than hard coding specific | |
db3e571a RD |
506 | colours or fonts which might look completely out of place on the |
507 | user's system, especially if it uses themes. | |
22bfe96c RD |
508 | |
509 | The variant parameter is only relevant under Mac currently and is | |
41e2b43e | 510 | ignore under other platforms. Under Mac, it will change the size of |
db3e571a RD |
511 | the returned font. See `wx.Window.SetWindowVariant` for more about |
512 | this. | |
22bfe96c RD |
513 | """ |
514 | return _calendar.CalendarCtrl_GetClassDefaultAttributes(*args, **kwargs) | |
515 | ||
516 | GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes) | |
f6bcfd97 | 517 | |
d14a1e28 RD |
518 | class CalendarCtrlPtr(CalendarCtrl): |
519 | def __init__(self, this): | |
520 | self.this = this | |
521 | if not hasattr(self,"thisown"): self.thisown = 0 | |
522 | self.__class__ = CalendarCtrl | |
523 | _calendar.CalendarCtrl_swigregister(CalendarCtrlPtr) | |
b2dc1044 RD |
524 | cvar = _calendar.cvar |
525 | CalendarNameStr = cvar.CalendarNameStr | |
f6bcfd97 | 526 | |
d14a1e28 | 527 | def PreCalendarCtrl(*args, **kwargs): |
98e665d3 RD |
528 | """ |
529 | PreCalendarCtrl() -> CalendarCtrl | |
530 | ||
531 | Precreate a CalendarCtrl for 2-phase creation. | |
532 | """ | |
d14a1e28 | 533 | val = _calendar.new_PreCalendarCtrl(*args, **kwargs) |
aa2a5b86 RD |
534 | val.thisown = 1 |
535 | return val | |
536 | ||
22bfe96c RD |
537 | def CalendarCtrl_GetClassDefaultAttributes(*args, **kwargs): |
538 | """ | |
539 | CalendarCtrl_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes | |
540 | ||
41e2b43e RD |
541 | Get the default attributes for this class. This is useful if you want |
542 | to use the same font or colour in your own control as in a standard | |
543 | control -- which is a much better idea than hard coding specific | |
db3e571a RD |
544 | colours or fonts which might look completely out of place on the |
545 | user's system, especially if it uses themes. | |
22bfe96c RD |
546 | |
547 | The variant parameter is only relevant under Mac currently and is | |
41e2b43e | 548 | ignore under other platforms. Under Mac, it will change the size of |
db3e571a RD |
549 | the returned font. See `wx.Window.SetWindowVariant` for more about |
550 | this. | |
22bfe96c RD |
551 | """ |
552 | return _calendar.CalendarCtrl_GetClassDefaultAttributes(*args, **kwargs) | |
553 | ||
f6bcfd97 | 554 |