1 # This file was created automatically by SWIG.
2 # Don't modify this file, modify the SWIG interface instead.
9 __docfilter__
= wx
.__DocFilter
(globals())
10 CAL_SUNDAY_FIRST
= _calendar
.CAL_SUNDAY_FIRST
11 CAL_MONDAY_FIRST
= _calendar
.CAL_MONDAY_FIRST
12 CAL_SHOW_HOLIDAYS
= _calendar
.CAL_SHOW_HOLIDAYS
13 CAL_NO_YEAR_CHANGE
= _calendar
.CAL_NO_YEAR_CHANGE
14 CAL_NO_MONTH_CHANGE
= _calendar
.CAL_NO_MONTH_CHANGE
15 CAL_SEQUENTIAL_MONTH_SELECTION
= _calendar
.CAL_SEQUENTIAL_MONTH_SELECTION
16 CAL_SHOW_SURROUNDING_WEEKS
= _calendar
.CAL_SHOW_SURROUNDING_WEEKS
17 CAL_HITTEST_NOWHERE
= _calendar
.CAL_HITTEST_NOWHERE
18 CAL_HITTEST_HEADER
= _calendar
.CAL_HITTEST_HEADER
19 CAL_HITTEST_DAY
= _calendar
.CAL_HITTEST_DAY
20 CAL_HITTEST_INCMONTH
= _calendar
.CAL_HITTEST_INCMONTH
21 CAL_HITTEST_DECMONTH
= _calendar
.CAL_HITTEST_DECMONTH
22 CAL_HITTEST_SURROUNDING_WEEK
= _calendar
.CAL_HITTEST_SURROUNDING_WEEK
23 CAL_BORDER_NONE
= _calendar
.CAL_BORDER_NONE
24 CAL_BORDER_SQUARE
= _calendar
.CAL_BORDER_SQUARE
25 CAL_BORDER_ROUND
= _calendar
.CAL_BORDER_ROUND
26 class CalendarDateAttr(object):
28 A set of customization attributes for a calendar date, which can be
29 used to control the look of the Calendar object.
32 return "<%s.%s; proxy of C++ wxCalendarDateAttr instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
33 def __init__(self
, *args
, **kwargs
):
35 __init__(self, Colour colText=wxNullColour, Colour colBack=wxNullColour,
36 Colour colBorder=wxNullColour, Font font=wxNullFont,
37 int border=CAL_BORDER_NONE) -> CalendarDateAttr
39 Create a CalendarDateAttr.
41 newobj
= _calendar
.new_CalendarDateAttr(*args
, **kwargs
)
42 self
.this
= newobj
.this
45 def SetTextColour(*args
, **kwargs
):
46 """SetTextColour(self, Colour colText)"""
47 return _calendar
.CalendarDateAttr_SetTextColour(*args
, **kwargs
)
49 def SetBackgroundColour(*args
, **kwargs
):
50 """SetBackgroundColour(self, Colour colBack)"""
51 return _calendar
.CalendarDateAttr_SetBackgroundColour(*args
, **kwargs
)
53 def SetBorderColour(*args
, **kwargs
):
54 """SetBorderColour(self, Colour col)"""
55 return _calendar
.CalendarDateAttr_SetBorderColour(*args
, **kwargs
)
57 def SetFont(*args
, **kwargs
):
58 """SetFont(self, Font font)"""
59 return _calendar
.CalendarDateAttr_SetFont(*args
, **kwargs
)
61 def SetBorder(*args
, **kwargs
):
62 """SetBorder(self, int border)"""
63 return _calendar
.CalendarDateAttr_SetBorder(*args
, **kwargs
)
65 def SetHoliday(*args
, **kwargs
):
66 """SetHoliday(self, bool holiday)"""
67 return _calendar
.CalendarDateAttr_SetHoliday(*args
, **kwargs
)
69 def HasTextColour(*args
, **kwargs
):
70 """HasTextColour(self) -> bool"""
71 return _calendar
.CalendarDateAttr_HasTextColour(*args
, **kwargs
)
73 def HasBackgroundColour(*args
, **kwargs
):
74 """HasBackgroundColour(self) -> bool"""
75 return _calendar
.CalendarDateAttr_HasBackgroundColour(*args
, **kwargs
)
77 def HasBorderColour(*args
, **kwargs
):
78 """HasBorderColour(self) -> bool"""
79 return _calendar
.CalendarDateAttr_HasBorderColour(*args
, **kwargs
)
81 def HasFont(*args
, **kwargs
):
82 """HasFont(self) -> bool"""
83 return _calendar
.CalendarDateAttr_HasFont(*args
, **kwargs
)
85 def HasBorder(*args
, **kwargs
):
86 """HasBorder(self) -> bool"""
87 return _calendar
.CalendarDateAttr_HasBorder(*args
, **kwargs
)
89 def IsHoliday(*args
, **kwargs
):
90 """IsHoliday(self) -> bool"""
91 return _calendar
.CalendarDateAttr_IsHoliday(*args
, **kwargs
)
93 def GetTextColour(*args
, **kwargs
):
94 """GetTextColour(self) -> Colour"""
95 return _calendar
.CalendarDateAttr_GetTextColour(*args
, **kwargs
)
97 def GetBackgroundColour(*args
, **kwargs
):
98 """GetBackgroundColour(self) -> Colour"""
99 return _calendar
.CalendarDateAttr_GetBackgroundColour(*args
, **kwargs
)
101 def GetBorderColour(*args
, **kwargs
):
102 """GetBorderColour(self) -> Colour"""
103 return _calendar
.CalendarDateAttr_GetBorderColour(*args
, **kwargs
)
105 def GetFont(*args
, **kwargs
):
106 """GetFont(self) -> Font"""
107 return _calendar
.CalendarDateAttr_GetFont(*args
, **kwargs
)
109 def GetBorder(*args
, **kwargs
):
110 """GetBorder(self) -> int"""
111 return _calendar
.CalendarDateAttr_GetBorder(*args
, **kwargs
)
114 class CalendarDateAttrPtr(CalendarDateAttr
):
115 def __init__(self
, this
):
117 if not hasattr(self
,"thisown"): self
.thisown
= 0
118 self
.__class
__ = CalendarDateAttr
119 _calendar
.CalendarDateAttr_swigregister(CalendarDateAttrPtr
)
121 class CalendarEvent(_core
.CommandEvent
):
123 return "<%s.%s; proxy of C++ wxCalendarEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
124 def __init__(self
, *args
, **kwargs
):
125 """__init__(self, CalendarCtrl cal, wxEventType type) -> CalendarEvent"""
126 newobj
= _calendar
.new_CalendarEvent(*args
, **kwargs
)
127 self
.this
= newobj
.this
130 def GetDate(*args
, **kwargs
):
131 """GetDate(self) -> DateTime"""
132 return _calendar
.CalendarEvent_GetDate(*args
, **kwargs
)
134 def SetDate(*args
, **kwargs
):
135 """SetDate(self, DateTime date)"""
136 return _calendar
.CalendarEvent_SetDate(*args
, **kwargs
)
138 def SetWeekDay(*args
, **kwargs
):
139 """SetWeekDay(self, int wd)"""
140 return _calendar
.CalendarEvent_SetWeekDay(*args
, **kwargs
)
142 def GetWeekDay(*args
, **kwargs
):
143 """GetWeekDay(self) -> int"""
144 return _calendar
.CalendarEvent_GetWeekDay(*args
, **kwargs
)
147 class CalendarEventPtr(CalendarEvent
):
148 def __init__(self
, this
):
150 if not hasattr(self
,"thisown"): self
.thisown
= 0
151 self
.__class
__ = CalendarEvent
152 _calendar
.CalendarEvent_swigregister(CalendarEventPtr
)
154 wxEVT_CALENDAR_DOUBLECLICKED
= _calendar
.wxEVT_CALENDAR_DOUBLECLICKED
155 wxEVT_CALENDAR_SEL_CHANGED
= _calendar
.wxEVT_CALENDAR_SEL_CHANGED
156 wxEVT_CALENDAR_DAY_CHANGED
= _calendar
.wxEVT_CALENDAR_DAY_CHANGED
157 wxEVT_CALENDAR_MONTH_CHANGED
= _calendar
.wxEVT_CALENDAR_MONTH_CHANGED
158 wxEVT_CALENDAR_YEAR_CHANGED
= _calendar
.wxEVT_CALENDAR_YEAR_CHANGED
159 wxEVT_CALENDAR_WEEKDAY_CLICKED
= _calendar
.wxEVT_CALENDAR_WEEKDAY_CLICKED
160 EVT_CALENDAR
= wx
.PyEventBinder( wxEVT_CALENDAR_DOUBLECLICKED
, 1)
161 EVT_CALENDAR_SEL_CHANGED
= wx
.PyEventBinder( wxEVT_CALENDAR_SEL_CHANGED
, 1)
162 EVT_CALENDAR_DAY
= wx
.PyEventBinder( wxEVT_CALENDAR_DAY_CHANGED
, 1)
163 EVT_CALENDAR_MONTH
= wx
.PyEventBinder( wxEVT_CALENDAR_MONTH_CHANGED
, 1)
164 EVT_CALENDAR_YEAR
= wx
.PyEventBinder( wxEVT_CALENDAR_YEAR_CHANGED
, 1)
165 EVT_CALENDAR_WEEKDAY_CLICKED
= wx
.PyEventBinder( wxEVT_CALENDAR_WEEKDAY_CLICKED
, 1)
167 class CalendarCtrl(_core
.Control
):
169 The calendar control allows the user to pick a date interactively.
171 The CalendarCtrl displays a window containing several parts: the
172 control to pick the month and the year at the top (either or both of
173 them may be disabled) and a month area below them which shows all the
174 days in the month. The user can move the current selection using the
175 keyboard and select the date (generating EVT_CALENDAR event) by
176 pressing <Return> or double clicking it.
178 It has advanced possibilities for the customization of its
179 display. All global settings (such as colours and fonts used) can, of
180 course, be changed. But also, the display style for each day in the
181 month can be set independently using CalendarDateAttr class.
183 An item without custom attributes is drawn with the default colours
184 and font and without border, but setting custom attributes with
185 SetAttr allows to modify its appearance. Just create a custom
186 attribute object and set it for the day you want to be displayed
187 specially A day may be marked as being a holiday, (even if it is not
188 recognized as one by wx.DateTime) by using the SetHoliday method.
190 As the attributes are specified for each day, they may change when the
191 month is changed, so you will often want to update them in an
192 EVT_CALENDAR_MONTH event handler.
195 return "<%s.%s; proxy of C++ wxCalendarCtrl instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
196 def __init__(self
, *args
, **kwargs
):
198 __init__(self, Window parent, int id=-1, DateTime date=DefaultDateTime,
199 Point pos=DefaultPosition, Size size=DefaultSize,
200 long style=wxCAL_SHOW_HOLIDAYS|wxWANTS_CHARS,
201 String name=CalendarNameStr) -> CalendarCtrl
203 Create and show a calendar control.
205 newobj
= _calendar
.new_CalendarCtrl(*args
, **kwargs
)
206 self
.this
= newobj
.this
209 self
._setOORInfo
(self
)
211 def Create(*args
, **kwargs
):
213 Create(self, Window parent, int id, DateTime date=DefaultDateTime,
214 Point pos=DefaultPosition, Size size=DefaultSize,
215 long style=wxCAL_SHOW_HOLIDAYS|wxWANTS_CHARS,
216 String name=CalendarNameStr) -> bool
218 Acutally create the GUI portion of the CalendarCtrl for 2-phase
221 return _calendar
.CalendarCtrl_Create(*args
, **kwargs
)
223 def SetDate(*args
, **kwargs
):
225 SetDate(self, DateTime date)
227 Sets the current date.
229 return _calendar
.CalendarCtrl_SetDate(*args
, **kwargs
)
231 def GetDate(*args
, **kwargs
):
233 GetDate(self) -> DateTime
235 Gets the currently selected date.
237 return _calendar
.CalendarCtrl_GetDate(*args
, **kwargs
)
239 def SetLowerDateLimit(*args
, **kwargs
):
241 SetLowerDateLimit(self, DateTime date=DefaultDateTime) -> bool
243 set the range in which selection can occur
245 return _calendar
.CalendarCtrl_SetLowerDateLimit(*args
, **kwargs
)
247 def SetUpperDateLimit(*args
, **kwargs
):
249 SetUpperDateLimit(self, DateTime date=DefaultDateTime) -> bool
251 set the range in which selection can occur
253 return _calendar
.CalendarCtrl_SetUpperDateLimit(*args
, **kwargs
)
255 def GetLowerDateLimit(*args
, **kwargs
):
257 GetLowerDateLimit(self) -> DateTime
259 get the range in which selection can occur
261 return _calendar
.CalendarCtrl_GetLowerDateLimit(*args
, **kwargs
)
263 def GetUpperDateLimit(*args
, **kwargs
):
265 GetUpperDateLimit(self) -> DateTime
267 get the range in which selection can occur
269 return _calendar
.CalendarCtrl_GetUpperDateLimit(*args
, **kwargs
)
271 def SetDateRange(*args
, **kwargs
):
273 SetDateRange(self, DateTime lowerdate=DefaultDateTime, DateTime upperdate=DefaultDateTime) -> bool
275 set the range in which selection can occur
277 return _calendar
.CalendarCtrl_SetDateRange(*args
, **kwargs
)
279 def EnableYearChange(*args
, **kwargs
):
281 EnableYearChange(self, bool enable=True)
283 This function should be used instead of changing CAL_NO_YEAR_CHANGE
284 style bit directly. It allows or disallows the user to change the year
287 return _calendar
.CalendarCtrl_EnableYearChange(*args
, **kwargs
)
289 def EnableMonthChange(*args
, **kwargs
):
291 EnableMonthChange(self, bool enable=True)
293 This function should be used instead of changing CAL_NO_MONTH_CHANGE
294 style bit. It allows or disallows the user to change the month
295 interactively. Note that if the month can not be changed, the year can
296 not be changed either.
298 return _calendar
.CalendarCtrl_EnableMonthChange(*args
, **kwargs
)
300 def EnableHolidayDisplay(*args
, **kwargs
):
302 EnableHolidayDisplay(self, bool display=True)
304 This function should be used instead of changing CAL_SHOW_HOLIDAYS
305 style bit directly. It enables or disables the special highlighting of
308 return _calendar
.CalendarCtrl_EnableHolidayDisplay(*args
, **kwargs
)
310 def SetHeaderColours(*args
, **kwargs
):
312 SetHeaderColours(self, Colour colFg, Colour colBg)
314 Header colours are used for painting the weekdays at the top.
316 return _calendar
.CalendarCtrl_SetHeaderColours(*args
, **kwargs
)
318 def GetHeaderColourFg(*args
, **kwargs
):
320 GetHeaderColourFg(self) -> Colour
322 Header colours are used for painting the weekdays at the top.
324 return _calendar
.CalendarCtrl_GetHeaderColourFg(*args
, **kwargs
)
326 def GetHeaderColourBg(*args
, **kwargs
):
328 GetHeaderColourBg(self) -> Colour
330 Header colours are used for painting the weekdays at the top.
332 return _calendar
.CalendarCtrl_GetHeaderColourBg(*args
, **kwargs
)
334 def SetHighlightColours(*args
, **kwargs
):
336 SetHighlightColours(self, Colour colFg, Colour colBg)
338 Highlight colour is used for the currently selected date.
340 return _calendar
.CalendarCtrl_SetHighlightColours(*args
, **kwargs
)
342 def GetHighlightColourFg(*args
, **kwargs
):
344 GetHighlightColourFg(self) -> Colour
346 Highlight colour is used for the currently selected date.
348 return _calendar
.CalendarCtrl_GetHighlightColourFg(*args
, **kwargs
)
350 def GetHighlightColourBg(*args
, **kwargs
):
352 GetHighlightColourBg(self) -> Colour
354 Highlight colour is used for the currently selected date.
356 return _calendar
.CalendarCtrl_GetHighlightColourBg(*args
, **kwargs
)
358 def SetHolidayColours(*args
, **kwargs
):
360 SetHolidayColours(self, Colour colFg, Colour colBg)
362 Holiday colour is used for the holidays (if CAL_SHOW_HOLIDAYS style is
365 return _calendar
.CalendarCtrl_SetHolidayColours(*args
, **kwargs
)
367 def GetHolidayColourFg(*args
, **kwargs
):
369 GetHolidayColourFg(self) -> Colour
371 Holiday colour is used for the holidays (if CAL_SHOW_HOLIDAYS style is
374 return _calendar
.CalendarCtrl_GetHolidayColourFg(*args
, **kwargs
)
376 def GetHolidayColourBg(*args
, **kwargs
):
378 GetHolidayColourBg(self) -> Colour
380 Holiday colour is used for the holidays (if CAL_SHOW_HOLIDAYS style is
383 return _calendar
.CalendarCtrl_GetHolidayColourBg(*args
, **kwargs
)
385 def GetAttr(*args
, **kwargs
):
387 GetAttr(self, size_t day) -> CalendarDateAttr
389 Returns the attribute for the given date (should be in the range
390 1...31). The returned value may be None
392 return _calendar
.CalendarCtrl_GetAttr(*args
, **kwargs
)
394 def SetAttr(*args
, **kwargs
):
396 SetAttr(self, size_t day, CalendarDateAttr attr)
398 Associates the attribute with the specified date (in the range
399 1...31). If the attribute passed is None, the items attribute is
402 return _calendar
.CalendarCtrl_SetAttr(*args
, **kwargs
)
404 def SetHoliday(*args
, **kwargs
):
406 SetHoliday(self, size_t day)
408 Marks the specified day as being a holiday in the current month.
410 return _calendar
.CalendarCtrl_SetHoliday(*args
, **kwargs
)
412 def ResetAttr(*args
, **kwargs
):
414 ResetAttr(self, size_t day)
416 Clears any attributes associated with the given day (in the range
419 return _calendar
.CalendarCtrl_ResetAttr(*args
, **kwargs
)
421 def HitTest(*args
, **kwargs
):
423 HitTest(Point pos) -> (result, date, weekday)
425 Returns 3-tuple with information about the given position on the
426 calendar control. The first value of the tuple is a result code and
427 determines the validity of the remaining two values.
429 return _calendar
.CalendarCtrl_HitTest(*args
, **kwargs
)
431 def GetMonthControl(*args
, **kwargs
):
433 GetMonthControl(self) -> Control
435 Get the currently shown control for month.
437 return _calendar
.CalendarCtrl_GetMonthControl(*args
, **kwargs
)
439 def GetYearControl(*args
, **kwargs
):
441 GetYearControl(self) -> Control
443 Get the currently shown control for year.
445 return _calendar
.CalendarCtrl_GetYearControl(*args
, **kwargs
)
447 def GetClassDefaultAttributes(*args
, **kwargs
):
449 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
451 Get the default attributes for this class. This is useful if you want
452 to use the same font or colour in your own control as in a standard
453 control -- which is a much better idea than hard coding specific
454 colours or fonts which might look completely out of place on the users
455 system, especially if it uses themes.
457 The variant parameter is only relevant under Mac currently and is
458 ignore under other platforms. Under Mac, it will change the size of
459 the returned font. See SetWindowVariant for more about this.
461 return _calendar
.CalendarCtrl_GetClassDefaultAttributes(*args
, **kwargs
)
463 GetClassDefaultAttributes
= staticmethod(GetClassDefaultAttributes
)
465 class CalendarCtrlPtr(CalendarCtrl
):
466 def __init__(self
, this
):
468 if not hasattr(self
,"thisown"): self
.thisown
= 0
469 self
.__class
__ = CalendarCtrl
470 _calendar
.CalendarCtrl_swigregister(CalendarCtrlPtr
)
471 cvar
= _calendar
.cvar
472 CalendarNameStr
= cvar
.CalendarNameStr
474 def PreCalendarCtrl(*args
, **kwargs
):
476 PreCalendarCtrl() -> CalendarCtrl
478 Precreate a CalendarCtrl for 2-phase creation.
480 val
= _calendar
.new_PreCalendarCtrl(*args
, **kwargs
)
484 def CalendarCtrl_GetClassDefaultAttributes(*args
, **kwargs
):
486 CalendarCtrl_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
488 Get the default attributes for this class. This is useful if you want
489 to use the same font or colour in your own control as in a standard
490 control -- which is a much better idea than hard coding specific
491 colours or fonts which might look completely out of place on the users
492 system, especially if it uses themes.
494 The variant parameter is only relevant under Mac currently and is
495 ignore under other platforms. Under Mac, it will change the size of
496 the returned font. See SetWindowVariant for more about this.
498 return _calendar
.CalendarCtrl_GetClassDefaultAttributes(*args
, **kwargs
)