1//---------------------------------------------------------------------------
2// This file is generated by wxPython's SIP generator.  Do not edit by hand.
3//
4// Copyright: (c) 2018 by Total Control Software
5// License:   wxWindows License
6//
7// This file will be included by _adv.sip
8//
9//---------------------------------------------------------------------------
10
11//---------------------------------------------------------------------------
12
13enum
14{
15    wxCAL_SUNDAY_FIRST,
16    wxCAL_MONDAY_FIRST,
17    wxCAL_SHOW_HOLIDAYS,
18    wxCAL_NO_YEAR_CHANGE,
19    wxCAL_NO_MONTH_CHANGE,
20    wxCAL_SEQUENTIAL_MONTH_SELECTION,
21    wxCAL_SHOW_SURROUNDING_WEEKS,
22    wxCAL_SHOW_WEEK_NUMBERS
23};
24
25enum wxCalendarDateBorder
26{
27    wxCAL_BORDER_NONE,
28    wxCAL_BORDER_SQUARE,
29    wxCAL_BORDER_ROUND
30};
31
32enum wxCalendarHitTestResult
33{
34    wxCAL_HITTEST_NOWHERE,
35    wxCAL_HITTEST_HEADER,
36    wxCAL_HITTEST_DAY,
37    wxCAL_HITTEST_INCMONTH,
38    wxCAL_HITTEST_DECMONTH,
39    wxCAL_HITTEST_SURROUNDING_WEEK,
40    wxCAL_HITTEST_WEEK
41};
42
43wxEventType wxEVT_CALENDAR_SEL_CHANGED   /PyName=wxEVT_CALENDAR_SEL_CHANGED/;
44
45wxEventType wxEVT_CALENDAR_PAGE_CHANGED   /PyName=wxEVT_CALENDAR_PAGE_CHANGED/;
46
47wxEventType wxEVT_CALENDAR_DOUBLECLICKED   /PyName=wxEVT_CALENDAR_DOUBLECLICKED/;
48
49wxEventType wxEVT_CALENDAR_WEEKDAY_CLICKED   /PyName=wxEVT_CALENDAR_WEEKDAY_CLICKED/;
50
51wxEventType wxEVT_CALENDAR_WEEK_CLICKED   /PyName=wxEVT_CALENDAR_WEEK_CLICKED/;
52
53wxEventType wxEVT_CALENDAR_YEAR_CHANGED   /PyName=wxEVT_CALENDAR_YEAR_CHANGED/;
54
55wxEventType wxEVT_CALENDAR_MONTH_CHANGED   /PyName=wxEVT_CALENDAR_MONTH_CHANGED/;
56
57wxEventType wxEVT_CALENDAR_DAY_CHANGED   /PyName=wxEVT_CALENDAR_DAY_CHANGED/;
58
59class wxCalendarEvent : wxDateEvent
60{
61    %Docstring
62        CalendarEvent()
63        CalendarEvent(win, dt, type)
64
65        The wxCalendarEvent class is used together with wxCalendarCtrl.
66    %End
67    %TypeHeaderCode
68        #include <wx/calctrl.h>
69    %End
70
71public:
72    wxCalendarEvent();
73
74    wxCalendarEvent(
75        wxWindow * win,
76        const wxDateTime & dt,
77        wxEventType type
78    );
79
80    wxDateTime::WeekDay GetWeekDay() const;
81    %Docstring
82        GetWeekDay() -> DateTime.WeekDay
83
84        Returns the week day on which the user clicked in
85        EVT_CALENDAR_WEEKDAY_CLICKED handler.
86    %End
87
88    void SetWeekDay(
89        const wxDateTime::WeekDay day
90    );
91    %Docstring
92        SetWeekDay(day)
93
94        Sets the week day carried by the event, normally only used by the
95        library internally.
96    %End
97
98    public:
99    virtual wxEvent* Clone() const /Factory/;
100
101
102    private:
103        wxCalendarEvent& operator=(const wxCalendarEvent&);
104
105
106    public:
107
108
109    %Property(name=WeekDay, get=GetWeekDay, set=SetWeekDay)
110};  // end of class wxCalendarEvent
111
112
113class wxCalendarDateAttr
114{
115    %Docstring
116        CalendarDateAttr(colText=wx.NullColour, colBack=wx.NullColour, colBorder=wx.NullColour, font=wx.NullFont, border=CAL_BORDER_NONE)
117        CalendarDateAttr(border, colBorder=wx.NullColour)
118
119        wxCalendarDateAttr is a custom attributes for a calendar date.
120    %End
121    %TypeHeaderCode
122        #include <wx/calctrl.h>
123    %End
124
125public:
126    wxCalendarDateAttr(
127        const wxColour & colText = wxNullColour,
128        const wxColour & colBack = wxNullColour,
129        const wxColour & colBorder = wxNullColour,
130        const wxFont & font = wxNullFont,
131        wxCalendarDateBorder border = wxCAL_BORDER_NONE
132    );
133
134    wxCalendarDateAttr(
135        wxCalendarDateBorder border,
136        const wxColour & colBorder = wxNullColour
137    );
138
139    const wxColour & GetBackgroundColour() const;
140    %Docstring
141        GetBackgroundColour() -> wx.Colour
142
143        Returns the background colour set for the calendar date.
144    %End
145
146    wxCalendarDateBorder GetBorder() const;
147    %Docstring
148        GetBorder() -> CalendarDateBorder
149
150        Returns the border set for the calendar date.
151    %End
152
153    const wxColour & GetBorderColour() const;
154    %Docstring
155        GetBorderColour() -> wx.Colour
156
157        Returns the border colour set for the calendar date.
158    %End
159
160    const wxFont & GetFont() const;
161    %Docstring
162        GetFont() -> wx.Font
163
164        Returns the font set for the calendar date.
165    %End
166
167    const wxColour & GetTextColour() const;
168    %Docstring
169        GetTextColour() -> wx.Colour
170
171        Returns the text colour set for the calendar date.
172    %End
173
174    bool HasBackgroundColour() const;
175    %Docstring
176        HasBackgroundColour() -> bool
177
178        Returns true if a non-default text background colour is set.
179    %End
180
181    bool HasBorder() const;
182    %Docstring
183        HasBorder() -> bool
184
185        Returns true if a non-default (i.e. any) border is set.
186    %End
187
188    bool HasBorderColour() const;
189    %Docstring
190        HasBorderColour() -> bool
191
192        Returns true if a non-default border colour is set.
193    %End
194
195    bool HasFont() const;
196    %Docstring
197        HasFont() -> bool
198
199        Returns true if a non-default font is set.
200    %End
201
202    bool HasTextColour() const;
203    %Docstring
204        HasTextColour() -> bool
205
206        Returns true if a non-default text foreground colour is set.
207    %End
208
209    bool IsHoliday() const;
210    %Docstring
211        IsHoliday() -> bool
212
213        Returns true if this calendar day is displayed as a holiday.
214    %End
215
216    void SetBackgroundColour(
217        const wxColour & colBack
218    );
219    %Docstring
220        SetBackgroundColour(colBack)
221
222        Sets the text background colour to use.
223    %End
224
225    void SetBorder(
226        wxCalendarDateBorder border
227    );
228    %Docstring
229        SetBorder(border)
230
231        Sets the border to use.
232    %End
233
234    void SetBorderColour(
235        const wxColour & col
236    );
237    %Docstring
238        SetBorderColour(col)
239
240        Sets the border colour to use.
241    %End
242
243    void SetFont(
244        const wxFont & font
245    );
246    %Docstring
247        SetFont(font)
248
249        Sets the font to use.
250    %End
251
252    void SetHoliday(
253        bool holiday
254    );
255    %Docstring
256        SetHoliday(holiday)
257
258        If holiday is true, this calendar day will be displayed as a holiday.
259    %End
260
261    void SetTextColour(
262        const wxColour & colText
263    );
264    %Docstring
265        SetTextColour(colText)
266
267        Sets the text (foreground) colour to use.
268    %End
269
270    static
271    const wxCalendarDateAttr & GetMark();
272    %Docstring
273        GetMark() -> CalendarDateAttr
274
275        Used (internally) by the generic wxCalendarCtrl::Mark().
276    %End
277
278    static
279    void SetMark(
280        const wxCalendarDateAttr & m
281    );
282    %Docstring
283        SetMark(m)
284
285        Set the attributes that will be used to Mark() days on the generic
286        wxCalendarCtrl.
287    %End
288
289    public:
290
291
292    %Property(name=BackgroundColour, get=GetBackgroundColour, set=SetBackgroundColour)
293    %Property(name=Border, get=GetBorder, set=SetBorder)
294    %Property(name=BorderColour, get=GetBorderColour, set=SetBorderColour)
295    %Property(name=Font, get=GetFont, set=SetFont)
296    %Property(name=TextColour, get=GetTextColour, set=SetTextColour)
297};  // end of class wxCalendarDateAttr
298
299
300const char* wxCalendarNameStr;
301
302class wxCalendarCtrl : wxControl
303{
304    %Docstring
305        CalendarCtrl()
306        CalendarCtrl(parent, id=wx.ID_ANY, date=wx.DefaultDateTime, pos=wx.DefaultPosition, size=wx.DefaultSize, style=CAL_SHOW_HOLIDAYS, name=CalendarNameStr)
307
308        The calendar control allows the user to pick a date.
309    %End
310    %TypeHeaderCode
311        #include <wx/calctrl.h>
312    %End
313
314public:
315    wxCalendarCtrl();
316    %PreMethodCode
317        if (!wxPyCheckForApp()) return NULL;
318    %End
319
320    wxCalendarCtrl(
321        wxWindow * parent   /TransferThis/,
322        wxWindowID id = wxID_ANY,
323        const wxDateTime & date = wxDefaultDateTime,
324        const wxPoint & pos = wxDefaultPosition,
325        const wxSize & size = wxDefaultSize,
326        long style = wxCAL_SHOW_HOLIDAYS,
327        const wxString & name = wxCalendarNameStr
328    );
329    %PreMethodCode
330        if (!wxPyCheckForApp()) return NULL;
331    %End
332
333    ~wxCalendarCtrl();
334
335    bool SetDateRange(
336        const wxDateTime & lowerdate = wxDefaultDateTime,
337        const wxDateTime & upperdate = wxDefaultDateTime
338    );
339    %Docstring
340        SetDateRange(lowerdate=wx.DefaultDateTime, upperdate=wx.DefaultDateTime) -> bool
341
342        Restrict the dates that can be selected in the control to the
343        specified range.
344    %End
345
346    bool GetDateRange(
347        wxDateTime * lowerdate   /Out/,
348        wxDateTime * upperdate   /Out/
349    ) const;
350    %Docstring
351        GetDateRange() -> (bool, lowerdate, upperdate)
352
353        Returns the limits currently being used.
354    %End
355
356    bool Create(
357        wxWindow * parent   /TransferThis/,
358        wxWindowID id = wxID_ANY,
359        const wxDateTime & date = wxDefaultDateTime,
360        const wxPoint & pos = wxDefaultPosition,
361        const wxSize & size = wxDefaultSize,
362        long style = wxCAL_SHOW_HOLIDAYS,
363        const wxString & name = wxCalendarNameStr
364    );
365    %Docstring
366        Create(parent, id=wx.ID_ANY, date=wx.DefaultDateTime, pos=wx.DefaultPosition, size=wx.DefaultSize, style=CAL_SHOW_HOLIDAYS, name=CalendarNameStr) -> bool
367
368        Creates the control.
369    %End
370
371    void EnableHolidayDisplay(
372        bool display = true
373    );
374    %Docstring
375        EnableHolidayDisplay(display=True)
376
377        This function should be used instead of changing wxCAL_SHOW_HOLIDAYS
378        style bit directly.
379    %End
380
381    bool EnableMonthChange(
382        bool enable = true
383    );
384    %Docstring
385        EnableMonthChange(enable=True) -> bool
386
387        This function should be used instead of changing wxCAL_NO_MONTH_CHANGE
388        style bit.
389    %End
390
391    wxCalendarDateAttr * GetAttr(
392        size_t day
393    ) const;
394    %Docstring
395        GetAttr(day) -> CalendarDateAttr
396
397        Returns the attribute for the given date (should be in the range
398        1...31).
399    %End
400
401    wxDateTime GetDate() const;
402    %Docstring
403        GetDate() -> wx.DateTime
404
405        Gets the currently selected date.
406    %End
407
408    const wxColour & GetHeaderColourBg() const;
409    %Docstring
410        GetHeaderColourBg() -> wx.Colour
411
412        Gets the background colour of the header part of the calendar window.
413    %End
414
415    const wxColour & GetHeaderColourFg() const;
416    %Docstring
417        GetHeaderColourFg() -> wx.Colour
418
419        Gets the foreground colour of the header part of the calendar window.
420    %End
421
422    const wxColour & GetHighlightColourBg() const;
423    %Docstring
424        GetHighlightColourBg() -> wx.Colour
425
426        Gets the background highlight colour.
427    %End
428
429    const wxColour & GetHighlightColourFg() const;
430    %Docstring
431        GetHighlightColourFg() -> wx.Colour
432
433        Gets the foreground highlight colour.
434    %End
435
436    const wxColour & GetHolidayColourBg() const;
437    %Docstring
438        GetHolidayColourBg() -> wx.Colour
439
440        Return the background colour currently used for holiday highlighting.
441    %End
442
443    const wxColour & GetHolidayColourFg() const;
444    %Docstring
445        GetHolidayColourFg() -> wx.Colour
446
447        Return the foreground colour currently used for holiday highlighting.
448    %End
449
450    wxCalendarHitTestResult HitTest(
451        const wxPoint & pos,
452        wxDateTime * date   /Out/ = NULL,
453        wxDateTime::WeekDay * wd   /Out/ = NULL
454    );
455    %Docstring
456        HitTest(pos) -> (CalendarHitTestResult, date, wd)
457
458        Returns one of wxCalendarHitTestResult constants and fills either date
459        or wd pointer with the corresponding value depending on the hit test
460        code.
461    %End
462
463    void ResetAttr(
464        size_t day
465    );
466    %Docstring
467        ResetAttr(day)
468
469        Clears any attributes associated with the given day (in the range
470        1...31).
471    %End
472
473    void SetAttr(
474        size_t day,
475        wxCalendarDateAttr * attr   /Transfer/
476    );
477    %Docstring
478        SetAttr(day, attr)
479
480        Associates the attribute with the specified date (in the range
481        1...31).
482    %End
483
484    bool SetDate(
485        const wxDateTime & date
486    );
487    %Docstring
488        SetDate(date) -> bool
489
490        Sets the current date.
491    %End
492
493    void SetHeaderColours(
494        const wxColour & colFg,
495        const wxColour & colBg
496    );
497    %Docstring
498        SetHeaderColours(colFg, colBg)
499
500        Set the colours used for painting the weekdays at the top of the
501        control.
502    %End
503
504    void SetHighlightColours(
505        const wxColour & colFg,
506        const wxColour & colBg
507    );
508    %Docstring
509        SetHighlightColours(colFg, colBg)
510
511        Set the colours to be used for highlighting the currently selected
512        date.
513    %End
514
515    void SetHoliday(
516        size_t day
517    );
518    %Docstring
519        SetHoliday(day)
520
521        Marks the specified day as being a holiday in the current month.
522    %End
523
524    void SetHolidayColours(
525        const wxColour & colFg,
526        const wxColour & colBg
527    );
528    %Docstring
529        SetHolidayColours(colFg, colBg)
530
531        Sets the colours to be used for the holidays highlighting.
532    %End
533
534    void Mark(
535        size_t day,
536        bool mark
537    );
538    %Docstring
539        Mark(day, mark)
540
541        Mark or unmark the day.
542    %End
543
544    public:
545    virtual wxPoint GetClientAreaOrigin() const;
546    virtual bool Validate();
547    virtual bool TransferDataToWindow();
548    virtual bool TransferDataFromWindow();
549    virtual void InitDialog();
550    virtual bool AcceptsFocus() const;
551    virtual bool AcceptsFocusRecursively() const;
552    virtual bool AcceptsFocusFromKeyboard() const;
553    virtual void AddChild( wxWindowBase *child );
554    virtual void RemoveChild( wxWindowBase *child );
555    virtual void InheritAttributes();
556    virtual bool ShouldInheritColours() const;
557    virtual void OnInternalIdle();
558    virtual wxWindow *GetMainWindowOfCompositeControl();
559    virtual bool InformFirstDirection(int direction, int size, int availableOtherDir);
560    virtual void SetCanFocus(bool canFocus);
561    virtual bool Destroy();
562    virtual void SetValidator( const wxValidator &validator );
563    virtual wxValidator* GetValidator();
564
565
566    protected:
567    virtual bool ProcessEvent(wxEvent & event);
568    virtual void DoEnable(bool enable);
569    virtual void DoGetPosition(int *x, int *y) const;
570    virtual void DoGetSize(int *width, int *height) const;
571    virtual void DoGetClientSize(int *width, int *height) const;
572    virtual wxSize DoGetBestSize() const;
573    virtual wxSize DoGetBestClientSize() const;
574    virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags);
575    virtual void DoSetClientSize(int width, int height);
576    virtual void DoSetSizeHints( int minW, int minH, int maxW, int maxH, int incW, int incH );
577    virtual wxSize DoGetBorderSize() const;
578    virtual void DoMoveWindow(int x, int y, int width, int height);
579    virtual void DoSetWindowVariant( wxWindowVariant variant);
580    virtual wxBorder GetDefaultBorder() const;
581    virtual wxBorder GetDefaultBorderForControl() const;
582    virtual void DoFreeze();
583    virtual void DoThaw();
584    virtual bool HasTransparentBackground();
585    virtual bool TryBefore(wxEvent& event);
586    virtual bool TryAfter(wxEvent& event);
587
588
589    public:
590
591
592    static
593    wxVisualAttributes GetClassDefaultAttributes(
594        wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL
595    );
596    %Docstring
597        GetClassDefaultAttributes(variant=wx.WINDOW_VARIANT_NORMAL) -> wx.VisualAttributes
598    %End
599    %PreMethodCode
600        if (!wxPyCheckForApp()) return NULL;
601    %End
602
603    public:
604
605
606    %Property(name=Date, get=GetDate, set=SetDate)
607    %Property(name=DateRange, get=GetDateRange, set=SetDateRange)
608    %Property(name=HeaderColourBg, get=GetHeaderColourBg)
609    %Property(name=HeaderColourFg, get=GetHeaderColourFg)
610    %Property(name=HighlightColourBg, get=GetHighlightColourBg)
611    %Property(name=HighlightColourFg, get=GetHighlightColourFg)
612    %Property(name=HolidayColourBg, get=GetHolidayColourBg)
613    %Property(name=HolidayColourFg, get=GetHolidayColourFg)
614};  // end of class wxCalendarCtrl
615
616
617%Extract(id=pycode_adv)
618def _CalendarCtrl_PyGetDate(self):
619    """
620    Return the date as a Python datetime.date object.
621    """
622    return wx.wxdate2pydate(self.GetDate())
623CalendarCtrl.PyGetDate = wx.deprecated(_CalendarCtrl_PyGetDate, "Use GetDate instead.")
624del _CalendarCtrl_PyGetDate
625%End
626
627%Extract(id=pycode_adv)
628CalendarCtrl.PySetDate = wx.deprecated(CalendarCtrl.SetDate, 'Use SetDate instead.')
629CalendarCtrl.PySetDateRange = wx.deprecated(CalendarCtrl.SetDateRange, 'Use SetDateRange instead.')
630
631%End
632
633class wxGenericCalendarCtrl : wxControl
634{
635    %Docstring
636        GenericCalendarCtrl()
637        GenericCalendarCtrl(parent, id=wx.ID_ANY, date=wx.DefaultDateTime, pos=wx.DefaultPosition, size=wx.DefaultSize, style=CAL_SHOW_HOLIDAYS, name=CalendarNameStr)
638
639        The calendar control allows the user to pick a date.
640    %End
641    %TypeHeaderCode
642        #include <wx/calctrl.h>
643    %End
644
645    %TypeHeaderCode
646        #include <wx/generic/calctrlg.h>
647    %End
648public:
649    wxGenericCalendarCtrl();
650    %PreMethodCode
651        if (!wxPyCheckForApp()) return NULL;
652    %End
653
654    wxGenericCalendarCtrl(
655        wxWindow * parent   /TransferThis/,
656        wxWindowID id = wxID_ANY,
657        const wxDateTime & date = wxDefaultDateTime,
658        const wxPoint & pos = wxDefaultPosition,
659        const wxSize & size = wxDefaultSize,
660        long style = wxCAL_SHOW_HOLIDAYS,
661        const wxString & name = wxCalendarNameStr
662    );
663    %PreMethodCode
664        if (!wxPyCheckForApp()) return NULL;
665    %End
666
667    ~wxGenericCalendarCtrl();
668
669    bool SetDateRange(
670        const wxDateTime & lowerdate = wxDefaultDateTime,
671        const wxDateTime & upperdate = wxDefaultDateTime
672    );
673    %Docstring
674        SetDateRange(lowerdate=wx.DefaultDateTime, upperdate=wx.DefaultDateTime) -> bool
675
676        Restrict the dates that can be selected in the control to the
677        specified range.
678    %End
679
680    bool GetDateRange(
681        wxDateTime * lowerdate   /Out/,
682        wxDateTime * upperdate   /Out/
683    ) const;
684    %Docstring
685        GetDateRange() -> (bool, lowerdate, upperdate)
686
687        Returns the limits currently being used.
688    %End
689
690    bool Create(
691        wxWindow * parent   /TransferThis/,
692        wxWindowID id = wxID_ANY,
693        const wxDateTime & date = wxDefaultDateTime,
694        const wxPoint & pos = wxDefaultPosition,
695        const wxSize & size = wxDefaultSize,
696        long style = wxCAL_SHOW_HOLIDAYS,
697        const wxString & name = wxCalendarNameStr
698    );
699    %Docstring
700        Create(parent, id=wx.ID_ANY, date=wx.DefaultDateTime, pos=wx.DefaultPosition, size=wx.DefaultSize, style=CAL_SHOW_HOLIDAYS, name=CalendarNameStr) -> bool
701
702        Creates the control.
703    %End
704
705    void EnableHolidayDisplay(
706        bool display = true
707    );
708    %Docstring
709        EnableHolidayDisplay(display=True)
710
711        This function should be used instead of changing wxCAL_SHOW_HOLIDAYS
712        style bit directly.
713    %End
714
715    bool EnableMonthChange(
716        bool enable = true
717    );
718    %Docstring
719        EnableMonthChange(enable=True) -> bool
720
721        This function should be used instead of changing wxCAL_NO_MONTH_CHANGE
722        style bit.
723    %End
724
725    void EnableYearChange(
726        bool enable = true
727    )   /Deprecated/;
728    %Docstring
729        EnableYearChange(enable=True)
730    %End
731
732    wxCalendarDateAttr * GetAttr(
733        size_t day
734    ) const;
735    %Docstring
736        GetAttr(day) -> CalendarDateAttr
737
738        Returns the attribute for the given date (should be in the range
739        1...31).
740    %End
741
742    wxDateTime GetDate() const;
743    %Docstring
744        GetDate() -> wx.DateTime
745
746        Gets the currently selected date.
747    %End
748
749    const wxColour & GetHeaderColourBg() const;
750    %Docstring
751        GetHeaderColourBg() -> wx.Colour
752
753        Gets the background colour of the header part of the calendar window.
754    %End
755
756    const wxColour & GetHeaderColourFg() const;
757    %Docstring
758        GetHeaderColourFg() -> wx.Colour
759
760        Gets the foreground colour of the header part of the calendar window.
761    %End
762
763    const wxColour & GetHighlightColourBg() const;
764    %Docstring
765        GetHighlightColourBg() -> wx.Colour
766
767        Gets the background highlight colour.
768    %End
769
770    const wxColour & GetHighlightColourFg() const;
771    %Docstring
772        GetHighlightColourFg() -> wx.Colour
773
774        Gets the foreground highlight colour.
775    %End
776
777    const wxColour & GetHolidayColourBg() const;
778    %Docstring
779        GetHolidayColourBg() -> wx.Colour
780
781        Return the background colour currently used for holiday highlighting.
782    %End
783
784    const wxColour & GetHolidayColourFg() const;
785    %Docstring
786        GetHolidayColourFg() -> wx.Colour
787
788        Return the foreground colour currently used for holiday highlighting.
789    %End
790
791    wxCalendarHitTestResult HitTest(
792        const wxPoint & pos,
793        wxDateTime * date   /Out/ = NULL,
794        wxDateTime::WeekDay * wd   /Out/ = NULL
795    );
796    %Docstring
797        HitTest(pos) -> (CalendarHitTestResult, date, wd)
798
799        Returns one of wxCalendarHitTestResult constants and fills either date
800        or wd pointer with the corresponding value depending on the hit test
801        code.
802    %End
803
804    void ResetAttr(
805        size_t day
806    );
807    %Docstring
808        ResetAttr(day)
809
810        Clears any attributes associated with the given day (in the range
811        1...31).
812    %End
813
814    void SetAttr(
815        size_t day,
816        wxCalendarDateAttr * attr   /Transfer/
817    );
818    %Docstring
819        SetAttr(day, attr)
820
821        Associates the attribute with the specified date (in the range
822        1...31).
823    %End
824
825    bool SetDate(
826        const wxDateTime & date
827    );
828    %Docstring
829        SetDate(date) -> bool
830
831        Sets the current date.
832    %End
833
834    void SetHeaderColours(
835        const wxColour & colFg,
836        const wxColour & colBg
837    );
838    %Docstring
839        SetHeaderColours(colFg, colBg)
840
841        Set the colours used for painting the weekdays at the top of the
842        control.
843    %End
844
845    void SetHighlightColours(
846        const wxColour & colFg,
847        const wxColour & colBg
848    );
849    %Docstring
850        SetHighlightColours(colFg, colBg)
851
852        Set the colours to be used for highlighting the currently selected
853        date.
854    %End
855
856    void SetHoliday(
857        size_t day
858    );
859    %Docstring
860        SetHoliday(day)
861
862        Marks the specified day as being a holiday in the current month.
863    %End
864
865    void SetHolidayColours(
866        const wxColour & colFg,
867        const wxColour & colBg
868    );
869    %Docstring
870        SetHolidayColours(colFg, colBg)
871
872        Sets the colours to be used for the holidays highlighting.
873    %End
874
875    void Mark(
876        size_t day,
877        bool mark
878    );
879    %Docstring
880        Mark(day, mark)
881
882        Mark or unmark the day.
883    %End
884
885    public:
886    virtual wxPoint GetClientAreaOrigin() const;
887    virtual bool Validate();
888    virtual bool TransferDataToWindow();
889    virtual bool TransferDataFromWindow();
890    virtual void InitDialog();
891    virtual bool AcceptsFocus() const;
892    virtual bool AcceptsFocusRecursively() const;
893    virtual bool AcceptsFocusFromKeyboard() const;
894    virtual void AddChild( wxWindowBase *child );
895    virtual void RemoveChild( wxWindowBase *child );
896    virtual void InheritAttributes();
897    virtual bool ShouldInheritColours() const;
898    virtual void OnInternalIdle();
899    virtual wxWindow *GetMainWindowOfCompositeControl();
900    virtual bool InformFirstDirection(int direction, int size, int availableOtherDir);
901    virtual void SetCanFocus(bool canFocus);
902    virtual bool Destroy();
903    virtual void SetValidator( const wxValidator &validator );
904    virtual wxValidator* GetValidator();
905
906
907    protected:
908    virtual bool ProcessEvent(wxEvent & event);
909    virtual void DoEnable(bool enable);
910    virtual void DoGetPosition(int *x, int *y) const;
911    virtual void DoGetSize(int *width, int *height) const;
912    virtual void DoGetClientSize(int *width, int *height) const;
913    virtual wxSize DoGetBestSize() const;
914    virtual wxSize DoGetBestClientSize() const;
915    virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags);
916    virtual void DoSetClientSize(int width, int height);
917    virtual void DoSetSizeHints( int minW, int minH, int maxW, int maxH, int incW, int incH );
918    virtual wxSize DoGetBorderSize() const;
919    virtual void DoMoveWindow(int x, int y, int width, int height);
920    virtual void DoSetWindowVariant( wxWindowVariant variant);
921    virtual wxBorder GetDefaultBorder() const;
922    virtual wxBorder GetDefaultBorderForControl() const;
923    virtual void DoFreeze();
924    virtual void DoThaw();
925    virtual bool HasTransparentBackground();
926    virtual bool TryBefore(wxEvent& event);
927    virtual bool TryAfter(wxEvent& event);
928
929
930    public:
931
932
933    static
934    wxVisualAttributes GetClassDefaultAttributes(
935        wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL
936    );
937    %Docstring
938        GetClassDefaultAttributes(variant=wx.WINDOW_VARIANT_NORMAL) -> wx.VisualAttributes
939    %End
940    %PreMethodCode
941        if (!wxPyCheckForApp()) return NULL;
942    %End
943
944    public:
945
946
947    %Property(name=Date, get=GetDate, set=SetDate)
948    %Property(name=DateRange, get=GetDateRange, set=SetDateRange)
949    %Property(name=HeaderColourBg, get=GetHeaderColourBg)
950    %Property(name=HeaderColourFg, get=GetHeaderColourFg)
951    %Property(name=HighlightColourBg, get=GetHighlightColourBg)
952    %Property(name=HighlightColourFg, get=GetHighlightColourFg)
953    %Property(name=HolidayColourBg, get=GetHolidayColourBg)
954    %Property(name=HolidayColourFg, get=GetHolidayColourFg)
955};  // end of class wxGenericCalendarCtrl
956
957
958%Extract(id=pycode_adv)
959def _GenericCalendarCtrl_PyGetDate(self):
960    """
961    Return the date as a Python datetime.date object.
962    """
963    return wx.wxdate2pydate(self.GetDate())
964GenericCalendarCtrl.PyGetDate = wx.deprecated(_GenericCalendarCtrl_PyGetDate, "Use GetDate instead.")
965del _GenericCalendarCtrl_PyGetDate
966%End
967
968%Extract(id=pycode_adv)
969GenericCalendarCtrl.PySetDate = wx.deprecated(GenericCalendarCtrl.SetDate, 'Use SetDate instead.')
970GenericCalendarCtrl.PySetDateRange = wx.deprecated(GenericCalendarCtrl.SetDateRange, 'Use SetDateRange instead.')
971
972%End
973
974%Extract(id=pycode_adv)
975EVT_CALENDAR =                 wx.PyEventBinder( wxEVT_CALENDAR_DOUBLECLICKED, 1)
976EVT_CALENDAR_SEL_CHANGED =     wx.PyEventBinder( wxEVT_CALENDAR_SEL_CHANGED, 1)
977EVT_CALENDAR_WEEKDAY_CLICKED = wx.PyEventBinder( wxEVT_CALENDAR_WEEKDAY_CLICKED, 1)
978EVT_CALENDAR_PAGE_CHANGED =    wx.PyEventBinder( wxEVT_CALENDAR_PAGE_CHANGED, 1)
979EVT_CALENDAR_WEEK_CLICKED =    wx.PyEventBinder( wxEVT_CALENDAR_WEEK_CLICKED, 1)
980
981%End
982
983%Extract(id=pycode_adv)
984# These are deprecated, will be removed later...
985EVT_CALENDAR_DAY =             wx.PyEventBinder( wxEVT_CALENDAR_DAY_CHANGED, 1)
986EVT_CALENDAR_MONTH =           wx.PyEventBinder( wxEVT_CALENDAR_MONTH_CHANGED, 1)
987EVT_CALENDAR_YEAR =            wx.PyEventBinder( wxEVT_CALENDAR_YEAR_CHANGED, 1)
988
989%End
990
991
992//---------------------------------------------------------------------------
993
994