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 _core.sip
8//
9//---------------------------------------------------------------------------
10
11//---------------------------------------------------------------------------
12
13typedef wxWindow::ChildrenRepositioningGuard ChildrenRepositioningGuard;
14
15enum wxShowEffect
16{
17    wxSHOW_EFFECT_NONE,
18    wxSHOW_EFFECT_ROLL_TO_LEFT,
19    wxSHOW_EFFECT_ROLL_TO_RIGHT,
20    wxSHOW_EFFECT_ROLL_TO_TOP,
21    wxSHOW_EFFECT_ROLL_TO_BOTTOM,
22    wxSHOW_EFFECT_SLIDE_TO_LEFT,
23    wxSHOW_EFFECT_SLIDE_TO_RIGHT,
24    wxSHOW_EFFECT_SLIDE_TO_TOP,
25    wxSHOW_EFFECT_SLIDE_TO_BOTTOM,
26    wxSHOW_EFFECT_BLEND,
27    wxSHOW_EFFECT_EXPAND,
28    wxSHOW_EFFECT_MAX
29};
30
31enum
32{
33    wxSEND_EVENT_POST
34};
35
36enum wxWindowVariant
37{
38    wxWINDOW_VARIANT_NORMAL,
39    wxWINDOW_VARIANT_SMALL,
40    wxWINDOW_VARIANT_MINI,
41    wxWINDOW_VARIANT_LARGE,
42    wxWINDOW_VARIANT_MAX
43};
44
45struct wxVisualAttributes
46{
47    %Docstring
48        Struct containing all the visual attributes of a control.
49    %End
50    %TypeHeaderCode
51        #include <wx/window.h>
52    %End
53
54    wxFont font   /NoSetter/
55    {
56    %GetCode
57        wxFont* font = new wxFont(sipCpp->font);
58        sipPy = wxPyConstructObject((void*)font, "wxFont", true);
59    %End
60    };
61
62    wxColour colFg   /NoSetter/
63    {
64    %GetCode
65        wxColour* clr = new wxColour(sipCpp->colFg);
66        sipPy = wxPyConstructObject((void*)clr, "wxColour", true);
67    %End
68    };
69
70    wxColour colBg   /NoSetter/
71    {
72    %GetCode
73        wxColour* clr = new wxColour(sipCpp->colBg);
74        sipPy = wxPyConstructObject((void*)clr, "wxColour", true);
75    %End
76    };
77
78};  // end of class wxVisualAttributes
79
80
81const char* wxPanelNameStr;
82
83class wxWindowBase : wxEvtHandler   /Abstract/
84{
85    %Docstring
86
87    %End
88public:
89    virtual
90    void AddChild(
91        wxWindowBase* child
92    );
93    %Docstring
94        AddChild(child)
95    %End
96
97    virtual
98    void RemoveChild(
99        wxWindowBase* child
100    );
101    %Docstring
102        RemoveChild(child)
103    %End
104
105};  // end of class wxWindowBase
106
107
108class wxWindow : wxWindowBase
109{
110    %Docstring
111        Window()
112        Window(parent, id=ID_ANY, pos=DefaultPosition, size=DefaultSize, style=0, name=PanelNameStr)
113
114        wxWindow is the base class for all windows and represents any visible
115        object on screen.
116    %End
117    %TypeHeaderCode
118        #include <wx/window.h>
119    %End
120
121    %TypeCode
122
123        #ifdef __WXMSW__
124        #include <wx/msw/private.h>
125        #endif
126
127        #ifdef __WXGTK__
128        #include <gdk/gdkx.h>
129        #include <gtk/gtk.h>
130        #ifdef __WXGTK3__
131        // Unlike GDK_WINDOW_XWINDOW, GDK_WINDOW_XID can't handle a NULL, so check 1st
132        static XID GetXWindow(const wxWindow* wxwin) {
133            if ((wxwin)->m_wxwindow) {
134                if (gtk_widget_get_window((wxwin)->m_wxwindow))
135                    return GDK_WINDOW_XID(gtk_widget_get_window((wxwin)->m_wxwindow));
136                return 0;
137            }
138            else {
139                if (gtk_widget_get_window((wxwin)->m_widget))
140                    return GDK_WINDOW_XID(gtk_widget_get_window((wxwin)->m_widget));
141                return 0;
142            }
143        }
144        #else
145        #define GetXWindow(wxwin) (wxwin)->m_wxwindow ? \
146                                  GDK_WINDOW_XWINDOW((wxwin)->m_wxwindow->window) : \
147                                  GDK_WINDOW_XWINDOW((wxwin)->m_widget->window)
148        #endif
149        #endif
150
151
152
153
154
155        wxUIntPtr wxPyGetWinHandle(const wxWindow* win)
156        {
157        #ifdef __WXMSW__
158            return (wxUIntPtr)win->GetHandle();
159        #endif
160        #if defined(__WXGTK__) || defined(__WXX11__)
161            return (wxUIntPtr)GetXWindow(win);
162        #endif
163        #ifdef __WXMAC__
164            return (wxUIntPtr)win->GetHandle();
165        #endif
166            return 0;
167        }
168    %End
169public:
170public:
171    class ChildrenRepositioningGuard
172    {
173        %Docstring
174            ChildrenRepositioningGuard(win)
175
176            Helper for ensuring EndRepositioningChildren() is called correctly.
177        %End
178        %TypeHeaderCode
179            #include <wx/window.h>
180        %End
181
182    public:
183        ChildrenRepositioningGuard(
184            wxWindow * win
185        );
186
187        ~ChildrenRepositioningGuard();
188
189        private:
190            ChildrenRepositioningGuard(const ChildrenRepositioningGuard&);
191
192
193    };  // end of class ChildrenRepositioningGuard
194
195
196    wxWindow();
197    %PreMethodCode
198        if (!wxPyCheckForApp()) return NULL;
199    %End
200
201    wxWindow(
202        wxWindow * parent   /TransferThis/,
203        wxWindowID id = wxID_ANY,
204        const wxPoint & pos = wxDefaultPosition,
205        const wxSize & size = wxDefaultSize,
206        long style = 0,
207        const wxString & name = wxPanelNameStr
208    );
209    %PreMethodCode
210        if (!wxPyCheckForApp()) return NULL;
211    %End
212
213    ~wxWindow();
214
215    virtual
216    bool AcceptsFocus() const;
217    %Docstring
218        AcceptsFocus() -> bool
219
220        This method may be overridden in the derived classes to return false
221        to indicate that this control doesn't accept input at all (i.e.
222        behaves like e.g. wxStaticText) and so doesn't need focus.
223    %End
224
225    virtual
226    bool AcceptsFocusFromKeyboard() const;
227    %Docstring
228        AcceptsFocusFromKeyboard() -> bool
229
230        This method may be overridden in the derived classes to return false
231        to indicate that while this control can, in principle, have focus if
232        the user clicks it with the mouse, it shouldn't be included in the TAB
233        traversal chain when using the keyboard.
234    %End
235
236    virtual
237    bool AcceptsFocusRecursively() const;
238    %Docstring
239        AcceptsFocusRecursively() -> bool
240
241        Overridden to indicate whether this window or one of its children
242        accepts focus.
243    %End
244
245    bool IsFocusable() const;
246    %Docstring
247        IsFocusable() -> bool
248
249        Can this window itself have focus?
250    %End
251
252    bool CanAcceptFocus() const;
253    %Docstring
254        CanAcceptFocus() -> bool
255
256        Can this window have focus right now?
257    %End
258
259    bool CanAcceptFocusFromKeyboard() const;
260    %Docstring
261        CanAcceptFocusFromKeyboard() -> bool
262
263        Can this window be assigned focus from keyboard right now?
264    %End
265
266    bool HasFocus() const;
267    %Docstring
268        HasFocus() -> bool
269
270        Returns true if the window (or in case of composite controls, its main
271        child window) has focus.
272    %End
273
274    virtual
275    void SetCanFocus(
276        bool canFocus
277    );
278    %Docstring
279        SetCanFocus(canFocus)
280
281        This method is only implemented by ports which have support for native
282        TAB traversal (such as GTK+ 2.0).
283    %End
284
285    void SetFocus();
286    %Docstring
287        SetFocus()
288
289        This sets the window to receive keyboard input.
290    %End
291
292    void SetFocusFromKbd();
293    %Docstring
294        SetFocusFromKbd()
295
296        This function is called by wxWidgets keyboard navigation code when the
297        user gives the focus to this window from keyboard (e.g.
298    %End
299
300    virtual
301    void AddChild(
302        wxWindowBase* child
303    );
304    %Docstring
305        AddChild(child)
306
307        Adds a child window.
308    %End
309
310    bool DestroyChildren();
311    %Docstring
312        DestroyChildren() -> bool
313
314        Destroys all children of a window.
315    %End
316
317    wxWindow * FindWindow(
318        long id
319    ) const;
320    %Docstring
321        FindWindow(id) -> Window
322        FindWindow(name) -> Window
323
324        Find a child of this window, by id.
325    %End
326
327    wxWindow * FindWindow(
328        const wxString & name
329    ) const;
330
331    wxWindowList & GetChildren()   /NoCopy/;
332    %Docstring
333        GetChildren() -> WindowList
334
335        Returns a reference to the list of the window's children.
336    %End
337
338    virtual
339    void RemoveChild(
340        wxWindowBase* child
341    );
342    %Docstring
343        RemoveChild(child)
344
345        Removes a child window.
346    %End
347
348    wxWindow * GetGrandParent() const;
349    %Docstring
350        GetGrandParent() -> Window
351
352        Returns the grandparent of a window, or NULL if there isn't one.
353    %End
354
355    wxWindow * GetNextSibling() const;
356    %Docstring
357        GetNextSibling() -> Window
358
359        Returns the next window after this one among the parent's children or
360        NULL if this window is the last child.
361    %End
362
363    wxWindow * GetParent() const;
364    %Docstring
365        GetParent() -> Window
366
367        Returns the parent of the window, or NULL if there is no parent.
368    %End
369
370    wxWindow * GetPrevSibling() const;
371    %Docstring
372        GetPrevSibling() -> Window
373
374        Returns the previous window before this one among the parent's
375        children or  NULL if this window is the first child.
376    %End
377
378    bool IsDescendant(
379        wxWindowBase * win
380    ) const;
381    %Docstring
382        IsDescendant(win) -> bool
383
384        Check if the specified window is a descendant of this one.
385    %End
386
387    bool Reparent(
388        wxWindow * newParent
389    );
390    %Docstring
391        Reparent(newParent) -> bool
392
393        Reparents the window, i.e. the window will be removed from its current
394        parent window (e.g.
395    %End
396
397    void AlwaysShowScrollbars(
398        bool hflag = true,
399        bool vflag = true
400    );
401    %Docstring
402        AlwaysShowScrollbars(hflag=True, vflag=True)
403
404        Call this function to force one or both scrollbars to be always shown,
405        even if the window is big enough to show its entire contents without
406        scrolling.
407    %End
408
409    int GetScrollPos(
410        int orientation
411    ) const;
412    %Docstring
413        GetScrollPos(orientation) -> int
414
415        Returns the built-in scrollbar position.
416    %End
417
418    int GetScrollRange(
419        int orientation
420    ) const;
421    %Docstring
422        GetScrollRange(orientation) -> int
423
424        Returns the built-in scrollbar range.
425    %End
426
427    int GetScrollThumb(
428        int orientation
429    ) const;
430    %Docstring
431        GetScrollThumb(orientation) -> int
432
433        Returns the built-in scrollbar thumb size.
434    %End
435
436    bool CanScroll(
437        int orient
438    ) const;
439    %Docstring
440        CanScroll(orient) -> bool
441
442        Returns true if this window can have a scroll bar in this orientation.
443    %End
444
445    bool HasScrollbar(
446        int orient
447    ) const;
448    %Docstring
449        HasScrollbar(orient) -> bool
450
451        Returns true if this window currently has a scroll bar for this
452        orientation.
453    %End
454
455    bool IsScrollbarAlwaysShown(
456        int orient
457    ) const;
458    %Docstring
459        IsScrollbarAlwaysShown(orient) -> bool
460
461        Return whether a scrollbar is always shown.
462    %End
463
464    bool ScrollLines(
465        int lines
466    );
467    %Docstring
468        ScrollLines(lines) -> bool
469
470        Scrolls the window by the given number of lines down (if lines is
471        positive) or up.
472    %End
473
474    bool ScrollPages(
475        int pages
476    );
477    %Docstring
478        ScrollPages(pages) -> bool
479
480        Scrolls the window by the given number of pages down (if pages is
481        positive) or up.
482    %End
483
484    void ScrollWindow(
485        int dx,
486        int dy,
487        const wxRect * rect = NULL
488    );
489    %Docstring
490        ScrollWindow(dx, dy, rect=None)
491
492        Physically scrolls the pixels in the window and move child windows
493        accordingly.
494    %End
495
496    bool LineUp();
497    %Docstring
498        LineUp() -> bool
499
500        Same as ScrollLines (-1).
501    %End
502
503    bool LineDown();
504    %Docstring
505        LineDown() -> bool
506
507        Same as ScrollLines (1).
508    %End
509
510    bool PageUp();
511    %Docstring
512        PageUp() -> bool
513
514        Same as ScrollPages (-1).
515    %End
516
517    bool PageDown();
518    %Docstring
519        PageDown() -> bool
520
521        Same as ScrollPages (1).
522    %End
523
524    void SetScrollPos(
525        int orientation,
526        int pos,
527        bool refresh = true
528    );
529    %Docstring
530        SetScrollPos(orientation, pos, refresh=True)
531
532        Sets the position of one of the built-in scrollbars.
533    %End
534
535    void SetScrollbar(
536        int orientation,
537        int position,
538        int thumbSize,
539        int range,
540        bool refresh = true
541    );
542    %Docstring
543        SetScrollbar(orientation, position, thumbSize, range, refresh=True)
544
545        Sets the scrollbar properties of a built-in scrollbar.
546    %End
547
548    bool BeginRepositioningChildren();
549    %Docstring
550        BeginRepositioningChildren() -> bool
551
552        Prepare for changing positions of multiple child windows.
553    %End
554
555    void EndRepositioningChildren();
556    %Docstring
557        EndRepositioningChildren()
558
559        Fix child window positions after setting all of them at once.
560    %End
561
562    void CacheBestSize(
563        const wxSize & size
564    ) const;
565    %Docstring
566        CacheBestSize(size)
567
568        Sets the cached best size value.
569    %End
570
571    wxSize ClientToWindowSize(
572        const wxSize & size
573    ) const;
574    %Docstring
575        ClientToWindowSize(size) -> Size
576
577        Converts client area size size to corresponding window size.
578    %End
579
580    wxSize WindowToClientSize(
581        const wxSize & size
582    ) const;
583    %Docstring
584        WindowToClientSize(size) -> Size
585
586        Converts window size size to corresponding client area size In other
587        words, the returned value is what would GetClientSize() return if this
588        window had given window size.
589    %End
590
591    void Fit();
592    %Docstring
593        Fit()
594
595        Sizes the window so that it fits around its subwindows.
596    %End
597
598    void FitInside();
599    %Docstring
600        FitInside()
601
602        Similar to Fit(), but sizes the interior (virtual) size of a window.
603    %End
604
605    wxSize GetBestSize() const;
606    %Docstring
607        GetBestSize() -> Size
608
609        This functions returns the best acceptable minimal size for the
610        window.
611    %End
612
613    int GetBestHeight(
614        int width
615    ) const;
616    %Docstring
617        GetBestHeight(width) -> int
618
619        Returns the best height needed by this window if it had the given
620        width.
621    %End
622
623    int GetBestWidth(
624        int height
625    ) const;
626    %Docstring
627        GetBestWidth(height) -> int
628
629        Returns the best width needed by this window if it had the given
630        height.
631    %End
632
633    wxSize GetClientSize() const;
634    %Docstring
635        GetClientSize() -> Size
636
637        Returns the size of the window 'client area' in pixels.
638    %End
639
640    wxSize GetEffectiveMinSize() const;
641    %Docstring
642        GetEffectiveMinSize() -> Size
643
644        Merges the window's best size into the min size and returns the
645        result.
646    %End
647
648    wxSize GetMaxClientSize() const;
649    %Docstring
650        GetMaxClientSize() -> Size
651
652        Returns the maximum size of window's client area.
653    %End
654
655    wxSize GetMaxSize() const;
656    %Docstring
657        GetMaxSize() -> Size
658
659        Returns the maximum size of the window.
660    %End
661
662    wxSize GetMinClientSize() const;
663    %Docstring
664        GetMinClientSize() -> Size
665
666        Returns the minimum size of window's client area, an indication to the
667        sizer layout mechanism that this is the minimum required size of its
668        client area.
669    %End
670
671    wxSize GetMinSize() const;
672    %Docstring
673        GetMinSize() -> Size
674
675        Returns the minimum size of the window, an indication to the sizer
676        layout mechanism that this is the minimum required size.
677    %End
678
679    int GetMinWidth() const;
680    %Docstring
681        GetMinWidth() -> int
682
683        Returns the horizontal component of window minimal size.
684    %End
685
686    int GetMinHeight() const;
687    %Docstring
688        GetMinHeight() -> int
689
690        Returns the vertical component of window minimal size.
691    %End
692
693    int GetMaxWidth() const;
694    %Docstring
695        GetMaxWidth() -> int
696
697        Returns the horizontal component of window maximal size.
698    %End
699
700    int GetMaxHeight() const;
701    %Docstring
702        GetMaxHeight() -> int
703
704        Returns the vertical component of window maximal size.
705    %End
706
707    wxSize GetSize() const;
708    %Docstring
709        GetSize() -> Size
710
711        Returns the size of the entire window in pixels, including title bar,
712        border, scrollbars, etc.
713    %End
714
715    wxSize GetVirtualSize() const;
716    %Docstring
717        GetVirtualSize() -> Size
718
719        This gets the virtual size of the window in pixels.
720    %End
721
722    wxSize GetBestVirtualSize() const;
723    %Docstring
724        GetBestVirtualSize() -> Size
725
726        Return the largest of ClientSize and BestSize (as determined by a
727        sizer, interior children, or other means)
728    %End
729
730    double GetContentScaleFactor() const;
731    %Docstring
732        GetContentScaleFactor() -> double
733
734        Returns the magnification of the backing store of this window, eg 2.0
735        for a window on a retina screen.
736    %End
737
738    wxSize GetWindowBorderSize() const;
739    %Docstring
740        GetWindowBorderSize() -> Size
741
742        Returns the size of the left/right and top/bottom borders of this
743        window in x and y components of the result respectively.
744    %End
745
746    virtual
747    bool InformFirstDirection(
748        int direction,
749        int size,
750        int availableOtherDir
751    );
752    %Docstring
753        InformFirstDirection(direction, size, availableOtherDir) -> bool
754
755        wxSizer and friends use this to give a chance to a component to recalc
756        its min size once one of the final size components is known.
757    %End
758
759    void InvalidateBestSize();
760    %Docstring
761        InvalidateBestSize()
762
763        Resets the cached best size value so it will be recalculated the next
764        time it is needed.
765    %End
766
767    void PostSizeEvent();
768    %Docstring
769        PostSizeEvent()
770
771        Posts a size event to the window.
772    %End
773
774    void PostSizeEventToParent();
775    %Docstring
776        PostSizeEventToParent()
777
778        Posts a size event to the parent of this window.
779    %End
780
781    void SendSizeEvent(
782        int flags = 0
783    );
784    %Docstring
785        SendSizeEvent(flags=0)
786
787        This function sends a dummy size event to the window allowing it to
788        re-layout its children positions.
789    %End
790
791    void SendSizeEventToParent(
792        int flags = 0
793    );
794    %Docstring
795        SendSizeEventToParent(flags=0)
796
797        Safe wrapper for GetParent()->SendSizeEvent().
798    %End
799
800    void SetClientSize(
801        int width,
802        int height
803    );
804    %Docstring
805        SetClientSize(width, height)
806        SetClientSize(size)
807        SetClientSize(rect)
808
809        This sets the size of the window client area in pixels.
810    %End
811
812    void SetClientSize(
813        const wxSize & size
814    );
815
816    void SetClientSize(
817        const wxRect & rect
818    );
819
820    void SetContainingSizer(
821        wxSizer * sizer
822    );
823    %Docstring
824        SetContainingSizer(sizer)
825
826        This normally does not need to be called by user code.
827    %End
828
829    void SetInitialSize(
830        const wxSize & size = wxDefaultSize
831    );
832    %Docstring
833        SetInitialSize(size=DefaultSize)
834
835        A smart SetSize that will fill in default size components with the
836        window's best size values.
837    %End
838
839    void SetMaxClientSize(
840        const wxSize & size
841    );
842    %Docstring
843        SetMaxClientSize(size)
844
845        Sets the maximum client size of the window, to indicate to the sizer
846        layout mechanism that this is the maximum possible size of its client
847        area.
848    %End
849
850    void SetMaxSize(
851        const wxSize & size
852    );
853    %Docstring
854        SetMaxSize(size)
855
856        Sets the maximum size of the window, to indicate to the sizer layout
857        mechanism that this is the maximum possible size.
858    %End
859
860    void SetMinClientSize(
861        const wxSize & size
862    );
863    %Docstring
864        SetMinClientSize(size)
865
866        Sets the minimum client size of the window, to indicate to the sizer
867        layout mechanism that this is the minimum required size of window's
868        client area.
869    %End
870
871    void SetMinSize(
872        const wxSize & size
873    );
874    %Docstring
875        SetMinSize(size)
876
877        Sets the minimum size of the window, to indicate to the sizer layout
878        mechanism that this is the minimum required size.
879    %End
880
881    void SetSize(
882        int x,
883        int y,
884        int width,
885        int height,
886        int sizeFlags = wxSIZE_AUTO
887    );
888    %Docstring
889        SetSize(x, y, width, height, sizeFlags=SIZE_AUTO)
890        SetSize(rect)
891        SetSize(size)
892        SetSize(width, height)
893
894        Sets the size of the window in pixels.
895    %End
896
897    void SetSize(
898        const wxRect & rect
899    );
900
901    void SetSize(
902        const wxSize & size
903    );
904
905    void SetSize(
906        int width,
907        int height
908    );
909
910    void SetSizeHints(
911        const wxSize & minSize,
912        const wxSize & maxSize = wxDefaultSize,
913        const wxSize & incSize = wxDefaultSize
914    );
915    %Docstring
916        SetSizeHints(minSize, maxSize=DefaultSize, incSize=DefaultSize)
917        SetSizeHints(minW, minH, maxW=-1, maxH=-1, incW=-1, incH=-1)
918
919        Use of this function for windows which are not toplevel windows (such
920        as wxDialog or wxFrame) is discouraged.
921    %End
922
923    void SetSizeHints(
924        int minW,
925        int minH,
926        int maxW = -1,
927        int maxH = -1,
928        int incW = -1,
929        int incH = -1
930    );
931
932    void SetVirtualSize(
933        int width,
934        int height
935    );
936    %Docstring
937        SetVirtualSize(width, height)
938        SetVirtualSize(size)
939
940        Sets the virtual size of the window in pixels.
941    %End
942
943    void SetVirtualSize(
944        const wxSize & size
945    );
946
947    void Center(
948        int dir = wxBOTH
949    );
950    %Docstring
951        Center(dir=BOTH)
952
953        A synonym for Centre().
954    %End
955
956    void CenterOnParent(
957        int dir = wxBOTH
958    );
959    %Docstring
960        CenterOnParent(dir=BOTH)
961
962        A synonym for CentreOnParent().
963    %End
964
965    void Centre(
966        int direction = wxBOTH
967    );
968    %Docstring
969        Centre(direction=BOTH)
970
971        Centres the window.
972    %End
973
974    void CentreOnParent(
975        int direction = wxBOTH
976    );
977    %Docstring
978        CentreOnParent(direction=BOTH)
979
980        Centres the window on its parent.
981    %End
982
983    wxPoint GetPosition() const;
984    %Docstring
985        GetPosition() -> Point
986
987        This gets the position of the window in pixels, relative to the parent
988        window for the child windows or relative to the display origin for the
989        top level windows.
990    %End
991
992    wxRect GetRect() const;
993    %Docstring
994        GetRect() -> Rect
995
996        Returns the position and size of the window as a wxRect object.
997    %End
998
999    wxPoint GetScreenPosition() const;
1000    %Docstring
1001        GetScreenPosition() -> Point
1002
1003        Returns the window position in screen coordinates, whether the window
1004        is a child window or a top level one.
1005    %End
1006
1007    wxRect GetScreenRect() const;
1008    %Docstring
1009        GetScreenRect() -> Rect
1010
1011        Returns the position and size of the window on the screen as a wxRect
1012        object.
1013    %End
1014
1015    virtual
1016    wxPoint GetClientAreaOrigin() const;
1017    %Docstring
1018        GetClientAreaOrigin() -> Point
1019
1020        Get the origin of the client area of the window relative to the window
1021        top left corner (the client area may be shifted because of the
1022        borders, scrollbars, other decorations...)
1023    %End
1024
1025    wxRect GetClientRect() const;
1026    %Docstring
1027        GetClientRect() -> Rect
1028
1029        Get the client rectangle in window (i.e. client) coordinates.
1030    %End
1031
1032    void Move(
1033        int x,
1034        int y,
1035        int flags = wxSIZE_USE_EXISTING
1036    );
1037    %Docstring
1038        Move(x, y, flags=SIZE_USE_EXISTING)
1039        Move(pt, flags=SIZE_USE_EXISTING)
1040
1041        Moves the window to the given position.
1042    %End
1043
1044    void Move(
1045        const wxPoint & pt,
1046        int flags = wxSIZE_USE_EXISTING
1047    );
1048
1049    void SetPosition(
1050        const wxPoint & pt
1051    );
1052    %Docstring
1053        SetPosition(pt)
1054
1055        Moves the window to the specified position.
1056    %End
1057
1058    void ClientToScreen(
1059        int * x   /In, Out/,
1060        int * y   /In, Out/
1061    ) const;
1062    %Docstring
1063        ClientToScreen(x, y) -> (x, y)
1064        ClientToScreen(pt) -> Point
1065
1066        Converts to screen coordinates from coordinates relative to this
1067        window.
1068    %End
1069
1070    wxPoint ClientToScreen(
1071        const wxPoint & pt
1072    ) const;
1073
1074    wxPoint ConvertDialogToPixels(
1075        const wxPoint & pt
1076    ) const;
1077    %Docstring
1078        ConvertDialogToPixels(pt) -> Point
1079        ConvertDialogToPixels(sz) -> Size
1080
1081        Converts a point or size from dialog units to pixels.
1082    %End
1083
1084    wxSize ConvertDialogToPixels(
1085        const wxSize & sz
1086    ) const;
1087
1088    wxPoint ConvertPixelsToDialog(
1089        const wxPoint & pt
1090    ) const;
1091    %Docstring
1092        ConvertPixelsToDialog(pt) -> Point
1093        ConvertPixelsToDialog(sz) -> Size
1094
1095        Converts a point or size from pixels to dialog units.
1096    %End
1097
1098    wxSize ConvertPixelsToDialog(
1099        const wxSize & sz
1100    ) const;
1101
1102    void ScreenToClient(
1103        int * x   /In, Out/,
1104        int * y   /In, Out/
1105    ) const;
1106    %Docstring
1107        ScreenToClient(x, y) -> (x, y)
1108        ScreenToClient(pt) -> Point
1109
1110        Converts from screen to client window coordinates.
1111    %End
1112
1113    wxPoint ScreenToClient(
1114        const wxPoint & pt
1115    ) const;
1116
1117    void ClearBackground();
1118    %Docstring
1119        ClearBackground()
1120
1121        Clears the window by filling it with the current background colour.
1122    %End
1123
1124    void Freeze();
1125    %Docstring
1126        Freeze()
1127
1128        Freezes the window or, in other words, prevents any updates from
1129        taking place on screen, the window is not redrawn at all.
1130    %End
1131
1132    void Thaw();
1133    %Docstring
1134        Thaw()
1135
1136        Re-enables window updating after a previous call to Freeze().
1137    %End
1138
1139    bool IsFrozen() const;
1140    %Docstring
1141        IsFrozen() -> bool
1142
1143        Returns true if the window is currently frozen by a call to Freeze().
1144    %End
1145
1146    wxColour GetBackgroundColour() const;
1147    %Docstring
1148        GetBackgroundColour() -> Colour
1149
1150        Returns the background colour of the window.
1151    %End
1152
1153    wxBackgroundStyle GetBackgroundStyle() const;
1154    %Docstring
1155        GetBackgroundStyle() -> BackgroundStyle
1156
1157        Returns the background style of the window.
1158    %End
1159
1160    int GetCharHeight() const;
1161    %Docstring
1162        GetCharHeight() -> int
1163
1164        Returns the character height for this window.
1165    %End
1166
1167    int GetCharWidth() const;
1168    %Docstring
1169        GetCharWidth() -> int
1170
1171        Returns the average character width for this window.
1172    %End
1173
1174    wxVisualAttributes GetDefaultAttributes() const;
1175    %Docstring
1176        GetDefaultAttributes() -> VisualAttributes
1177
1178        Currently this is the same as calling
1179        wxWindow::GetClassDefaultAttributes(wxWindow::GetWindowVariant()).
1180    %End
1181    %PreMethodCode
1182        if (!wxPyCheckForApp()) return NULL;
1183    %End
1184
1185    wxFont GetFont() const;
1186    %Docstring
1187        GetFont() -> Font
1188
1189        Returns the font for this window.
1190    %End
1191
1192    wxColour GetForegroundColour() const;
1193    %Docstring
1194        GetForegroundColour() -> Colour
1195
1196        Returns the foreground colour of the window.
1197    %End
1198
1199    void GetTextExtent(
1200        const wxString & string,
1201        int * w   /Out/,
1202        int * h   /Out/,
1203        int * descent   /Out/ = NULL,
1204        int * externalLeading   /Out/ = NULL,
1205        const wxFont * font = NULL
1206    ) const   /PyName=GetFullTextExtent/;
1207    %Docstring
1208        GetFullTextExtent(string, font=None) -> (w, h, descent, externalLeading)
1209        GetTextExtent(string) -> Size
1210
1211        Gets the dimensions of the string as it would be drawn on the window
1212        with the currently selected font.
1213    %End
1214
1215    wxSize GetTextExtent(
1216        const wxString & string
1217    ) const;
1218
1219    const wxRegion & GetUpdateRegion() const;
1220    %Docstring
1221        GetUpdateRegion() -> Region
1222
1223        Returns the region specifying which parts of the window have been
1224        damaged.
1225    %End
1226
1227    wxRect GetUpdateClientRect() const;
1228    %Docstring
1229        GetUpdateClientRect() -> Rect
1230
1231        Get the update rectangle bounding box in client coords.
1232    %End
1233
1234    virtual
1235    bool HasTransparentBackground();
1236    %Docstring
1237        HasTransparentBackground() -> bool
1238
1239        Returns true if this window background is transparent (as, for
1240        example, for wxStaticText) and should show the parent window
1241        background.
1242    %End
1243
1244    void Refresh(
1245        bool eraseBackground = true,
1246        const wxRect * rect = NULL
1247    );
1248    %Docstring
1249        Refresh(eraseBackground=True, rect=None)
1250
1251        Causes this window, and all of its children recursively (except under
1252        wxGTK1 where this is not implemented), to be repainted.
1253    %End
1254
1255    void RefreshRect(
1256        const wxRect & rect,
1257        bool eraseBackground = true
1258    );
1259    %Docstring
1260        RefreshRect(rect, eraseBackground=True)
1261
1262        Redraws the contents of the given rectangle: only the area inside it
1263        will be repainted.
1264    %End
1265
1266    void Update();
1267    %Docstring
1268        Update()
1269
1270        Calling this method immediately repaints the invalidated area of the
1271        window and all of its children recursively (this normally only happens
1272        when the flow of control returns to the event loop).
1273    %End
1274
1275    bool SetBackgroundColour(
1276        const wxColour & colour
1277    );
1278    %Docstring
1279        SetBackgroundColour(colour) -> bool
1280
1281        Sets the background colour of the window.
1282    %End
1283
1284    bool SetBackgroundStyle(
1285        wxBackgroundStyle style
1286    );
1287    %Docstring
1288        SetBackgroundStyle(style) -> bool
1289
1290        Sets the background style of the window.
1291    %End
1292
1293    bool IsTransparentBackgroundSupported(
1294        wxString * reason = NULL
1295    ) const;
1296    %Docstring
1297        IsTransparentBackgroundSupported(reason=None) -> bool
1298
1299        Checks whether using transparent background might work.
1300    %End
1301
1302    bool SetFont(
1303        const wxFont & font
1304    );
1305    %Docstring
1306        SetFont(font) -> bool
1307
1308        Sets the font for this window.
1309    %End
1310
1311    bool SetForegroundColour(
1312        const wxColour & colour
1313    );
1314    %Docstring
1315        SetForegroundColour(colour) -> bool
1316
1317        Sets the foreground colour of the window.
1318    %End
1319
1320    void SetOwnBackgroundColour(
1321        const wxColour & colour
1322    );
1323    %Docstring
1324        SetOwnBackgroundColour(colour)
1325
1326        Sets the background colour of the window but prevents it from being
1327        inherited by the children of this window.
1328    %End
1329
1330    bool InheritsBackgroundColour() const;
1331    %Docstring
1332        InheritsBackgroundColour() -> bool
1333
1334        Return true if this window inherits the background colour from its
1335        parent.
1336    %End
1337
1338    bool UseBgCol() const;
1339    %Docstring
1340        UseBgCol() -> bool
1341
1342        Return true if a background colour has been set for this window.
1343    %End
1344
1345    void SetOwnFont(
1346        const wxFont & font
1347    );
1348    %Docstring
1349        SetOwnFont(font)
1350
1351        Sets the font of the window but prevents it from being inherited by
1352        the children of this window.
1353    %End
1354
1355    void SetOwnForegroundColour(
1356        const wxColour & colour
1357    );
1358    %Docstring
1359        SetOwnForegroundColour(colour)
1360
1361        Sets the foreground colour of the window but prevents it from being
1362        inherited by the children of this window.
1363    %End
1364
1365    void SetPalette(
1366        const wxPalette & pal
1367    )   /Deprecated/;
1368    %Docstring
1369        SetPalette(pal)
1370    %End
1371
1372    virtual
1373    bool ShouldInheritColours() const;
1374    %Docstring
1375        ShouldInheritColours() -> bool
1376
1377        Return true from here to allow the colours of this window to be
1378        changed by InheritAttributes().
1379    %End
1380
1381    void SetThemeEnabled(
1382        bool enable
1383    );
1384    %Docstring
1385        SetThemeEnabled(enable)
1386
1387        This function tells a window if it should use the system's "theme"
1388        code to draw the windows' background instead of its own background
1389        drawing code.
1390    %End
1391
1392    bool GetThemeEnabled() const;
1393    %Docstring
1394        GetThemeEnabled() -> bool
1395
1396        Clears the window by filling it with the current background colour.
1397    %End
1398
1399    bool CanSetTransparent();
1400    %Docstring
1401        CanSetTransparent() -> bool
1402
1403        Returns true if the system supports transparent windows and calling
1404        SetTransparent() may succeed.
1405    %End
1406
1407    bool SetTransparent(
1408        wxByte alpha
1409    );
1410    %Docstring
1411        SetTransparent(alpha) -> bool
1412
1413        Set the transparency of the window.
1414    %End
1415
1416    wxEvtHandler * GetEventHandler() const;
1417    %Docstring
1418        GetEventHandler() -> EvtHandler
1419
1420        Returns the event handler for this window.
1421    %End
1422
1423    bool HandleAsNavigationKey(
1424        const wxKeyEvent & event
1425    );
1426    %Docstring
1427        HandleAsNavigationKey(event) -> bool
1428
1429        This function will generate the appropriate call to Navigate() if the
1430        key event is one normally used for keyboard navigation and return true
1431        in this case.
1432    %End
1433
1434    bool HandleWindowEvent(
1435        wxEvent & event
1436    ) const;
1437    %Docstring
1438        HandleWindowEvent(event) -> bool
1439
1440        Shorthand for:
1441    %End
1442
1443    bool ProcessWindowEvent(
1444        wxEvent & event
1445    )   /ReleaseGIL/;
1446    %Docstring
1447        ProcessWindowEvent(event) -> bool
1448
1449        Convenient wrapper for ProcessEvent().
1450    %End
1451
1452    bool ProcessWindowEventLocally(
1453        wxEvent & event
1454    )   /ReleaseGIL/;
1455    %Docstring
1456        ProcessWindowEventLocally(event) -> bool
1457
1458        Wrapper for wxEvtHandler::ProcessEventLocally().
1459    %End
1460
1461    wxEvtHandler * PopEventHandler(
1462        bool deleteHandler = false
1463    )   /TransferBack/;
1464    %Docstring
1465        PopEventHandler(deleteHandler=False) -> EvtHandler
1466
1467        Removes and returns the top-most event handler on the event handler
1468        stack.
1469    %End
1470
1471    void PushEventHandler(
1472        wxEvtHandler * handler   /Transfer/
1473    );
1474    %Docstring
1475        PushEventHandler(handler)
1476
1477        Pushes this event handler onto the event stack for the window.
1478    %End
1479
1480    bool RemoveEventHandler(
1481        wxEvtHandler * handler   /TransferBack/
1482    );
1483    %Docstring
1484        RemoveEventHandler(handler) -> bool
1485
1486        Find the given handler in the windows event handler stack and removes
1487        (but does not delete) it from the stack.
1488    %End
1489
1490    void SetEventHandler(
1491        wxEvtHandler * handler   /Transfer/
1492    );
1493    %Docstring
1494        SetEventHandler(handler)
1495
1496        Sets the event handler for this window.
1497    %End
1498
1499    void SetNextHandler(
1500        wxEvtHandler * handler
1501    );
1502    %Docstring
1503        SetNextHandler(handler)
1504
1505        wxWindows cannot be used to form event handler chains; this function
1506        thus will assert when called.
1507    %End
1508
1509    void SetPreviousHandler(
1510        wxEvtHandler * handler
1511    );
1512    %Docstring
1513        SetPreviousHandler(handler)
1514
1515        wxWindows cannot be used to form event handler chains; this function
1516        thus will assert when called.
1517    %End
1518
1519    long GetExtraStyle() const;
1520    %Docstring
1521        GetExtraStyle() -> long
1522
1523        Returns the extra style bits for the window.
1524    %End
1525
1526    long GetWindowStyleFlag() const;
1527    %Docstring
1528        GetWindowStyleFlag() -> long
1529
1530        Gets the window style that was passed to the constructor or Create()
1531        method.
1532    %End
1533
1534    long GetWindowStyle() const;
1535    %Docstring
1536        GetWindowStyle() -> long
1537
1538        See GetWindowStyleFlag() for more info.
1539    %End
1540
1541    bool HasExtraStyle(
1542        int exFlag
1543    ) const;
1544    %Docstring
1545        HasExtraStyle(exFlag) -> bool
1546
1547        Returns true if the window has the given exFlag bit set in its extra
1548        styles.
1549    %End
1550
1551    bool HasFlag(
1552        int flag
1553    ) const;
1554    %Docstring
1555        HasFlag(flag) -> bool
1556
1557        Returns true if the window has the given flag bit set.
1558    %End
1559
1560    void SetExtraStyle(
1561        long exStyle
1562    );
1563    %Docstring
1564        SetExtraStyle(exStyle)
1565
1566        Sets the extra style bits for the window.
1567    %End
1568
1569    void SetWindowStyleFlag(
1570        long style
1571    );
1572    %Docstring
1573        SetWindowStyleFlag(style)
1574
1575        Sets the style of the window.
1576    %End
1577
1578    void SetWindowStyle(
1579        long style
1580    );
1581    %Docstring
1582        SetWindowStyle(style)
1583
1584        See SetWindowStyleFlag() for more info.
1585    %End
1586
1587    bool ToggleWindowStyle(
1588        int flag
1589    );
1590    %Docstring
1591        ToggleWindowStyle(flag) -> bool
1592
1593        Turns the given flag on if it's currently turned off and vice versa.
1594    %End
1595
1596    void MoveAfterInTabOrder(
1597        wxWindow * win
1598    );
1599    %Docstring
1600        MoveAfterInTabOrder(win)
1601
1602        Moves this window in the tab navigation order after the specified win.
1603    %End
1604
1605    void MoveBeforeInTabOrder(
1606        wxWindow * win
1607    );
1608    %Docstring
1609        MoveBeforeInTabOrder(win)
1610
1611        Same as MoveAfterInTabOrder() except that it inserts this window just
1612        before win instead of putting it right after it.
1613    %End
1614
1615    bool Navigate(
1616        int flags = wxNavigationKeyEvent::IsForward
1617    );
1618    %Docstring
1619        Navigate(flags=NavigationKeyEvent.IsForward) -> bool
1620
1621        Performs a keyboard navigation action starting from this window.
1622    %End
1623
1624    bool NavigateIn(
1625        int flags = wxNavigationKeyEvent::IsForward
1626    );
1627    %Docstring
1628        NavigateIn(flags=NavigationKeyEvent.IsForward) -> bool
1629
1630        Performs a keyboard navigation action inside this window.
1631    %End
1632
1633    void Lower();
1634    %Docstring
1635        Lower()
1636
1637        Lowers the window to the bottom of the window hierarchy (Z-order).
1638    %End
1639
1640    void Raise();
1641    %Docstring
1642        Raise()
1643
1644        Raises the window to the top of the window hierarchy (Z-order).
1645    %End
1646
1647    bool Hide();
1648    %Docstring
1649        Hide() -> bool
1650
1651        Equivalent to calling wxWindow::Show(false).
1652    %End
1653
1654    bool HideWithEffect(
1655        wxShowEffect effect,
1656        unsigned int timeout = 0
1657    );
1658    %Docstring
1659        HideWithEffect(effect, timeout=0) -> bool
1660
1661        This function hides a window, like Hide(), but using a special visual
1662        effect if possible.
1663    %End
1664
1665    bool IsEnabled() const;
1666    %Docstring
1667        IsEnabled() -> bool
1668
1669        Returns true if the window is enabled, i.e. if it accepts user input,
1670        false otherwise.
1671    %End
1672
1673    bool IsExposed(
1674        int x,
1675        int y
1676    ) const;
1677    %Docstring
1678        IsExposed(x, y) -> bool
1679        IsExposed(pt) -> bool
1680        IsExposed(x, y, w, h) -> bool
1681        IsExposed(rect) -> bool
1682
1683        Returns true if the given point or rectangle area has been exposed
1684        since the last repaint.
1685    %End
1686
1687    bool IsExposed(
1688        wxPoint & pt
1689    ) const;
1690
1691    bool IsExposed(
1692        int x,
1693        int y,
1694        int w,
1695        int h
1696    ) const;
1697
1698    bool IsExposed(
1699        wxRect & rect
1700    ) const;
1701
1702    bool IsShown() const;
1703    %Docstring
1704        IsShown() -> bool
1705
1706        Returns true if the window is shown, false if it has been hidden.
1707    %End
1708
1709    bool IsShownOnScreen() const;
1710    %Docstring
1711        IsShownOnScreen() -> bool
1712
1713        Returns true if the window is physically visible on the screen, i.e.
1714        it is shown and all its parents up to the toplevel window are shown as
1715        well.
1716    %End
1717
1718    bool Disable();
1719    %Docstring
1720        Disable() -> bool
1721
1722        Disables the window.
1723    %End
1724
1725    bool Enable(
1726        bool enable = true
1727    );
1728    %Docstring
1729        Enable(enable=True) -> bool
1730
1731        Enable or disable the window for user input.
1732    %End
1733
1734    bool Show(
1735        bool show = true
1736    );
1737    %Docstring
1738        Show(show=True) -> bool
1739
1740        Shows or hides the window.
1741    %End
1742
1743    bool ShowWithEffect(
1744        wxShowEffect effect,
1745        unsigned int timeout = 0
1746    );
1747    %Docstring
1748        ShowWithEffect(effect, timeout=0) -> bool
1749
1750        This function shows a window, like Show(), but using a special visual
1751        effect if possible.
1752    %End
1753
1754    wxString GetHelpText() const;
1755    %Docstring
1756        GetHelpText() -> String
1757
1758        Gets the help text to be used as context-sensitive help for this
1759        window.
1760    %End
1761
1762    void SetHelpText(
1763        const wxString & helpText
1764    );
1765    %Docstring
1766        SetHelpText(helpText)
1767
1768        Sets the help text to be used as context-sensitive help for this
1769        window.
1770    %End
1771
1772    wxString GetHelpTextAtPoint(
1773        const wxPoint & point,
1774        wxHelpEvent::Origin origin
1775    ) const;
1776    %Docstring
1777        GetHelpTextAtPoint(point, origin) -> String
1778
1779        Gets the help text to be used as context-sensitive help for this
1780        window.
1781    %End
1782
1783    wxToolTip * GetToolTip() const;
1784    %Docstring
1785        GetToolTip() -> ToolTip
1786
1787        Get the associated tooltip or NULL if none.
1788    %End
1789
1790    wxString GetToolTipText() const;
1791    %Docstring
1792        GetToolTipText() -> String
1793
1794        Get the text of the associated tooltip or empty string if none.
1795    %End
1796
1797    void SetToolTip(
1798        const wxString & tipString
1799    );
1800    %Docstring
1801        SetToolTip(tipString)
1802        SetToolTip(tip)
1803
1804        Attach a tooltip to the window.
1805    %End
1806
1807    void SetToolTip(
1808        wxToolTip * tip   /Transfer/
1809    );
1810
1811    void UnsetToolTip();
1812    %Docstring
1813        UnsetToolTip()
1814
1815        Unset any existing tooltip.
1816    %End
1817
1818    int GetPopupMenuSelectionFromUser(
1819        wxMenu & menu,
1820        const wxPoint & pos = wxDefaultPosition
1821    );
1822    %Docstring
1823        GetPopupMenuSelectionFromUser(menu, pos=DefaultPosition) -> int
1824        GetPopupMenuSelectionFromUser(menu, x, y) -> int
1825
1826        This function shows a popup menu at the given position in this window
1827        and returns the selected id.
1828    %End
1829
1830    int GetPopupMenuSelectionFromUser(
1831        wxMenu & menu,
1832        int x,
1833        int y
1834    );
1835
1836    bool PopupMenu(
1837        wxMenu * menu,
1838        const wxPoint & pos = wxDefaultPosition
1839    )   /ReleaseGIL/;
1840    %Docstring
1841        PopupMenu(menu, pos=DefaultPosition) -> bool
1842        PopupMenu(menu, x, y) -> bool
1843
1844        Pops up the given menu at the specified coordinates, relative to this
1845        window, and returns control when the user has dismissed the menu.
1846    %End
1847
1848    bool PopupMenu(
1849        wxMenu * menu,
1850        int x,
1851        int y
1852    );
1853
1854    virtual
1855    wxValidator * GetValidator();
1856    %Docstring
1857        GetValidator() -> Validator
1858
1859        Validator functions.
1860    %End
1861
1862    virtual
1863    void SetValidator(
1864        const wxValidator & validator
1865    );
1866    %Docstring
1867        SetValidator(validator)
1868
1869        Deletes the current validator (if any) and sets the window validator,
1870        having called wxValidator::Clone to create a new validator of this
1871        type.
1872    %End
1873
1874    virtual
1875    bool TransferDataFromWindow();
1876    %Docstring
1877        TransferDataFromWindow() -> bool
1878
1879        Transfers values from child controls to data areas specified by their
1880        validators.
1881    %End
1882
1883    virtual
1884    bool TransferDataToWindow();
1885    %Docstring
1886        TransferDataToWindow() -> bool
1887
1888        Transfers values to child controls from data areas specified by their
1889        validators.
1890    %End
1891
1892    virtual
1893    bool Validate();
1894    %Docstring
1895        Validate() -> bool
1896
1897        Validates the current values of the child controls using their
1898        validators.
1899    %End
1900
1901    wxWindowID GetId() const;
1902    %Docstring
1903        GetId() -> WindowID
1904
1905        Returns the identifier of the window.
1906    %End
1907
1908    wxString GetLabel() const;
1909    %Docstring
1910        GetLabel() -> String
1911
1912        Generic way of getting a label from any window, for identification
1913        purposes.
1914    %End
1915
1916    wxLayoutDirection GetLayoutDirection() const;
1917    %Docstring
1918        GetLayoutDirection() -> LayoutDirection
1919
1920        Returns the layout direction for this window, Note that
1921        wxLayout_Default is returned if layout direction is not supported.
1922    %End
1923
1924    wxCoord AdjustForLayoutDirection(
1925        wxCoord x,
1926        wxCoord width,
1927        wxCoord widthTotal
1928    ) const;
1929    %Docstring
1930        AdjustForLayoutDirection(x, width, widthTotal) -> Coord
1931
1932        Mirror coordinates for RTL layout if this window uses it and if the
1933        mirroring is not done automatically like Win32.
1934    %End
1935
1936    wxString GetName() const;
1937    %Docstring
1938        GetName() -> String
1939
1940        Returns the window's name.
1941    %End
1942
1943    wxWindowVariant GetWindowVariant() const;
1944    %Docstring
1945        GetWindowVariant() -> WindowVariant
1946
1947        Returns the value previously passed to SetWindowVariant().
1948    %End
1949
1950    void SetId(
1951        wxWindowID winid
1952    );
1953    %Docstring
1954        SetId(winid)
1955
1956        Sets the identifier of the window.
1957    %End
1958
1959    void SetLabel(
1960        const wxString & label
1961    );
1962    %Docstring
1963        SetLabel(label)
1964
1965        Sets the window's label.
1966    %End
1967
1968    void SetLayoutDirection(
1969        wxLayoutDirection dir
1970    );
1971    %Docstring
1972        SetLayoutDirection(dir)
1973
1974        Sets the layout direction for this window.
1975    %End
1976
1977    void SetName(
1978        const wxString & name
1979    );
1980    %Docstring
1981        SetName(name)
1982
1983        Sets the window's name.
1984    %End
1985
1986    void SetWindowVariant(
1987        wxWindowVariant variant
1988    );
1989    %Docstring
1990        SetWindowVariant(variant)
1991
1992        Chooses a different variant of the window display to use.
1993    %End
1994
1995    wxAcceleratorTable * GetAcceleratorTable();
1996    %Docstring
1997        GetAcceleratorTable() -> AcceleratorTable
1998
1999        Gets the accelerator table for this window.
2000    %End
2001
2002    wxAccessible * GetAccessible();
2003    %Docstring
2004        GetAccessible() -> Accessible
2005
2006        Returns the accessible object for this window, if any.
2007    %End
2008    %MethodCode
2009        PyErr_Clear();
2010        Py_BEGIN_ALLOW_THREADS
2011        sipRes = _wxWindow_GetAccessible(sipCpp);
2012        Py_END_ALLOW_THREADS
2013        if (PyErr_Occurred()) sipIsErr = 1;
2014    %End
2015    %TypeCode
2016    wxAccessible * _wxWindow_GetAccessible(wxWindow* self)
2017    {
2018        #if wxUSE_ACCESSIBILITY
2019            return self->GetAccessible();
2020        #else
2021            wxPyRaiseNotImplemented();
2022            return NULL;
2023        #endif
2024    }
2025    %End
2026
2027    void SetAcceleratorTable(
2028        const wxAcceleratorTable & accel
2029    );
2030    %Docstring
2031        SetAcceleratorTable(accel)
2032
2033        Sets the accelerator table for this window.
2034    %End
2035
2036    void SetAccessible(
2037        wxAccessible * accessible   /Transfer/
2038    );
2039    %Docstring
2040        SetAccessible(accessible)
2041
2042        Sets the accessible for this window.
2043    %End
2044    %MethodCode
2045        PyErr_Clear();
2046        Py_BEGIN_ALLOW_THREADS
2047        _wxWindow_SetAccessible(sipCpp, accessible);
2048        Py_END_ALLOW_THREADS
2049        if (PyErr_Occurred()) sipIsErr = 1;
2050    %End
2051    %TypeCode
2052    void _wxWindow_SetAccessible(wxWindow* self, wxAccessible *accessible)
2053    {
2054        #if wxUSE_ACCESSIBILITY
2055            self->SetAccessible(accessible);
2056        #else
2057            wxPyRaiseNotImplemented();
2058        #endif
2059    }
2060    %End
2061
2062    bool Close(
2063        bool force = false
2064    );
2065    %Docstring
2066        Close(force=False) -> bool
2067
2068        This function simply generates a wxCloseEvent whose handler usually
2069        tries to close the window.
2070    %End
2071
2072    virtual
2073    bool Destroy()   /TransferThis/;
2074    %Docstring
2075        Destroy() -> bool
2076
2077        Destroys the window safely.
2078    %End
2079
2080    bool IsBeingDeleted() const;
2081    %Docstring
2082        IsBeingDeleted() -> bool
2083
2084        Returns true if this window is in process of being destroyed.
2085    %End
2086
2087    wxDropTarget * GetDropTarget() const;
2088    %Docstring
2089        GetDropTarget() -> DropTarget
2090
2091        Returns the associated drop target, which may be NULL.
2092    %End
2093
2094    void SetDropTarget(
2095        wxDropTarget * target   /Transfer/
2096    );
2097    %Docstring
2098        SetDropTarget(target)
2099
2100        Associates a drop target with this window.
2101    %End
2102
2103    void DragAcceptFiles(
2104        bool accept
2105    );
2106    %Docstring
2107        DragAcceptFiles(accept)
2108
2109        Enables or disables eligibility for drop file events (OnDropFiles).
2110    %End
2111
2112    wxSizer * GetContainingSizer() const;
2113    %Docstring
2114        GetContainingSizer() -> Sizer
2115
2116        Returns the sizer of which this window is a member, if any, otherwise
2117        NULL.
2118    %End
2119
2120    wxSizer * GetSizer() const;
2121    %Docstring
2122        GetSizer() -> Sizer
2123
2124        Returns the sizer associated with the window by a previous call to
2125        SetSizer(), or NULL.
2126    %End
2127
2128    void SetSizer(
2129        wxSizer * sizer   /Transfer/,
2130        bool deleteOld = true
2131    );
2132    %Docstring
2133        SetSizer(sizer, deleteOld=True)
2134
2135        Sets the window to have the given layout sizer.
2136    %End
2137
2138    void SetSizerAndFit(
2139        wxSizer * sizer   /Transfer/,
2140        bool deleteOld = true
2141    );
2142    %Docstring
2143        SetSizerAndFit(sizer, deleteOld=True)
2144
2145        This method calls SetSizer() and then wxSizer::SetSizeHints which sets
2146        the initial window size to the size needed to accommodate all sizer
2147        elements and sets the size hints which, if this window is a top level
2148        one, prevent the user from resizing it to be less than this minimal
2149        size.
2150    %End
2151
2152    wxLayoutConstraints * GetConstraints() const;
2153    %Docstring
2154        GetConstraints() -> LayoutConstraints
2155
2156        Returns a pointer to the window's layout constraints, or NULL if there
2157        are none.
2158    %End
2159
2160    void SetConstraints(
2161        wxLayoutConstraints * constraints   /Transfer/
2162    );
2163    %Docstring
2164        SetConstraints(constraints)
2165
2166        Sets the window to have the given layout constraints.
2167    %End
2168
2169    bool Layout();
2170    %Docstring
2171        Layout() -> bool
2172
2173        Invokes the constraint-based layout algorithm or the sizer-based
2174        algorithm for this window.
2175    %End
2176
2177    void SetAutoLayout(
2178        bool autoLayout
2179    );
2180    %Docstring
2181        SetAutoLayout(autoLayout)
2182
2183        Determines whether the Layout() function will be called automatically
2184        when the window is resized.
2185    %End
2186
2187    bool GetAutoLayout() const;
2188    %Docstring
2189        GetAutoLayout() -> bool
2190
2191        Returns the sizer of which this window is a member, if any, otherwise
2192        NULL.
2193    %End
2194
2195    void CaptureMouse();
2196    %Docstring
2197        CaptureMouse()
2198
2199        Directs all mouse input to this window.
2200    %End
2201
2202    wxCaret * GetCaret() const;
2203    %Docstring
2204        GetCaret() -> Caret
2205
2206        Returns the caret() associated with the window.
2207    %End
2208
2209    const wxCursor & GetCursor() const;
2210    %Docstring
2211        GetCursor() -> Cursor
2212
2213        Return the cursor associated with this window.
2214    %End
2215
2216    bool HasCapture() const;
2217    %Docstring
2218        HasCapture() -> bool
2219
2220        Returns true if this window has the current mouse capture.
2221    %End
2222
2223    void ReleaseMouse();
2224    %Docstring
2225        ReleaseMouse()
2226
2227        Releases mouse input captured with CaptureMouse().
2228    %End
2229
2230    void SetCaret(
2231        wxCaret * caret   /Transfer/
2232    );
2233    %Docstring
2234        SetCaret(caret)
2235
2236        Sets the caret() associated with the window.
2237    %End
2238
2239    bool SetCursor(
2240        const wxCursor & cursor
2241    );
2242    %Docstring
2243        SetCursor(cursor) -> bool
2244
2245        Sets the window's cursor.
2246    %End
2247
2248    void WarpPointer(
2249        int x,
2250        int y
2251    );
2252    %Docstring
2253        WarpPointer(x, y)
2254
2255        Moves the pointer to the given position on the window.
2256    %End
2257
2258    wxHitTest HitTest(
2259        wxCoord x,
2260        wxCoord y
2261    ) const;
2262    %Docstring
2263        HitTest(x, y) -> HitTest
2264        HitTest(pt) -> HitTest
2265
2266        Get the window border style from the given flags: this is different
2267        from simply doing flags & wxBORDER_MASK because it uses
2268        GetDefaultBorder() to translate wxBORDER_DEFAULT to something
2269        reasonable.
2270    %End
2271
2272    wxHitTest HitTest(
2273        const wxPoint & pt
2274    ) const;
2275
2276    wxBorder GetBorder(
2277        long flags
2278    ) const;
2279    %Docstring
2280        GetBorder(flags) -> Border
2281        GetBorder() -> Border
2282
2283        Get the window border style from the given flags: this is different
2284        from simply doing flags & wxBORDER_MASK because it uses
2285        GetDefaultBorder() to translate wxBORDER_DEFAULT to something
2286        reasonable.
2287    %End
2288
2289    wxBorder GetBorder() const;
2290
2291    void DoUpdateWindowUI(
2292        wxUpdateUIEvent & event
2293    );
2294    %Docstring
2295        DoUpdateWindowUI(event)
2296
2297        Does the window-specific updating after processing the update event.
2298    %End
2299
2300    wxUIntPtr* GetHandle() const;
2301    %Docstring
2302        GetHandle() -> UIntPtr
2303
2304        Returns the platform-specific handle of the physical window.
2305    %End
2306    %MethodCode
2307        PyErr_Clear();
2308        Py_BEGIN_ALLOW_THREADS
2309        sipRes = _wxWindow_GetHandle(sipCpp);
2310        Py_END_ALLOW_THREADS
2311        if (PyErr_Occurred()) sipIsErr = 1;
2312    %End
2313    %TypeCode
2314    wxUIntPtr* _wxWindow_GetHandle(const wxWindow* self)
2315    {
2316        return new wxUIntPtr(wxPyGetWinHandle(self));
2317    }
2318    %End
2319
2320    bool HasMultiplePages() const;
2321    %Docstring
2322        HasMultiplePages() -> bool
2323
2324        This method should be overridden to return true if this window has
2325        multiple pages.
2326    %End
2327
2328    virtual
2329    void InheritAttributes();
2330    %Docstring
2331        InheritAttributes()
2332
2333        This function is (or should be, in case of custom controls) called
2334        during window creation to intelligently set up the window visual
2335        attributes, that is the font and the foreground and background
2336        colours.
2337    %End
2338
2339    virtual
2340    void InitDialog();
2341    %Docstring
2342        InitDialog()
2343
2344        Sends an wxEVT_INIT_DIALOG event, whose handler usually transfers data
2345        to the dialog via validators.
2346    %End
2347
2348    bool IsDoubleBuffered() const;
2349    %Docstring
2350        IsDoubleBuffered() -> bool
2351
2352        Returns true if the window contents is double-buffered by the system,
2353        i.e. if any drawing done on the window is really done on a temporary
2354        backing surface and transferred to the screen all at once later.
2355    %End
2356
2357    void SetDoubleBuffered(
2358        bool on
2359    );
2360    %Docstring
2361        SetDoubleBuffered(on)
2362
2363        Turn on or off double buffering of the window if the system supports
2364        it.
2365    %End
2366    %MethodCode
2367        PyErr_Clear();
2368        Py_BEGIN_ALLOW_THREADS
2369        _wxWindow_SetDoubleBuffered(sipCpp, on);
2370        Py_END_ALLOW_THREADS
2371        if (PyErr_Occurred()) sipIsErr = 1;
2372    %End
2373    %TypeCode
2374    void _wxWindow_SetDoubleBuffered(wxWindow* self, bool on)
2375    {
2376        #if defined(__WXGTK20__) || defined(__WXGTK3__) || defined(__WXMSW__)
2377            self->SetDoubleBuffered(on);
2378        #endif
2379    }
2380    %End
2381
2382    bool IsRetained() const;
2383    %Docstring
2384        IsRetained() -> bool
2385
2386        Returns true if the window is retained, false otherwise.
2387    %End
2388
2389    bool IsThisEnabled() const;
2390    %Docstring
2391        IsThisEnabled() -> bool
2392
2393        Returns true if this window is intrinsically enabled, false otherwise,
2394        i.e. if Enable() Enable(false) had been called.
2395    %End
2396
2397    bool IsTopLevel() const;
2398    %Docstring
2399        IsTopLevel() -> bool
2400
2401        Returns true if the given window is a top-level one.
2402    %End
2403
2404    virtual
2405    void OnInternalIdle();
2406    %Docstring
2407        OnInternalIdle()
2408
2409        This virtual function is normally only used internally, but sometimes
2410        an application may need it to implement functionality that should not
2411        be disabled by an application defining an OnIdle handler in a derived
2412        class.
2413    %End
2414
2415    bool SendIdleEvents(
2416        wxIdleEvent & event
2417    );
2418    %Docstring
2419        SendIdleEvents(event) -> bool
2420
2421        Send idle event to window and all subwindows.
2422    %End
2423
2424    bool RegisterHotKey(
2425        int hotkeyId,
2426        int modifiers,
2427        int virtualKeyCode
2428    );
2429    %Docstring
2430        RegisterHotKey(hotkeyId, modifiers, virtualKeyCode) -> bool
2431
2432        Registers a system wide hotkey.
2433    %End
2434    %MethodCode
2435        PyErr_Clear();
2436        Py_BEGIN_ALLOW_THREADS
2437        sipRes = _wxWindow_RegisterHotKey(sipCpp, hotkeyId, modifiers, virtualKeyCode);
2438        Py_END_ALLOW_THREADS
2439        if (PyErr_Occurred()) sipIsErr = 1;
2440    %End
2441    %TypeCode
2442    bool _wxWindow_RegisterHotKey(wxWindow* self, int hotkeyId, int modifiers, int virtualKeyCode)
2443    {
2444        #if wxUSE_HOTKEY
2445            return self->RegisterHotKey(hotkeyId, modifiers, virtualKeyCode);
2446        #else
2447            return false;
2448        #endif
2449    }
2450    %End
2451
2452    bool UnregisterHotKey(
2453        int hotkeyId
2454    );
2455    %Docstring
2456        UnregisterHotKey(hotkeyId) -> bool
2457
2458        Unregisters a system wide hotkey.
2459    %End
2460    %MethodCode
2461        PyErr_Clear();
2462        Py_BEGIN_ALLOW_THREADS
2463        sipRes = _wxWindow_UnregisterHotKey(sipCpp, hotkeyId);
2464        Py_END_ALLOW_THREADS
2465        if (PyErr_Occurred()) sipIsErr = 1;
2466    %End
2467    %TypeCode
2468    bool _wxWindow_UnregisterHotKey(wxWindow* self, int hotkeyId)
2469    {
2470        #if wxUSE_HOTKEY
2471            return self->UnregisterHotKey(hotkeyId);
2472        #else
2473            return false;
2474        #endif
2475    }
2476    %End
2477
2478    void UpdateWindowUI(
2479        long flags = wxUPDATE_UI_NONE
2480    );
2481    %Docstring
2482        UpdateWindowUI(flags=UPDATE_UI_NONE)
2483
2484        This function sends one or more wxUpdateUIEvent to the window.
2485    %End
2486
2487    static
2488    wxVisualAttributes GetClassDefaultAttributes(
2489        wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL
2490    );
2491    %Docstring
2492        GetClassDefaultAttributes(variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
2493
2494        Returns the default font and colours which are used by the control.
2495    %End
2496    %PreMethodCode
2497        if (!wxPyCheckForApp()) return NULL;
2498    %End
2499
2500    static
2501    wxWindow * FindFocus();
2502    %Docstring
2503        FindFocus() -> Window
2504
2505        Finds the window or control which currently has the keyboard focus.
2506    %End
2507    %PreMethodCode
2508        if (!wxPyCheckForApp()) return NULL;
2509    %End
2510
2511    static
2512    wxWindow * FindWindowById(
2513        long id,
2514        const wxWindow * parent = NULL
2515    );
2516    %Docstring
2517        FindWindowById(id, parent=None) -> Window
2518
2519        Find the first window with the given id.
2520    %End
2521
2522    static
2523    wxWindow * FindWindowByLabel(
2524        const wxString & label,
2525        const wxWindow * parent = NULL
2526    );
2527    %Docstring
2528        FindWindowByLabel(label, parent=None) -> Window
2529
2530        Find a window by its label.
2531    %End
2532
2533    static
2534    wxWindow * FindWindowByName(
2535        const wxString & name,
2536        const wxWindow * parent = NULL
2537    );
2538    %Docstring
2539        FindWindowByName(name, parent=None) -> Window
2540
2541        Find a window by its name (as given in a window constructor or
2542        Create() function call).
2543    %End
2544
2545    static
2546    wxWindow * GetCapture();
2547    %Docstring
2548        GetCapture() -> Window
2549
2550        Returns the currently captured window.
2551    %End
2552    %PreMethodCode
2553        if (!wxPyCheckForApp()) return NULL;
2554    %End
2555
2556    static
2557    wxWindowID NewControlId(
2558        int count = 1
2559    );
2560    %Docstring
2561        NewControlId(count=1) -> WindowID
2562
2563        Create a new ID or range of IDs that are not currently in use.
2564    %End
2565
2566    static
2567    void UnreserveControlId(
2568        wxWindowID id,
2569        int count = 1
2570    );
2571    %Docstring
2572        UnreserveControlId(id, count=1)
2573
2574        Unreserve an ID or range of IDs that was reserved by NewControlId().
2575    %End
2576
2577    bool Create(
2578        wxWindow * parent   /TransferThis/,
2579        wxWindowID id = wxID_ANY,
2580        const wxPoint & pos = wxDefaultPosition,
2581        const wxSize & size = wxDefaultSize,
2582        long style = 0,
2583        const wxString & name = wxPanelNameStr
2584    );
2585    %Docstring
2586        Create(parent, id=ID_ANY, pos=DefaultPosition, size=DefaultSize, style=0, name=PanelNameStr) -> bool
2587    %End
2588
2589    void* GetGtkWidget();
2590    %Docstring
2591        GetGtkWidget() -> void
2592    %End
2593    %MethodCode
2594        PyErr_Clear();
2595        Py_BEGIN_ALLOW_THREADS
2596        sipRes = _wxWindow_GetGtkWidget(sipCpp);
2597        Py_END_ALLOW_THREADS
2598        if (PyErr_Occurred()) sipIsErr = 1;
2599    %End
2600    %TypeCode
2601    void* _wxWindow_GetGtkWidget(wxWindow* self)
2602    {
2603        #ifdef __WXGTK__
2604            return (void*)self->GetHandle();
2605        #else
2606            return NULL;
2607        #endif
2608    }
2609    %End
2610
2611    void AssociateHandle(long handle);
2612    %Docstring
2613        AssociateHandle(handle)
2614
2615        Associate the window with a new native handle
2616    %End
2617    %MethodCode
2618        PyErr_Clear();
2619        Py_BEGIN_ALLOW_THREADS
2620        _wxWindow_AssociateHandle(sipCpp, handle);
2621        Py_END_ALLOW_THREADS
2622        if (PyErr_Occurred()) sipIsErr = 1;
2623    %End
2624    %TypeCode
2625    void _wxWindow_AssociateHandle(wxWindow* self, long handle)
2626    {
2627        self->AssociateHandle((WXWidget)handle);
2628    }
2629    %End
2630
2631    void DissociateHandle();
2632    %Docstring
2633        DissociateHandle()
2634
2635        Dissociate the current native handle from the window
2636    %End
2637    %MethodCode
2638        PyErr_Clear();
2639        Py_BEGIN_ALLOW_THREADS
2640        _wxWindow_DissociateHandle(sipCpp);
2641        Py_END_ALLOW_THREADS
2642        if (PyErr_Occurred()) sipIsErr = 1;
2643    %End
2644    %TypeCode
2645    void _wxWindow_DissociateHandle(wxWindow* self)
2646    {
2647        self->DissociateHandle();
2648    }
2649    %End
2650
2651    wxWindow* GetTopLevelParent();
2652    %Docstring
2653        GetTopLevelParent() -> Window
2654
2655        Returns the first ancestor of this window which is a top-level window.
2656    %End
2657    %MethodCode
2658        PyErr_Clear();
2659        Py_BEGIN_ALLOW_THREADS
2660        sipRes = _wxWindow_GetTopLevelParent(sipCpp);
2661        Py_END_ALLOW_THREADS
2662        if (PyErr_Occurred()) sipIsErr = 1;
2663    %End
2664    %TypeCode
2665    wxWindow* _wxWindow_GetTopLevelParent(wxWindow* self)
2666    {
2667        return wxGetTopLevelParent(self);
2668    }
2669    %End
2670
2671    bool MacIsWindowScrollbar(const wxWindow* sb);
2672    %Docstring
2673        MacIsWindowScrollbar(sb)
2674
2675        Is the given widget one of this window's built-in scrollbars?  Only
2676        applicable on Mac.
2677    %End
2678    %MethodCode
2679        PyErr_Clear();
2680        Py_BEGIN_ALLOW_THREADS
2681        sipRes = _wxWindow_MacIsWindowScrollbar(sipCpp, sb);
2682        Py_END_ALLOW_THREADS
2683        if (PyErr_Occurred()) sipIsErr = 1;
2684    %End
2685    %TypeCode
2686    bool _wxWindow_MacIsWindowScrollbar(wxWindow* self, const wxWindow* sb)
2687    {
2688        #ifdef __WXMAC__
2689            return self->MacIsWindowScrollbar(sb);
2690        #else
2691            return false;
2692        #endif
2693    }
2694    %End
2695
2696    void SetDimensions(int x,  int y,  int width,  int height,  int sizeFlags=wxSIZE_AUTO);
2697    %Docstring
2698        SetDimensions(x, y, width, height, sizeFlags=SIZE_AUTO)
2699    %End
2700    %MethodCode
2701        PyErr_Clear();
2702        Py_BEGIN_ALLOW_THREADS
2703        _wxWindow_SetDimensions(sipCpp, x, y, width, height, sizeFlags);
2704        Py_END_ALLOW_THREADS
2705        if (PyErr_Occurred()) sipIsErr = 1;
2706    %End
2707    %TypeCode
2708    void _wxWindow_SetDimensions(wxWindow* self, int x, int y, int width, int height, int sizeFlags)
2709    {
2710        self->SetSize(x, y, width, height, sizeFlags);
2711    }
2712    %End
2713
2714    %Property(name=AcceleratorTable, get=GetAcceleratorTable, set=SetAcceleratorTable)
2715    %Property(name=AutoLayout, get=GetAutoLayout, set=SetAutoLayout)
2716    %Property(name=BackgroundColour, get=GetBackgroundColour, set=SetBackgroundColour)
2717    %Property(name=BackgroundStyle, get=GetBackgroundStyle, set=SetBackgroundStyle)
2718    %Property(name=EffectiveMinSize, get=GetEffectiveMinSize)
2719    %Property(name=BestSize, get=GetBestSize)
2720    %Property(name=BestVirtualSize, get=GetBestVirtualSize)
2721    %Property(name=Border, get=GetBorder)
2722    %Property(name=Caret, get=GetCaret, set=SetCaret)
2723    %Property(name=CharHeight, get=GetCharHeight)
2724    %Property(name=CharWidth, get=GetCharWidth)
2725    %Property(name=Children, get=GetChildren)
2726    %Property(name=ClientAreaOrigin, get=GetClientAreaOrigin)
2727    %Property(name=ClientSize, get=GetClientSize, set=SetClientSize)
2728    %Property(name=Constraints, get=GetConstraints, set=SetConstraints)
2729    %Property(name=ContainingSizer, get=GetContainingSizer, set=SetContainingSizer)
2730    %Property(name=Cursor, get=GetCursor, set=SetCursor)
2731    %Property(name=DefaultAttributes, get=GetDefaultAttributes)
2732    %Property(name=DropTarget, get=GetDropTarget, set=SetDropTarget)
2733    %Property(name=EventHandler, get=GetEventHandler, set=SetEventHandler)
2734    %Property(name=ExtraStyle, get=GetExtraStyle, set=SetExtraStyle)
2735    %Property(name=Font, get=GetFont, set=SetFont)
2736    %Property(name=ForegroundColour, get=GetForegroundColour, set=SetForegroundColour)
2737    %Property(name=GrandParent, get=GetGrandParent)
2738    %Property(name=TopLevelParent, get=GetTopLevelParent)
2739    %Property(name=Handle, get=GetHandle)
2740    %Property(name=HelpText, get=GetHelpText, set=SetHelpText)
2741    %Property(name=Id, get=GetId, set=SetId)
2742    %Property(name=Label, get=GetLabel, set=SetLabel)
2743    %Property(name=LayoutDirection, get=GetLayoutDirection, set=SetLayoutDirection)
2744    %Property(name=MaxHeight, get=GetMaxHeight)
2745    %Property(name=MaxSize, get=GetMaxSize, set=SetMaxSize)
2746    %Property(name=MaxWidth, get=GetMaxWidth)
2747    %Property(name=MinHeight, get=GetMinHeight)
2748    %Property(name=MinSize, get=GetMinSize, set=SetMinSize)
2749    %Property(name=MinWidth, get=GetMinWidth)
2750    %Property(name=Name, get=GetName, set=SetName)
2751    %Property(name=Parent, get=GetParent)
2752    %Property(name=Position, get=GetPosition, set=SetPosition)
2753    %Property(name=ScreenPosition, get=GetScreenPosition)
2754    %Property(name=ScreenRect, get=GetScreenRect)
2755    %Property(name=Size, get=GetSize, set=SetSize)
2756    %Property(name=Sizer, get=GetSizer, set=SetSizer)
2757    %Property(name=ThemeEnabled, get=GetThemeEnabled, set=SetThemeEnabled)
2758    %Property(name=ToolTip, get=GetToolTip, set=SetToolTip)
2759    %Property(name=UpdateClientRect, get=GetUpdateClientRect)
2760    %Property(name=UpdateRegion, get=GetUpdateRegion)
2761    %Property(name=Validator, get=GetValidator, set=SetValidator)
2762    %Property(name=VirtualSize, get=GetVirtualSize, set=SetVirtualSize)
2763    %Property(name=WindowStyle, get=GetWindowStyle, set=SetWindowStyle)
2764    %Property(name=WindowStyleFlag, get=GetWindowStyleFlag, set=SetWindowStyleFlag)
2765    %Property(name=WindowVariant, get=GetWindowVariant, set=SetWindowVariant)
2766    %Property(name=Shown, get=IsShown, set=Show)
2767    %Property(name=Enabled, get=IsEnabled, set=Enable)
2768    %Property(name=TopLevel, get=IsTopLevel)
2769    %Property(name=MinClientSize, get=GetMinClientSize, set=SetMinClientSize)
2770    %Property(name=MaxClientSize, get=GetMaxClientSize, set=SetMaxClientSize)
2771    public:
2772    virtual wxWindow *GetMainWindowOfCompositeControl();
2773
2774
2775    protected:
2776    virtual void DoEnable(bool enable);
2777    virtual void DoGetPosition(int *x, int *y) const;
2778    virtual void DoGetSize(int *width, int *height) const;
2779    virtual void DoGetClientSize(int *width, int *height) const;
2780    virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags);
2781    virtual void DoSetClientSize(int width, int height);
2782    virtual void DoSetSizeHints( int minW, int minH, int maxW, int maxH, int incW, int incH );
2783    virtual wxSize DoGetBorderSize() const;
2784    virtual void DoMoveWindow(int x, int y, int width, int height);
2785    virtual void DoSetWindowVariant( wxWindowVariant variant);
2786    virtual wxBorder GetDefaultBorder() const;
2787    virtual wxBorder GetDefaultBorderForControl() const;
2788    virtual void DoFreeze();
2789    virtual void DoThaw();
2790    virtual bool TryBefore(wxEvent& event);
2791    virtual bool TryAfter(wxEvent& event);
2792
2793
2794    public:
2795
2796
2797        %ConvertToSubClassCode
2798            const wxClassInfo* info   = sipCpp->GetClassInfo();
2799            wxString           name   = info->GetClassName();
2800            bool               exists = sipFindType(name) != NULL;
2801            while (info && !exists) {
2802                info = info->GetBaseClass1();
2803                name = info->GetClassName();
2804                exists = sipFindType(name) != NULL;
2805            }
2806            if (info)
2807                sipType = sipFindType(name);
2808            else
2809                sipType = NULL;
2810        %End
2811
2812
2813
2814protected:
2815    virtual
2816    wxSize DoGetBestSize() const;
2817    %Docstring
2818        DoGetBestSize() -> Size
2819
2820        Implementation of GetBestSize() that can be overridden.
2821    %End
2822
2823    virtual
2824    wxSize DoGetBestClientSize() const;
2825    %Docstring
2826        DoGetBestClientSize() -> Size
2827
2828        Override this method to return the best size for a custom control.
2829    %End
2830
2831    void SendDestroyEvent();
2832    %Docstring
2833        SendDestroyEvent()
2834
2835        Generate wxWindowDestroyEvent for this window.
2836    %End
2837
2838    virtual
2839    bool ProcessEvent(
2840        wxEvent & event
2841    )   /ReleaseGIL/;
2842    %Docstring
2843        ProcessEvent(event) -> bool
2844
2845        This function is public in wxEvtHandler but protected in wxWindow
2846        because for wxWindows you should always call ProcessEvent() on the
2847        pointer returned by GetEventHandler() and not on the wxWindow object
2848        itself.
2849    %End
2850
2851};  // end of class wxWindow
2852
2853
2854%Extract(id=pycode_core)
2855def _Window_SetRect(self, rect):
2856    return self.SetSize(rect)
2857Window.SetRect = _Window_SetRect
2858del _Window_SetRect
2859%End
2860
2861%Extract(id=pycode_core)
2862Window.Rect = property(Window.GetRect, Window.SetRect)
2863%End
2864
2865%Extract(id=pycode_core)
2866def _Window_SetClientRect(self, rect):
2867    return self.SetClientSize(rect)
2868Window.SetClientRect = _Window_SetClientRect
2869del _Window_SetClientRect
2870%End
2871
2872%Extract(id=pycode_core)
2873Window.ClientRect = property(Window.GetClientRect, Window.SetClientRect)
2874%End
2875
2876%Extract(id=pycode_core)
2877Window.SetDimensions = wx.deprecated(Window.SetDimensions, 'Use SetSize instead.')
2878
2879%End
2880
2881%Extract(id=pycode_core)
2882def _Window___nonzero__(self):
2883    """
2884    Can be used to test if the C++ part of the window still exists, with
2885    code like this::
2886
2887        if theWindow:
2888            doSomething()
2889    """
2890    import wx.siplib
2891    return not wx.siplib.isdeleted(self)
2892Window.__nonzero__ = _Window___nonzero__
2893del _Window___nonzero__
2894%End
2895
2896%Extract(id=pycode_core)
2897Window.__bool__ = Window.__nonzero__
2898
2899%End
2900
2901%Extract(id=pycode_core)
2902def _Window_DestroyLater(self):
2903    """
2904    Schedules the window to be destroyed in the near future.
2905
2906    This should be used whenever Destroy could happen too soon, such
2907    as when there may still be events for this window or its children
2908    waiting in the event queue.
2909    """
2910    self.Hide()
2911    wx.GetApp().ScheduleForDestruction(self)
2912Window.DestroyLater = _Window_DestroyLater
2913del _Window_DestroyLater
2914%End
2915
2916%Extract(id=pycode_core)
2917def _Window_DLG_UNIT(self, dlg_unit):
2918    """
2919    A convenience wrapper for :meth:`ConvertDialogToPixels`.
2920    """
2921    is_wxType = isinstance(dlg_unit, (wx.Size, wx.Point))
2922    pix = self.ConvertDialogToPixels(dlg_unit)
2923    if not is_wxType:
2924        pix = tuple(pix)
2925    return pix
2926Window.DLG_UNIT = _Window_DLG_UNIT
2927del _Window_DLG_UNIT
2928%End
2929
2930%Extract(id=pycode_core)
2931def _Window_PostCreate(self, pre):
2932    pass
2933Window.PostCreate = wx.deprecated(_Window_PostCreate, "PostCreate is no longer necessary.")
2934del _Window_PostCreate
2935%End
2936
2937%Extract(id=pycode_core)
2938def _Window_GetPositionTuple(self):
2939    return self.GetPosition()
2940Window.GetPositionTuple = wx.deprecated(_Window_GetPositionTuple, "Use GetPosition instead")
2941del _Window_GetPositionTuple
2942%End
2943
2944%Extract(id=pycode_core)
2945def _Window_GetSizeTuple(self):
2946    return self.GetSize()
2947Window.GetSizeTuple = wx.deprecated(_Window_GetSizeTuple, "Use GetSize instead")
2948del _Window_GetSizeTuple
2949%End
2950
2951%Extract(id=pycode_core)
2952def _Window_MoveXY(self, x, y):
2953    return self.Move(x, y)
2954Window.MoveXY = wx.deprecated(_Window_MoveXY, "Use Move instead.")
2955del _Window_MoveXY
2956%End
2957
2958%Extract(id=pycode_core)
2959def _Window_SetSizeWH(self, w, h):
2960    return self.SetSize(w,h)
2961Window.SetSizeWH = wx.deprecated(_Window_SetSizeWH, "Use SetSize instead.")
2962del _Window_SetSizeWH
2963%End
2964
2965%Extract(id=pycode_core)
2966def _Window_SetVirtualSizeWH(self, w, h):
2967    return self.SetVirtualSize(w,h)
2968Window.SetVirtualSizeWH = wx.deprecated(_Window_SetVirtualSizeWH, "Use SetVirtualSize instead.")
2969del _Window_SetVirtualSizeWH
2970%End
2971
2972%Extract(id=pycode_core)
2973def _Window_GetVirtualSizeTuple(self):
2974    return self.GetVirtualSize()
2975Window.GetVirtualSizeTuple = wx.deprecated(_Window_GetVirtualSizeTuple, "Use GetVirtualSize instead.")
2976del _Window_GetVirtualSizeTuple
2977%End
2978
2979%Extract(id=pycode_core)
2980def _Window_SetToolTipString(self, string):
2981    return self.SetToolTip(string)
2982Window.SetToolTipString = wx.deprecated(_Window_SetToolTipString, "Use SetToolTip instead.")
2983del _Window_SetToolTipString
2984%End
2985
2986%Extract(id=pycode_core)
2987def _Window_ConvertDialogPointToPixels(self, point):
2988    return self.ConvertDialogToPixels(point)
2989Window.ConvertDialogPointToPixels = wx.deprecated(_Window_ConvertDialogPointToPixels, "Use ConvertDialogToPixels instead.")
2990del _Window_ConvertDialogPointToPixels
2991%End
2992
2993%Extract(id=pycode_core)
2994def _Window_ConvertDialogSizeToPixels(self, size):
2995    return self.ConvertDialogToPixels(point)
2996Window.ConvertDialogSizeToPixels = wx.deprecated(_Window_ConvertDialogSizeToPixels, "Use ConvertDialogToPixels instead.")
2997del _Window_ConvertDialogSizeToPixels
2998%End
2999
3000%Extract(id=pycode_core)
3001def _Window_SetSizeHintsSz(self, minSize, maxSize=wx.DefaultSize, incSize=wx.DefaultSize):
3002    return self.SetSizeHints(minSize, maxSize, incSize)
3003Window.SetSizeHintsSz = wx.deprecated(_Window_SetSizeHintsSz, "Use SetSizeHints instead.")
3004del _Window_SetSizeHintsSz
3005%End
3006
3007wxWindow * wxFindWindowAtPointer(
3008    wxPoint & pt   /Out/
3009);
3010%Docstring
3011    FindWindowAtPointer() -> (Window, pt)
3012
3013    Find the deepest window at the mouse pointer position, returning the
3014    window and current pointer position in screen coordinates.
3015%End
3016%PreMethodCode
3017    if (!wxPyCheckForApp()) return NULL;
3018%End
3019
3020wxWindow * wxGetActiveWindow();
3021%Docstring
3022    GetActiveWindow() -> Window
3023
3024    Gets the currently active window (implemented for MSW and GTK only
3025    currently, always returns NULL in the other ports).
3026%End
3027%PreMethodCode
3028    if (!wxPyCheckForApp()) return NULL;
3029%End
3030
3031wxWindow * wxGetTopLevelParent(
3032    wxWindow * window
3033);
3034%Docstring
3035    GetTopLevelParent(window) -> Window
3036
3037    Returns the first top level parent of the given window, or in other
3038    words, the frame or dialog containing it, or NULL.
3039%End
3040%PreMethodCode
3041    if (!wxPyCheckForApp()) return NULL;
3042%End
3043
3044%Extract(id=pycode_core)
3045class FrozenWindow(object):
3046    """
3047    A context manager to be used with Python 'with' statements
3048    that will freeze the given window for the duration of the
3049    with block.
3050    """
3051    def __init__(self, window):
3052        self._win = window
3053    def __enter__(self):
3054        self._win.Freeze()
3055        return self
3056    def __exit__(self, exc_type, exc_val, exc_tb):
3057        self._win.Thaw()
3058
3059%End
3060
3061%Extract(id=pycode_core)
3062def DLG_UNIT(win, dlg_unit, val2=None):
3063    """
3064    Convenience function for converting a wx.Point, wx.Size or
3065    (x,y) in dialog units to pixels, using the given window as a
3066    reference.
3067    """
3068    if val2 is not None:
3069        dlg_unit = (dlg_unit, val2)
3070    is_wxType = isinstance(dlg_unit, (wx.Size, wx.Point))
3071    pix = win.ConvertDialogToPixels(dlg_unit)
3072    if not is_wxType:
3073        pix = tuple(pix)
3074    return pix
3075
3076DLG_PNT = wx.deprecated(DLG_UNIT, "Use DLG_UNIT instead.")
3077DLG_SZE = wx.deprecated(DLG_UNIT, "Use DLG_UNIT instead.")
3078
3079%End
3080
3081class wxWindowList_iterator /Abstract/
3082{
3083    // the C++ implementation of this class
3084    %TypeHeaderCode
3085
3086        class wxWindowList_iterator {
3087        public:
3088            wxWindowList_iterator(wxWindowList::compatibility_iterator start)
3089                : m_node(start) {}
3090
3091            wxWindow* __next__() {
3092                wxWindow* obj = NULL;
3093                if (m_node) {
3094                    obj = (wxWindow*) m_node->GetData();
3095                    m_node = m_node->GetNext();
3096                }
3097                else {
3098                    PyErr_SetString(PyExc_StopIteration, "");
3099                }
3100                return (wxWindow*)obj;
3101            }
3102        private:
3103            wxWindowList::compatibility_iterator m_node;
3104        };
3105    %End
3106public:
3107    wxWindow* __next__();
3108    %MethodCode
3109        sipRes = sipCpp->__next__();
3110        if (PyErr_Occurred())
3111            return NULL;
3112    %End
3113};
3114
3115class wxWindowList
3116{
3117    %TypeHeaderCode
3118
3119    %End
3120public:
3121    SIP_SSIZE_T __len__();
3122    %MethodCode
3123        sipRes = sipCpp->size();
3124    %End
3125
3126    wxWindow* __getitem__(long index);
3127    %MethodCode
3128        if (0 > index)
3129            index += sipCpp->size();
3130
3131        if (index < sipCpp->size() && (0 <= index)) {
3132            wxWindowList::compatibility_iterator node = sipCpp->Item(index);
3133            if (node)
3134                sipRes = (wxWindow*)node->GetData();
3135        }
3136        else {
3137            wxPyErr_SetString(PyExc_IndexError, "sequence index out of range");
3138            sipError = sipErrorFail;
3139        }
3140    %End
3141
3142    int __contains__(const wxWindow* obj);
3143    %MethodCode
3144        wxWindowList::compatibility_iterator node;
3145        node = sipCpp->Find((wxWindow*)obj);
3146        sipRes = node != NULL;
3147    %End
3148
3149    wxWindowList_iterator* __iter__() /Factory/;
3150    %MethodCode
3151        sipRes =  new wxWindowList_iterator(sipCpp->GetFirst());
3152    %End
3153
3154    // TODO:  add support for index(value, [start, [stop]])
3155    int index(wxWindow* obj);
3156    %MethodCode
3157        int idx = sipCpp->IndexOf((wxWindow*)obj);
3158        if (idx == wxNOT_FOUND) {
3159            sipError = sipErrorFail;
3160            wxPyErr_SetString(PyExc_ValueError,
3161                              "sequence.index(x): x not in sequence");
3162        }
3163        sipRes = idx;
3164    %End
3165
3166
3167};
3168
3169%Extract(id=pycode_core)
3170def _WindowList___repr__(self):
3171    return "WindowList: " + repr(list(self))
3172WindowList.__repr__ = _WindowList___repr__
3173del _WindowList___repr__
3174%End
3175
3176
3177wxWindowList* GetTopLevelWindows()   /NoCopy/;
3178%Docstring
3179    GetTopLevelWindows() -> WindowList
3180
3181    Returns a list-like object of the the application's top-level windows,
3182    (frames,dialogs, etc.)
3183%End
3184%MethodCode
3185    PyErr_Clear();
3186    Py_BEGIN_ALLOW_THREADS
3187    sipRes = _GetTopLevelWindows_function();
3188    Py_END_ALLOW_THREADS
3189    if (PyErr_Occurred()) sipIsErr = 1;
3190%End
3191%ModuleCode
3192wxWindowList* _GetTopLevelWindows_function()
3193{
3194    return &wxTopLevelWindows;
3195}
3196%End
3197
3198%Extract(id=pycode_core)
3199PyWindow = wx.deprecated(Window, 'Use Window instead.')
3200
3201%End
3202
3203wxWindow* FindWindowById(long id,  const wxWindow* parent=NULL);
3204%Docstring
3205    FindWindowById(id, parent=None) -> Window
3206
3207    FindWindowById(id, parent=None) -> Window
3208
3209    Find the first window in the application with the given id. If parent
3210    is None, the search will start from all top-level frames and dialog
3211    boxes; if non-None, the search will be limited to the given window
3212    hierarchy. The search is recursive in both cases.
3213%End
3214%MethodCode
3215    PyErr_Clear();
3216    Py_BEGIN_ALLOW_THREADS
3217    sipRes = _FindWindowById_function(id, parent);
3218    Py_END_ALLOW_THREADS
3219    if (PyErr_Occurred()) sipIsErr = 1;
3220%End
3221%ModuleCode
3222wxWindow* _FindWindowById_function(long id, const wxWindow* parent)
3223{
3224    return wxWindow::FindWindowById(id, parent);
3225}
3226%End
3227
3228wxWindow* FindWindowByName(const wxString& name,  const wxWindow* parent=NULL);
3229%Docstring
3230    FindWindowByName(name, parent=None) -> Window
3231
3232    FindWindowByName(name, parent=None) -> Window
3233
3234    Find a window by its name (as given in a window constructor or Create
3235    function call). If parent is None, the search will start from all
3236    top-level frames and dialog boxes; if non-None, the search will be
3237    limited to the given window hierarchy. The search is recursive in both
3238    cases.
3239
3240    If no window with the name is found, wx.FindWindowByLabel is called.
3241%End
3242%MethodCode
3243    PyErr_Clear();
3244    Py_BEGIN_ALLOW_THREADS
3245    sipRes = _FindWindowByName_function(name, parent);
3246    Py_END_ALLOW_THREADS
3247    if (PyErr_Occurred()) sipIsErr = 1;
3248%End
3249%ModuleCode
3250wxWindow* _FindWindowByName_function(const wxString* name, const wxWindow* parent)
3251{
3252    return wxWindow::FindWindowByName(*name, parent);
3253}
3254%End
3255
3256wxWindow* FindWindowByLabel(const wxString& label,  const wxWindow* parent=NULL);
3257%Docstring
3258    FindWindowByLabel(label, parent=None) -> Window
3259
3260    FindWindowByLabel(label, parent=None) -> Window
3261
3262    Find a window by its label. Depending on the type of window, the label
3263    may be a window title or panel item label. If parent is None, the
3264    search will start from all top-level frames and dialog boxes; if
3265    non-None, the search will be limited to the given window
3266    hierarchy. The search is recursive in both cases.
3267%End
3268%MethodCode
3269    PyErr_Clear();
3270    Py_BEGIN_ALLOW_THREADS
3271    sipRes = _FindWindowByLabel_function(label, parent);
3272    Py_END_ALLOW_THREADS
3273    if (PyErr_Occurred()) sipIsErr = 1;
3274%End
3275%ModuleCode
3276wxWindow* _FindWindowByLabel_function(const wxString* label, const wxWindow* parent)
3277{
3278    return wxWindow::FindWindowByLabel(*label, parent);
3279}
3280%End
3281
3282
3283//---------------------------------------------------------------------------
3284
3285