]> git.saurik.com Git - wxWidgets.git/blob - wxPython/src/msw/calendar.py
Script updates
[wxWidgets.git] / wxPython / src / msw / calendar.py
1 # This file was created automatically by SWIG.
2 # Don't modify this file, modify the SWIG interface instead.
3
4 import _calendar
5
6 import misc
7 import core
8 wx = core
9 CAL_SUNDAY_FIRST = _calendar.CAL_SUNDAY_FIRST
10 CAL_MONDAY_FIRST = _calendar.CAL_MONDAY_FIRST
11 CAL_SHOW_HOLIDAYS = _calendar.CAL_SHOW_HOLIDAYS
12 CAL_NO_YEAR_CHANGE = _calendar.CAL_NO_YEAR_CHANGE
13 CAL_NO_MONTH_CHANGE = _calendar.CAL_NO_MONTH_CHANGE
14 CAL_SEQUENTIAL_MONTH_SELECTION = _calendar.CAL_SEQUENTIAL_MONTH_SELECTION
15 CAL_SHOW_SURROUNDING_WEEKS = _calendar.CAL_SHOW_SURROUNDING_WEEKS
16 CAL_HITTEST_NOWHERE = _calendar.CAL_HITTEST_NOWHERE
17 CAL_HITTEST_HEADER = _calendar.CAL_HITTEST_HEADER
18 CAL_HITTEST_DAY = _calendar.CAL_HITTEST_DAY
19 CAL_HITTEST_INCMONTH = _calendar.CAL_HITTEST_INCMONTH
20 CAL_HITTEST_DECMONTH = _calendar.CAL_HITTEST_DECMONTH
21 CAL_HITTEST_SURROUNDING_WEEK = _calendar.CAL_HITTEST_SURROUNDING_WEEK
22 CAL_BORDER_NONE = _calendar.CAL_BORDER_NONE
23 CAL_BORDER_SQUARE = _calendar.CAL_BORDER_SQUARE
24 CAL_BORDER_ROUND = _calendar.CAL_BORDER_ROUND
25 class CalendarDateAttr(object):
26 """
27 A set of customization attributes for a calendar date, which can be used to
28 control the look of the Calendar object.
29 """
30 def __repr__(self):
31 return "<%s.%s; proxy of C++ wxCalendarDateAttr instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
32 def __init__(self, *args, **kwargs):
33 """
34 __init__(Colour colText=wxNullColour, Colour colBack=wxNullColour,
35 Colour colBorder=wxNullColour, Font font=wxNullFont,
36 int border=CAL_BORDER_NONE) -> CalendarDateAttr
37
38 Create a CalendarDateAttr.
39 """
40 newobj = _calendar.new_CalendarDateAttr(*args, **kwargs)
41 self.this = newobj.this
42 self.thisown = 1
43 del newobj.thisown
44 def SetTextColour(*args, **kwargs):
45 """SetTextColour(Colour colText)"""
46 return _calendar.CalendarDateAttr_SetTextColour(*args, **kwargs)
47
48 def SetBackgroundColour(*args, **kwargs):
49 """SetBackgroundColour(Colour colBack)"""
50 return _calendar.CalendarDateAttr_SetBackgroundColour(*args, **kwargs)
51
52 def SetBorderColour(*args, **kwargs):
53 """SetBorderColour(Colour col)"""
54 return _calendar.CalendarDateAttr_SetBorderColour(*args, **kwargs)
55
56 def SetFont(*args, **kwargs):
57 """SetFont(Font font)"""
58 return _calendar.CalendarDateAttr_SetFont(*args, **kwargs)
59
60 def SetBorder(*args, **kwargs):
61 """SetBorder(int border)"""
62 return _calendar.CalendarDateAttr_SetBorder(*args, **kwargs)
63
64 def SetHoliday(*args, **kwargs):
65 """SetHoliday(bool holiday)"""
66 return _calendar.CalendarDateAttr_SetHoliday(*args, **kwargs)
67
68 def HasTextColour(*args, **kwargs):
69 """HasTextColour() -> bool"""
70 return _calendar.CalendarDateAttr_HasTextColour(*args, **kwargs)
71
72 def HasBackgroundColour(*args, **kwargs):
73 """HasBackgroundColour() -> bool"""
74 return _calendar.CalendarDateAttr_HasBackgroundColour(*args, **kwargs)
75
76 def HasBorderColour(*args, **kwargs):
77 """HasBorderColour() -> bool"""
78 return _calendar.CalendarDateAttr_HasBorderColour(*args, **kwargs)
79
80 def HasFont(*args, **kwargs):
81 """HasFont() -> bool"""
82 return _calendar.CalendarDateAttr_HasFont(*args, **kwargs)
83
84 def HasBorder(*args, **kwargs):
85 """HasBorder() -> bool"""
86 return _calendar.CalendarDateAttr_HasBorder(*args, **kwargs)
87
88 def IsHoliday(*args, **kwargs):
89 """IsHoliday() -> bool"""
90 return _calendar.CalendarDateAttr_IsHoliday(*args, **kwargs)
91
92 def GetTextColour(*args, **kwargs):
93 """GetTextColour() -> Colour"""
94 return _calendar.CalendarDateAttr_GetTextColour(*args, **kwargs)
95
96 def GetBackgroundColour(*args, **kwargs):
97 """GetBackgroundColour() -> Colour"""
98 return _calendar.CalendarDateAttr_GetBackgroundColour(*args, **kwargs)
99
100 def GetBorderColour(*args, **kwargs):
101 """GetBorderColour() -> Colour"""
102 return _calendar.CalendarDateAttr_GetBorderColour(*args, **kwargs)
103
104 def GetFont(*args, **kwargs):
105 """GetFont() -> Font"""
106 return _calendar.CalendarDateAttr_GetFont(*args, **kwargs)
107
108 def GetBorder(*args, **kwargs):
109 """GetBorder() -> int"""
110 return _calendar.CalendarDateAttr_GetBorder(*args, **kwargs)
111
112
113 class CalendarDateAttrPtr(CalendarDateAttr):
114 def __init__(self, this):
115 self.this = this
116 if not hasattr(self,"thisown"): self.thisown = 0
117 self.__class__ = CalendarDateAttr
118 _calendar.CalendarDateAttr_swigregister(CalendarDateAttrPtr)
119
120 class CalendarEvent(core.CommandEvent):
121 def __repr__(self):
122 return "<%s.%s; proxy of C++ wxCalendarEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
123 def __init__(self, *args, **kwargs):
124 """__init__(CalendarCtrl cal, wxEventType type) -> CalendarEvent"""
125 newobj = _calendar.new_CalendarEvent(*args, **kwargs)
126 self.this = newobj.this
127 self.thisown = 1
128 del newobj.thisown
129 def GetDate(*args, **kwargs):
130 """GetDate() -> DateTime"""
131 return _calendar.CalendarEvent_GetDate(*args, **kwargs)
132
133 def SetDate(*args, **kwargs):
134 """SetDate(DateTime date)"""
135 return _calendar.CalendarEvent_SetDate(*args, **kwargs)
136
137 def SetWeekDay(*args, **kwargs):
138 """SetWeekDay(int wd)"""
139 return _calendar.CalendarEvent_SetWeekDay(*args, **kwargs)
140
141 def GetWeekDay(*args, **kwargs):
142 """GetWeekDay() -> int"""
143 return _calendar.CalendarEvent_GetWeekDay(*args, **kwargs)
144
145
146 class CalendarEventPtr(CalendarEvent):
147 def __init__(self, this):
148 self.this = this
149 if not hasattr(self,"thisown"): self.thisown = 0
150 self.__class__ = CalendarEvent
151 _calendar.CalendarEvent_swigregister(CalendarEventPtr)
152
153 wxEVT_CALENDAR_DOUBLECLICKED = _calendar.wxEVT_CALENDAR_DOUBLECLICKED
154 wxEVT_CALENDAR_SEL_CHANGED = _calendar.wxEVT_CALENDAR_SEL_CHANGED
155 wxEVT_CALENDAR_DAY_CHANGED = _calendar.wxEVT_CALENDAR_DAY_CHANGED
156 wxEVT_CALENDAR_MONTH_CHANGED = _calendar.wxEVT_CALENDAR_MONTH_CHANGED
157 wxEVT_CALENDAR_YEAR_CHANGED = _calendar.wxEVT_CALENDAR_YEAR_CHANGED
158 wxEVT_CALENDAR_WEEKDAY_CLICKED = _calendar.wxEVT_CALENDAR_WEEKDAY_CLICKED
159 EVT_CALENDAR = wx.PyEventBinder( wxEVT_CALENDAR_DOUBLECLICKED, 1)
160 EVT_CALENDAR_SEL_CHANGED = wx.PyEventBinder( wxEVT_CALENDAR_SEL_CHANGED, 1)
161 EVT_CALENDAR_DAY = wx.PyEventBinder( wxEVT_CALENDAR_DAY_CHANGED, 1)
162 EVT_CALENDAR_MONTH = wx.PyEventBinder( wxEVT_CALENDAR_MONTH_CHANGED, 1)
163 EVT_CALENDAR_YEAR = wx.PyEventBinder( wxEVT_CALENDAR_YEAR_CHANGED, 1)
164 EVT_CALENDAR_WEEKDAY_CLICKED = wx.PyEventBinder( wxEVT_CALENDAR_WEEKDAY_CLICKED, 1)
165
166 class CalendarCtrl(core.Control):
167 """The calendar control allows the user to pick a date interactively."""
168 def __repr__(self):
169 return "<%s.%s; proxy of C++ wxCalendarCtrl instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
170 def __init__(self, *args, **kwargs):
171 """
172 __init__(Window parent, int id, DateTime date=DefaultDateTime,
173 Point pos=DefaultPosition, Size size=DefaultSize,
174 long style=wxCAL_SHOW_HOLIDAYS|wxWANTS_CHARS,
175 String name=CalendarNameStr) -> CalendarCtrl
176
177 Create and show a calendar control.
178 """
179 newobj = _calendar.new_CalendarCtrl(*args, **kwargs)
180 self.this = newobj.this
181 self.thisown = 1
182 del newobj.thisown
183 self._setOORInfo(self)
184
185 def Create(*args, **kwargs):
186 """
187 Create(Window parent, int id, DateTime date=DefaultDateTime,
188 Point pos=DefaultPosition, Size size=DefaultSize,
189 long style=wxCAL_SHOW_HOLIDAYS|wxWANTS_CHARS,
190 String name=CalendarNameStr) -> bool
191
192 Acutally create the GUI portion of the CalendarCtrl for 2-phase creation.
193 """
194 return _calendar.CalendarCtrl_Create(*args, **kwargs)
195
196 def SetDate(*args, **kwargs):
197 """
198 SetDate(DateTime date)
199
200 Sets the current date.
201 """
202 return _calendar.CalendarCtrl_SetDate(*args, **kwargs)
203
204 def GetDate(*args, **kwargs):
205 """
206 GetDate() -> DateTime
207
208 Gets the currently selected date.
209 """
210 return _calendar.CalendarCtrl_GetDate(*args, **kwargs)
211
212 def SetLowerDateLimit(*args, **kwargs):
213 """
214 SetLowerDateLimit(DateTime date=DefaultDateTime) -> bool
215
216 set the range in which selection can occur
217 """
218 return _calendar.CalendarCtrl_SetLowerDateLimit(*args, **kwargs)
219
220 def SetUpperDateLimit(*args, **kwargs):
221 """
222 SetUpperDateLimit(DateTime date=DefaultDateTime) -> bool
223
224 set the range in which selection can occur
225 """
226 return _calendar.CalendarCtrl_SetUpperDateLimit(*args, **kwargs)
227
228 def GetLowerDateLimit(*args, **kwargs):
229 """
230 GetLowerDateLimit() -> DateTime
231
232 get the range in which selection can occur
233 """
234 return _calendar.CalendarCtrl_GetLowerDateLimit(*args, **kwargs)
235
236 def GetUpperDateLimit(*args, **kwargs):
237 """
238 GetUpperDateLimit() -> DateTime
239
240 get the range in which selection can occur
241 """
242 return _calendar.CalendarCtrl_GetUpperDateLimit(*args, **kwargs)
243
244 def SetDateRange(*args, **kwargs):
245 """
246 SetDateRange(DateTime lowerdate=DefaultDateTime, DateTime upperdate=DefaultDateTime) -> bool
247
248 set the range in which selection can occur
249 """
250 return _calendar.CalendarCtrl_SetDateRange(*args, **kwargs)
251
252 def EnableYearChange(*args, **kwargs):
253 """
254 EnableYearChange(bool enable=True)
255
256 This function should be used instead of changing CAL_NO_YEAR_CHANGE
257 style bit directly. It allows or disallows the user to change the year
258 interactively.
259 """
260 return _calendar.CalendarCtrl_EnableYearChange(*args, **kwargs)
261
262 def EnableMonthChange(*args, **kwargs):
263 """
264 EnableMonthChange(bool enable=True)
265
266 This function should be used instead of changing CAL_NO_MONTH_CHANGE style
267 bit. It allows or disallows the user to change the month interactively. Note
268 that if the month can not be changed, the year can not be changed either.
269 """
270 return _calendar.CalendarCtrl_EnableMonthChange(*args, **kwargs)
271
272 def EnableHolidayDisplay(*args, **kwargs):
273 """
274 EnableHolidayDisplay(bool display=True)
275
276 This function should be used instead of changing CAL_SHOW_HOLIDAYS style
277 bit directly. It enables or disables the special highlighting of the holidays.
278 """
279 return _calendar.CalendarCtrl_EnableHolidayDisplay(*args, **kwargs)
280
281 def SetHeaderColours(*args, **kwargs):
282 """
283 SetHeaderColours(Colour colFg, Colour colBg)
284
285 header colours are used for painting the weekdays at the top
286 """
287 return _calendar.CalendarCtrl_SetHeaderColours(*args, **kwargs)
288
289 def GetHeaderColourFg(*args, **kwargs):
290 """
291 GetHeaderColourFg() -> Colour
292
293 header colours are used for painting the weekdays at the top
294 """
295 return _calendar.CalendarCtrl_GetHeaderColourFg(*args, **kwargs)
296
297 def GetHeaderColourBg(*args, **kwargs):
298 """
299 GetHeaderColourBg() -> Colour
300
301 header colours are used for painting the weekdays at the top
302 """
303 return _calendar.CalendarCtrl_GetHeaderColourBg(*args, **kwargs)
304
305 def SetHighlightColours(*args, **kwargs):
306 """
307 SetHighlightColours(Colour colFg, Colour colBg)
308
309 highlight colour is used for the currently selected date
310 """
311 return _calendar.CalendarCtrl_SetHighlightColours(*args, **kwargs)
312
313 def GetHighlightColourFg(*args, **kwargs):
314 """
315 GetHighlightColourFg() -> Colour
316
317 highlight colour is used for the currently selected date
318 """
319 return _calendar.CalendarCtrl_GetHighlightColourFg(*args, **kwargs)
320
321 def GetHighlightColourBg(*args, **kwargs):
322 """
323 GetHighlightColourBg() -> Colour
324
325 highlight colour is used for the currently selected date
326 """
327 return _calendar.CalendarCtrl_GetHighlightColourBg(*args, **kwargs)
328
329 def SetHolidayColours(*args, **kwargs):
330 """
331 SetHolidayColours(Colour colFg, Colour colBg)
332
333 holiday colour is used for the holidays (if CAL_SHOW_HOLIDAYS style is used)
334 """
335 return _calendar.CalendarCtrl_SetHolidayColours(*args, **kwargs)
336
337 def GetHolidayColourFg(*args, **kwargs):
338 """
339 GetHolidayColourFg() -> Colour
340
341 holiday colour is used for the holidays (if CAL_SHOW_HOLIDAYS style is used)
342 """
343 return _calendar.CalendarCtrl_GetHolidayColourFg(*args, **kwargs)
344
345 def GetHolidayColourBg(*args, **kwargs):
346 """
347 GetHolidayColourBg() -> Colour
348
349 holiday colour is used for the holidays (if CAL_SHOW_HOLIDAYS style is used)
350 """
351 return _calendar.CalendarCtrl_GetHolidayColourBg(*args, **kwargs)
352
353 def GetAttr(*args, **kwargs):
354 """
355 GetAttr(size_t day) -> CalendarDateAttr
356
357 Returns the attribute for the given date (should be in the range 1...31).
358 The returned value may be None
359 """
360 return _calendar.CalendarCtrl_GetAttr(*args, **kwargs)
361
362 def SetAttr(*args, **kwargs):
363 """
364 SetAttr(size_t day, CalendarDateAttr attr)
365
366 Associates the attribute with the specified date (in the range 1...31).
367 If the attribute passed is None, the items attribute is cleared.
368 """
369 return _calendar.CalendarCtrl_SetAttr(*args, **kwargs)
370
371 def SetHoliday(*args, **kwargs):
372 """
373 SetHoliday(size_t day)
374
375 Marks the specified day as being a holiday in the current month.
376 """
377 return _calendar.CalendarCtrl_SetHoliday(*args, **kwargs)
378
379 def ResetAttr(*args, **kwargs):
380 """
381 ResetAttr(size_t day)
382
383 Clears any attributes associated with the given day (in the range 1...31).
384 """
385 return _calendar.CalendarCtrl_ResetAttr(*args, **kwargs)
386
387 def HitTest(*args, **kwargs):
388 """
389 HitTest(Point pos) -> (result, date, weekday)
390
391 Returns 3-tuple with information about the given position on the calendar
392 control. The first value of the tuple is a result code and determines the
393 validity of the remaining two values. The result codes are:
394
395 CAL_HITTEST_NOWHERE: hit outside of anything
396 CAL_HITTEST_HEADER: hit on the header, weekday is valid
397 CAL_HITTEST_DAY: hit on a day in the calendar, date is set.
398
399 """
400 return _calendar.CalendarCtrl_HitTest(*args, **kwargs)
401
402 def GetMonthControl(*args, **kwargs):
403 """
404 GetMonthControl() -> Control
405
406 get the currently shown control for month
407 """
408 return _calendar.CalendarCtrl_GetMonthControl(*args, **kwargs)
409
410 def GetYearControl(*args, **kwargs):
411 """
412 GetYearControl() -> Control
413
414 get the currently shown control for year
415 """
416 return _calendar.CalendarCtrl_GetYearControl(*args, **kwargs)
417
418
419 class CalendarCtrlPtr(CalendarCtrl):
420 def __init__(self, this):
421 self.this = this
422 if not hasattr(self,"thisown"): self.thisown = 0
423 self.__class__ = CalendarCtrl
424 _calendar.CalendarCtrl_swigregister(CalendarCtrlPtr)
425 cvar = _calendar.cvar
426 CalendarNameStr = cvar.CalendarNameStr
427
428 def PreCalendarCtrl(*args, **kwargs):
429 """
430 PreCalendarCtrl() -> CalendarCtrl
431
432 Precreate a CalendarCtrl for 2-phase creation.
433 """
434 val = _calendar.new_PreCalendarCtrl(*args, **kwargs)
435 val.thisown = 1
436 return val
437
438