1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: SWIG interface for wxWindow
7 // Created: 24-June-1997
9 // Copyright: (c) 2003 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
16 //---------------------------------------------------------------------------
21 MAKE_CONST_WXSTRING(PanelNameStr);
23 //---------------------------------------------------------------------------
27 DocStr(wxVisualAttributes,
28 "struct containing all the visual attributes of a control");
30 struct wxVisualAttributes
33 wxVisualAttributes() {}
34 ~wxVisualAttributes() {}
37 // the font used for control label/text inside it
40 // the foreground colour
43 // the background colour, may be wxNullColour if the controls background
44 // colour is not solid
53 wxWINDOW_VARIANT_NORMAL, // Normal size
54 wxWINDOW_VARIANT_SMALL, // Smaller size (about 25 % smaller than normal )
55 wxWINDOW_VARIANT_MINI, // Mini size (about 33 % smaller than normal )
56 wxWINDOW_VARIANT_LARGE, // Large size (about 25 % larger than normal )
63 wx.Window is the base class for all windows and represents any visible
64 object on the screen. All controls, top level windows and so on are
65 wx.Windows. Sizers and device contexts are not however, as they don't
66 appear on screen themselves.
72 wx.SIMPLE_BORDER: Displays a thin border around the window.
74 wx.DOUBLE_BORDER: Displays a double border. Windows and Mac only.
76 wx.SUNKEN_BORDER: Displays a sunken border.
78 wx.RAISED_BORDER: Displays a raised border.
80 wx.STATIC_BORDER: Displays a border suitable for a static
81 control. Windows only.
83 wx.NO_BORDER: Displays no border, overriding the default
84 border style for the window.
86 wx.TRANSPARENT_WINDOW: The window is transparent, that is, it
87 will not receive paint events. Windows only.
89 wx.TAB_TRAVERSAL: Use this to enable tab traversal for
92 wx.WANTS_CHARS: Use this to indicate that the window
93 wants to get all char/key events for
94 all keys - even for keys like TAB or
95 ENTER which are usually used for
96 dialog navigation and which wouldn't
97 be generated without this style. If
98 you need to use this style in order to
99 get the arrows or etc., but would
100 still like to have normal keyboard
101 navigation take place, you should
102 create and send a wxNavigationKeyEvent
103 in response to the key events for Tab
106 wx.NO_FULL_REPAINT_ON_RESIZE: Disables repainting the window
107 completely when its size is changed
108 - you will have to repaint the new
109 window area manually if you use this
110 style. As of version 2.5.1 this
111 style is on by default. Use
112 wx.FULL_REPAINT_ON_RESIZE to
115 wx.VSCROLL: Use this style to enable a vertical scrollbar.
117 wx.HSCROLL: Use this style to enable a horizontal scrollbar.
119 wx.ALWAYS_SHOW_SB: If a window has scrollbars, disable them
120 instead of hiding them when they are
121 not needed (i.e. when the size of the
122 window is big enough to not require
123 the scrollbars to navigate it). This
124 style is currently only implemented
125 for wxMSW and wxUniversal and does
126 nothing on the other platforms.
128 wx.CLIP_CHILDREN: Use this style to eliminate flicker caused by
129 the background being repainted, then
130 children being painted over
133 wx.FULL_REPAINT_ON_RESIZE: Use this style to force a complete
134 redraw of the window whenever it is
135 resized instead of redrawing just the
136 part of the window affected by
137 resizing. Note that this was the
138 behaviour by default before 2.5.1
139 release and that if you experience
140 redraw problems with the code which
141 previously used to work you may want
146 wx.WS_EX_VALIDATE_RECURSIVELY: By default,
147 Validate/TransferDataTo/FromWindow()
148 only work on direct children of
149 the window (compatible
150 behaviour). Set this flag to make
151 them recursively descend into all
154 wx.WS_EX_BLOCK_EVENTS: wx.CommandEvents and the objects of the
155 derived classes are forwarded to
156 the parent window and so on
157 recursively by default. Using this
158 flag for the given window allows
159 to block this propagation at this
160 window, i.e. prevent the events
161 from being propagated further
162 upwards. Dialogs have this flag on
165 wx.WS_EX_TRANSIENT Don't use this window as an implicit parent for
166 the other windows: this must be
167 used with transient windows as
168 otherwise there is the risk of
169 creating a dialog/frame with this
170 window as a parent which would
171 lead to a crash if the parent is
172 destroyed before the child.
174 wx.WS_EX_PROCESS_IDLE: This window should always process idle
175 events, even if the mode set by
176 wx.IdleEvent.SetMode is
177 wx.IDLE_PROCESS_SPECIFIED.
179 wx.WS_EX_PROCESS_UI_UPDATES This window should always process UI
180 update events, even if the mode
181 set by wxUpdateUIEvent::SetMode is
182 wxUPDATE_UI_PROCESS_SPECIFIED.
188 class wxWindow : public wxEvtHandler
191 %pythonAppend wxWindow "self._setOORInfo(self)"
192 %pythonAppend wxWindow() ""
194 RefDoc(wxWindow, ""); // turn it off for the ctors
197 wxWindow(wxWindow* parent, const wxWindowID id,
198 const wxPoint& pos = wxDefaultPosition,
199 const wxSize& size = wxDefaultSize,
201 const wxString& name = wxPyPanelNameStr),
202 "Construct and show a generic Window.");
206 "Precreate a Window for 2-phase creation.",
211 bool , Create(wxWindow* parent, const wxWindowID id,
212 const wxPoint& pos = wxDefaultPosition,
213 const wxSize& size = wxDefaultSize,
215 const wxString& name = wxPyPanelNameStr),
216 "Create the GUI part of the Window for 2-phase creation mode.");
219 // deleting the window
220 // -------------------
224 bool , Close( bool force = False ),
225 "This function simply generates a EVT_CLOSE event whose handler usually
226 tries to close the window. It doesn't close the window itself,
227 however. If force is False (the default) then the window's close
228 handler will be allowed to veto the destruction of the window.
230 Usually Close is only used with the top level windows (wx.Frame and
231 wx.Dialog classes) as the others are not supposed to have any special
234 The close handler should check whether the window is being deleted
235 forcibly, using wx.CloseEvent.GetForce, in which case it should
236 destroy the window using wx.Window.Destroy.
238 Note that calling Close does not guarantee that the window will be
239 destroyed; but it provides a way to simulate a manual close of a
240 window, which may or may not be implemented by destroying the
241 window. The default EVT_CLOSE handler for wx.Dialog does not
242 necessarily delete the dialog, since it will simply simulate an
243 wxID_CANCEL event which is handled by the appropriate button event
244 handler and may do anything at all.
246 To guarantee that the window will be destroyed, call wx.Window.Destroy
252 virtual bool , Destroy(),
253 "Destroys the window safely. Frames and dialogs are not destroyed
254 immediately when this function is called -- they are added to a list
255 of windows to be deleted on idle time, when all the window's events
256 have been processed. This prevents problems with events being sent to
257 non-existent windows.
259 Returns True if the window has either been successfully deleted, or it
260 has been added to the list of windows pending real deletion.");
264 bool , DestroyChildren(),
265 "Destroys all children of a window. Called automatically by the destructor.");
269 bool , IsBeingDeleted() const,
270 "Is the window in the process of being deleted?");
278 virtual void , SetTitle( const wxString& title),
279 "Sets the window's title. Applicable only to frames and dialogs.");
282 virtual wxString , GetTitle() const,
283 "Gets the window's title. Applicable only to frames and dialogs.");
287 virtual void , SetLabel(const wxString& label),
288 "Set the text which the window shows in its label if applicable.");
291 virtual wxString , GetLabel() const,
292 "Generic way of getting a label from any window, for
293 identification purposes. The interpretation of this function
294 differs from class to class. For frames and dialogs, the value
295 returned is the title. For buttons or static text controls, it is
296 the button text. This function can be useful for meta-programs
297 such as testing tools or special-needs access programs)which
298 need to identify windows by name.");
302 virtual void , SetName( const wxString &name ),
303 "Sets the window's name. The window name is used for ressource
304 setting in X, it is not the same as the window title/label");
307 virtual wxString , GetName() const,
308 "Returns the windows name. This name is not guaranteed to be
309 unique; it is up to the programmer to supply an appropriate name
310 in the window constructor or via wx.Window.SetName.");
314 void , SetWindowVariant( wxWindowVariant variant ),
315 "Sets the variant of the window/font size to use for this window,
316 if the platform supports variants, for example, wxMac. Variant values are:
318 wx.WINDOW_VARIANT_NORMAL Normal size
319 wx.WINDOW_VARIANT_SMALL Smaller size (about 25 % smaller than normal)
320 wx.WINDOW_VARIANT_MINI Mini size (about 33 % smaller than normal)
321 wx.WINDOW_VARIANT_LARGE Large size (about 25 % larger than normal)
325 wxWindowVariant , GetWindowVariant() const,
330 void , SetId( wxWindowID winid ),
331 "Sets the identifier of the window. Each window has an integer
332 identifier. If the application has not provided one, an identifier
333 will be generated. Normally, the identifier should be provided on
334 creation and should not be modified subsequently.");
337 wxWindowID , GetId() const,
338 "Returns the identifier of the window. Each window has an integer
339 identifier. If the application has not provided one (or the default Id
340 -1 is used) then an unique identifier with a negative value will be
345 static int , NewControlId(),
346 "Generate a control id for the controls which were not given one.");
350 static int , NextControlId(int winid),
351 "Get the id of the control following the one with the given\n"
352 "(autogenerated) id");
356 static int , PrevControlId(int winid),
357 "Get the id of the control preceding the one with the given\n"
358 "(autogenerated) id");
368 void , SetSize( const wxSize& size ),
369 "Sets the size of the window in pixels.");
373 void , SetSize( int x, int y, int width, int height,
374 int sizeFlags = wxSIZE_AUTO ),
375 "Sets the position and size of the window in pixels. The sizeFlags
376 parameter indicates the interpretation of the other params if they are
377 -1. wx.SIZE_AUTO*: a -1 indicates that a class-specific default
378 shoudl be used. wx.SIZE_USE_EXISTING: existing dimensions should be
379 used if -1 values are supplied. wxSIZE_ALLOW_MINUS_ONE: allow
380 dimensions of -1 and less to be interpreted as real dimensions, not
386 void , SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO),
387 "Sets the position and size of the window in pixels using a wx.Rect.",
392 void , SetSize( int width, int height ),
393 "Sets the size of the window in pixels.",
398 void , Move(const wxPoint& pt, int flags = wxSIZE_USE_EXISTING),
399 "Moves the window to the given position.");
401 %pythoncode { SetPosition = Move }
405 void , Move(int x, int y, int flags = wxSIZE_USE_EXISTING),
406 "Moves the window to the given position.",
412 virtual void , Raise(),
413 "Raises the window to the top of the window hierarchy if it is a
414 managed window (dialog or frame).");
417 virtual void , Lower(),
418 "Lowers the window to the bottom of the window hierarchy if it is a
419 managed window (dialog or frame).");
423 // client size is the size of the area available for subwindows
424 DocStr(SetClientSize,
425 "This sets the size of the window client area in pixels. Using this
426 function to size a window tends to be more device-independent than
427 wx.Window.SetSize, since the application need not worry about what
428 dimensions the border or title bar have when trying to fit the window
429 around panel items, for example.");
430 void SetClientSize( const wxSize& size );
431 %name(SetClientSizeWH) void SetClientSize( int width, int height );
432 %name(SetClientRect) void SetClientSize(const wxRect& rect);
435 DocStr(GetPosition, // sets the docstring for both
436 "Get the window's position.");
437 wxPoint GetPosition();
440 void, GetPosition(int *OUTPUT, int *OUTPUT),
441 "GetPositionTuple() -> (x,y)",
445 DocStr(GetSize, "Get the window size.");
446 wxSize GetSize() const;
448 void, GetSize( int *OUTPUT, int *OUTPUT ) const,
449 "GetSizeTuple() -> (width, height)",
455 wxRect , GetRect() const,
456 "Returns the size and position of the window as a wx.Rect object.");
459 DocStr(GetClientSize,
460 "This gets the size of the window's 'client area' in pixels. The client
461 area is the area which may be drawn on by the programmer, excluding
462 title bar, border, scrollbars, etc.");
463 wxSize GetClientSize() const;
465 void, GetClientSize( int *OUTPUT, int *OUTPUT ) const,
466 "GetClientSizeTuple() -> (width, height)",
472 virtual wxPoint , GetClientAreaOrigin() const,
473 "Get the origin of the client area of the window relative to the
474 window's top left corner (the client area may be shifted because of
475 the borders, scrollbars, other decorations...)");
479 wxRect , GetClientRect() const,
480 "Get the client area position and size as a wx.Rect object.");
485 "This functions returns the best acceptable minimal size for the
486 window, if applicable. For example, for a static text control, it will be
487 the minimal size such that the control label is not truncated. For
488 windows containing subwindows (suzh aswx.Panel), the size returned
489 by this function will be the same as the size the window would have
490 had after calling Fit.");
491 wxSize GetBestSize() const;
493 void, GetBestSize(int *OUTPUT, int *OUTPUT) const,
494 "GetBestSizeTuple() -> (width, height)",
499 wxSize , GetAdjustedBestSize() const,
500 "This method is similar to GetBestSize, except in one
501 thing. GetBestSize should return the minimum untruncated size of the
502 window, while this method will return the largest of BestSize and any
503 user specified minimum size. ie. it is the minimum size the window
504 should currently be drawn at, not the minimal size it can possibly
511 void , Center( int direction = wxBOTH ),
512 "Centers the window. The parameter specifies the direction for
513 cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may
514 also include wx.CENTER_ON_SCREEN flag if you want to center the window
515 on the entire screen and not on its parent window. If it is a
516 top-level window and has no parent then it will always be centered
517 relative to the screen.");
519 %pythoncode { Centre = Center }
523 void , CenterOnScreen(int dir = wxBOTH),
524 "Center on screen (only works for top level windows)");
525 %pythoncode { CentreOnScreen = CenterOnScreen }
529 void , CenterOnParent(int dir = wxBOTH),
530 "Center with respect to the the parent window");
531 %pythoncode { CentreOnParent = CenterOnParent }
536 virtual void , Fit(),
537 "Sizes the window so that it fits around its subwindows. This function
538 won't do anything if there are no subwindows and will only really work
539 correctly if sizers are used for the subwindows layout. Also, if the
540 window has exactly one subwindow it is better (faster and the result
541 is more precise as Fit adds some margin to account for fuzziness of
542 its calculations) to call window.SetClientSize(child.GetSize())
543 instead of calling Fit.");
547 virtual void , FitInside(),
548 "Similar to Fit, but sizes the interior (virtual) size of a
549 window. Mainly useful with scrolled windows to reset scrollbars after
550 sizing changes that do not trigger a size event, and/or scrolled
551 windows without an interior sizer. This function similarly won't do
552 anything if there are no subwindows.");
557 virtual void , SetSizeHints( int minW, int minH,
558 int maxW = -1, int maxH = -1,
559 int incW = -1, int incH = -1 ),
560 "Allows specification of minimum and maximum window sizes, and window
561 size increments. If a pair of values is not set (or set to -1), the
562 default values will be used. If this function is called, the user
563 will not be able to size the window outside the given bounds. The
564 resizing increments are only significant under Motif or Xt.");
568 virtual void , SetVirtualSizeHints( int minW, int minH,
569 int maxW = -1, int maxH = -1 ),
570 "Allows specification of minimum and maximum virtual window sizes. If a
571 pair of values is not set (or set to -1), the default values will be
572 used. If this function is called, the user will not be able to size
573 the virtual area of the window outside the given bounds.");
577 virtual int , GetMinWidth() const,
581 virtual int , GetMinHeight() const,
585 int , GetMaxWidth() const,
589 int , GetMaxHeight() const,
594 virtual wxSize , GetMaxSize() const,
599 DocStr(SetVirtualSize,
600 "Set the the virtual size of a window in pixels. For most windows this
601 is just the client area of the window, but for some like scrolled
602 windows it is more or less independent of the screen window size.");
603 void SetVirtualSize(const wxSize& size );
604 %name(SetVirtualSizeWH) void SetVirtualSize( int w, int h );
607 DocStr(GetVirtualSize,
608 "Get the the virtual size of the window in pixels. For most windows
609 this is just the client area of the window, but for some like scrolled
610 windows it is more or less independent of the screen window size.");
611 wxSize GetVirtualSize() const;
613 void, GetVirtualSize( int *OUTPUT, int *OUTPUT ) const,
614 "GetVirtualSizeTuple() -> (width, height)",
615 GetVirtualSizeTuple);
618 // TODO: using directors?
619 // // Override these methods for windows that have a virtual size
620 // // independent of their client size. eg. the virtual area of a
621 // // wxScrolledWindow. Default is to alias VirtualSize to ClientSize.
622 // virtual void DoSetVirtualSize( int x, int y );
623 // virtual wxSize DoGetVirtualSize() const; // { return m_virtualSize; }
627 virtual wxSize , GetBestVirtualSize() const,
628 "Return the largest of ClientSize and BestSize (as determined by a
629 sizer, interior children, or other means)");
637 virtual bool , Show( bool show = True ),
638 "Shows or hides the window. You may need to call Raise for a top level
639 window if you want to bring it to top, although this is not needed if
640 Show is called immediately after the frame creation. Returns True if
641 the window has been shown or hidden or False if nothing was done
642 because it already was in the requested state.");
646 "Equivalent to calling Show(False).");
650 virtual bool , Enable( bool enable = True ),
651 "Enable or disable the window for user input. Note that when a parent
652 window is disabled, all of its children are disabled as well and they
653 are reenabled again when the parent is. Returns true if the window
654 has been enabled or disabled, false if nothing was done, i.e. if the
655 window had already been in the specified state.");
659 "Disables the window, same as Enable(false).");
663 bool , IsShown() const,
664 "Returns true if the window is shown, false if it has been hidden.");
667 bool , IsEnabled() const,
668 "Returns true if the window is enabled for input, false otherwise.");
674 virtual void , SetWindowStyleFlag( long style ),
675 "Sets the style of the window. Please note that some styles cannot be
676 changed after the window creation and that Refresh() might be called
677 after changing the others for the change to take place immediately.");
680 virtual long , GetWindowStyleFlag() const,
681 "Gets the window style that was passed to the constructor or Create
684 %pythoncode { SetWindowStyle = SetWindowStyleFlag; GetWindowStyle = GetWindowStyleFlag }
688 bool , HasFlag(int flag) const,
689 "Test if the given style is set for this window.");
693 virtual bool , IsRetained() const,
694 "Returns true if the window is retained, false otherwise. Retained
695 windows are only available on X platforms.");
700 virtual void , SetExtraStyle(long exStyle),
701 "Sets the extra style bits for the window. Extra styles are the less
702 often used style bits which can't be set with the constructor or with
703 SetWindowStyleFlag()");
706 long , GetExtraStyle() const,
707 "Returns the extra style bits for the window.");
712 virtual void , MakeModal(bool modal = True),
713 "Disables all other windows in the application so that the user can
714 only interact with this window. Passing False will reverse this
720 virtual void , SetThemeEnabled(bool enableTheme),
721 "This function tells a window if it should use the system's \"theme\"
722 code to draw the windows' background instead if its own background
723 drawing code. This will only have an effect on platforms that support
724 the notion of themes in user defined windows. One such platform is
725 GTK+ where windows can have (very colourful) backgrounds defined by a
726 user's selected theme.
728 Dialogs, notebook pages and the status bar have this flag set to true
729 by default so that the default look and feel is simulated best.");
732 virtual bool , GetThemeEnabled() const,
733 "Return the themeEnabled flag.");
736 // TODO with directors
737 // // controls by default inherit the colours of their parents, if a
738 // // particular control class doesn't want to do it, it can override
739 // // ShouldInheritColours() to return False
740 // virtual bool ShouldInheritColours() const;
746 // focus and keyboard handling
747 // ---------------------------
751 virtual void , SetFocus(),
752 "Set's the focus to this window, allowing it to receive keyboard input.");
755 virtual void , SetFocusFromKbd(),
756 "Set focus to this window as the result of a keyboard action. Normally
757 only called internally.");
762 static wxWindow *, FindFocus(),
763 "Returns the window or control that currently has the keyboard focus,
768 virtual bool , AcceptsFocus() const,
769 "Can this window have focus?");
773 virtual bool , AcceptsFocusFromKeyboard() const,
774 "Can this window be given focus by keyboard navigation? if not, the
775 only way to give it focus (provided it accepts it at all) is to click
782 virtual wxWindow *, GetDefaultItem() const,
783 "Get the default child of this parent, i.e. the one which is activated
784 by pressing <Enter> such as the OK button on a wx.Dialog.");
787 virtual wxWindow *, SetDefaultItem(wxWindow * child),
788 "Set this child as default, return the old default.");
791 virtual void , SetTmpDefaultItem(wxWindow * win),
792 "Set this child as temporary default");
798 // parent/children relations
799 // -------------------------
802 //wxWindowList& GetChildren(); // TODO: Do a typemap or a wrapper for wxWindowList
805 "Returns a list of the window's children. NOTE: Currently this is a
806 copy of the child window list maintained by the window, so the return
807 value of this function is only valid as long as the window's children
809 PyObject* GetChildren() {
810 wxWindowList& list = self->GetChildren();
811 return wxPy_ConvertList(&list);
816 wxWindow *, GetParent() const,
817 "Returns the parent window of this window, or None if there isn't one.");
820 wxWindow *, GetGrandParent() const,
821 "Returns the parent of the parent of this window, or None if there isn't one.");
826 virtual bool , IsTopLevel() const,
827 "Returns true if the given window is a top-level one. Currently all
828 frames and dialogs are always considered to be top-level windows (even
829 if they have a parent window).");
832 // change the real parent of this window, return True if the parent
833 // was changed, False otherwise (error or newParent == oldParent)
835 virtual bool , Reparent( wxWindow *newParent ),
836 "Reparents the window, i.e the window will be removed from its current
837 parent window (e.g. a non-standard toolbar in a wxFrame) and then
838 re-inserted into another. Available on Windows and GTK. Returns True
839 if the parent was changed, False otherwise (error or newParent ==
844 virtual void , AddChild( wxWindow *child ),
845 "Adds a child window. This is called automatically by window creation
846 functions so should not be required by the application programmer.");
849 virtual void , RemoveChild( wxWindow *child ),
850 "Removes a child window. This is called automatically by window
851 deletion functions so should not be required by the application
857 // looking for windows
858 // -------------------
861 wxWindow *, FindWindow( long winid ),
862 "Find a chld of this window by window ID",
866 wxWindow *, FindWindow( const wxString& name ),
867 "Find a child of this window by name",
872 // event handler stuff
873 // -------------------
876 wxEvtHandler *, GetEventHandler() const,
877 "Returns the event handler for this window. By default, the window is
878 its own event handler.");
882 void , SetEventHandler( wxEvtHandler *handler ),
883 "Sets the event handler for this window. An event handler is an object
884 that is capable of processing the events sent to a window. By default,
885 the window is its own event handler, but an application may wish to
886 substitute another, for example to allow central implementation of
887 event-handling for a variety of different window classes.
889 It is usually better to use wx.Window.PushEventHandler since this sets
890 up a chain of event handlers, where an event not handled by one event
891 handler is handed to the next one in the chain.");
895 void , PushEventHandler( wxEvtHandler *handler ),
896 "Pushes this event handler onto the event handler stack for the window.
897 An event handler is an object that is capable of processing the events
898 sent to a window. By default, the window is its own event handler, but
899 an application may wish to substitute another, for example to allow
900 central implementation of event-handling for a variety of different
903 wx.Window.PushEventHandler allows an application to set up a chain of
904 event handlers, where an event not handled by one event handler is
905 handed to the next one in the chain. Use wx.Window.PopEventHandler to
906 remove the event handler.");
910 wxEvtHandler *, PopEventHandler( bool deleteHandler = False ),
911 "Removes and returns the top-most event handler on the event handler
912 stack. If deleteHandler is True then the wx.EvtHandler object will be
913 destroyed after it is popped.");
917 bool , RemoveEventHandler(wxEvtHandler *handler),
918 "Find the given handler in the event handler chain and remove (but
919 not delete) it from the event handler chain, return True if it was
920 found and False otherwise (this also results in an assert failure so
921 this function should only be called when the handler is supposed to
930 // a window may have an associated validator which is used to control
933 virtual void , SetValidator( const wxValidator &validator ),
934 "Deletes the current validator (if any) and sets the window validator,
935 having called wx.Validator.Clone to create a new validator of this
939 virtual wxValidator *, GetValidator(),
940 "Returns a pointer to the current validator for the window, or None if
945 virtual bool , Validate(),
946 "Validates the current values of the child controls using their
947 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY
948 extra style flag set, the method will also call Validate() of all
949 child windows. Returns false if any of the validations failed.");
953 virtual bool , TransferDataToWindow(),
954 "Transfers values to child controls from data areas specified by
955 their validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY
956 extra style flag set, the method will also call
957 TransferDataToWindow() of all child windows.");
960 virtual bool , TransferDataFromWindow(),
961 "Transfers values from child controls to data areas specified by
962 their validators. Returns false if a transfer failed. If the
963 window has wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the
964 method will also call TransferDataFromWindow() of all child
969 virtual void , InitDialog(),
970 "Sends an EVT_INIT_DIALOG event, whose handler usually transfers
971 data to the dialog via validators.");
980 virtual void , SetAcceleratorTable( const wxAcceleratorTable& accel ),
981 "Sets the accelerator table for this window.");
984 wxAcceleratorTable *, GetAcceleratorTable(),
985 "Gets the accelerator table for this window.");
991 // hot keys (system wide accelerators)
992 // -----------------------------------
994 DocStr(RegisterHotKey,
995 "Registers a system wide hotkey. Every time the user presses the hotkey
996 registered here, this window will receive a hotkey event. It will
997 receive the event even if the application is in the background and
998 does not have the input focus because the user is working with some
999 other application. To bind an event handler function to this hotkey
1000 use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the
1001 hotkey was registered successfully.");
1002 bool RegisterHotKey(int hotkeyId, int modifiers, int keycode) {
1004 return self->RegisterHotKey(hotkeyId, modifiers, keycode);
1011 DocStr(UnregisterHotKey,
1012 "Unregisters a system wide hotkey.");
1013 bool UnregisterHotKey(int hotkeyId) {
1015 return self->UnregisterHotKey(hotkeyId);
1024 // "dialog units" translations
1025 // ---------------------------
1027 DocStr(ConvertDialogToPixels,
1028 "Converts a point or size from dialog units to pixels. Dialog units
1029 are used for maintaining a dialog's proportions even if the font
1030 changes. For the x dimension, the dialog units are multiplied by the
1031 average character width and then divided by 4. For the y dimension,
1032 the dialog units are multiplied by the average character height and
1033 then divided by 8.");
1034 %name(ConvertDialogPointToPixels) wxPoint ConvertDialogToPixels(const wxPoint& pt);
1035 %name(ConvertDialogSizeToPixels) wxSize ConvertDialogToPixels(const wxSize& sz);
1036 %name(DLG_PNT) wxPoint ConvertDialogToPixels(const wxPoint& pt);
1037 %name(DLG_SZE) wxSize ConvertDialogToPixels(const wxSize& sz);
1040 DocStr(ConvertPixelPointToDialog,
1041 "Converts a point or size from pixels to dialog units. Dialog units
1042 are used for maintaining a dialog's proportions even if the font
1043 changes. For the x dimension, the dialog units are multiplied by the
1044 average character width and then divided by 4. For the y dimension,
1045 the dialog units are multiplied by the average character height and
1046 then divided by 8.");
1047 %name(ConvertPixelPointToDialog) wxPoint ConvertPixelsToDialog(const wxPoint& pt);
1048 %name(ConvertPixelSizeToDialog) wxSize ConvertPixelsToDialog(const wxSize& sz);
1056 virtual void , WarpPointer(int x, int y),
1057 "Moves the pointer to the given position on the window.
1059 NOTE: This function is not supported under Mac because Apple Human
1060 Interface Guidelines forbid moving the mouse cursor programmatically.");
1064 void , CaptureMouse(),
1065 "Directs all mouse input to this window. Call wx.Window.ReleaseMouse to
1066 release the capture.
1068 Note that wxWindows maintains the stack of windows having captured the
1069 mouse and when the mouse is released the capture returns to the window
1070 which had had captured it previously and it is only really released if
1071 there were no previous window. In particular, this means that you must
1072 release the mouse as many times as you capture it.");
1075 void , ReleaseMouse(),
1076 "Releases mouse input captured with wx.Window.CaptureMouse.");
1080 static wxWindow *, GetCapture(),
1081 "Returns the window which currently captures the mouse or None");
1085 virtual bool , HasCapture() const,
1086 "Returns true if this window has the current mouse capture.");
1092 // painting the window
1093 // -------------------
1096 virtual void , Refresh( bool eraseBackground = True,
1097 const wxRect *rect = NULL ),
1098 "Mark the specified rectangle (or the whole window) as \"dirty\" so it
1099 will be repainted. Causes an EVT_PAINT event to be generated and sent
1104 void , RefreshRect(const wxRect& rect),
1105 "Redraws the contents of the given rectangle: the area inside it will
1106 be repainted. This is the same as Refresh but has a nicer syntax.");
1110 virtual void , Update(),
1111 "Calling this method immediately repaints the invalidated area of the
1112 window instead of waiting for the EVT_PAINT event to happen, (normally
1113 this would usually only happen when the flow of control returns to the
1114 event loop.) Notice that this function doesn't refresh the window and
1115 does nothing if the window has been already repainted. Use Refresh
1116 first if you want to immediately redraw the window (or some portion of
1117 it) unconditionally.");
1121 virtual void , ClearBackground(),
1122 "Clears the window by filling it with the current background
1123 colour. Does not cause an erase background event to be generated.");
1128 virtual void , Freeze(),
1129 "Freezes the window or, in other words, prevents any updates from taking place
1130 on screen, the window is not redrawn at all. Thaw must be called to reenable
1131 window redrawing. Calls to Freeze/Thaw may be nested, with the actual Thaw
1132 being delayed until all the nesting has been undone.
1134 This method is useful for visual appearance optimization (for example,
1135 it is a good idea to use it before inserting large amount of text into
1136 a wxTextCtrl under wxGTK) but is not implemented on all platforms nor
1137 for all controls so it is mostly just a hint to wxWindows and not a
1138 mandatory directive.");
1142 virtual void , Thaw(),
1143 "Reenables window updating after a previous call to Freeze. Calls to
1144 Freeze/Thaw may be nested, so Thaw must be called the same number of times
1145 that Freeze was before the window will be updated.");
1149 virtual void , PrepareDC( wxDC & dc ),
1150 "Call this function to prepare the device context for drawing a
1151 scrolled image. It sets the device origin according to the current
1156 wxRegion& , GetUpdateRegion(),
1157 "Returns the region specifying which parts of the window have been
1158 damaged. Should only be called within an EVT_PAINT handler.");
1162 wxRect , GetUpdateClientRect() const,
1163 "Get the update rectangle region bounding box in client coords.");
1167 "Returns true if the given point or rectangle area has been exposed
1168 since the last repaint. Call this in an paint event handler to
1169 optimize redrawing by only redrawing those areas, which have been
1171 bool IsExposed( int x, int y, int w=1, int h=1 ) const;
1172 %name(IsExposedPoint) bool IsExposed( const wxPoint& pt ) const;
1173 %name(IsExposedRect) bool IsExposed( const wxRect& rect ) const;
1177 // colours, fonts and cursors
1178 // --------------------------
1182 wxVisualAttributes , GetDefaultAttributes() const,
1183 "Get the default attributes for an instance of this class. This
1184 is useful if you want to use the same font or colour in your own
1185 control as in a standard control -- which is a much better idea
1186 than hard coding specific colours or fonts which might look
1187 completely out of place on the users system, especially if it
1192 static wxVisualAttributes ,
1193 GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL),
1194 "Get the default attributes for this class. This is useful if
1195 you want to use the same font or colour in your own control as
1196 in a standard control -- which is a much better idea than hard
1197 coding specific colours or fonts which might look completely out
1198 of place on the users system, especially if it uses themes.
1200 The variant parameter is only relevant under Mac currently and is
1201 ignore under other platforms. Under Mac, it will change the size of the
1202 returned font. See SetWindowVariant for more about this.");
1206 virtual bool , SetBackgroundColour( const wxColour &colour ),
1207 "Sets the background colour of the window. Returns True if the colour
1208 was changed. The background colour is usually painted by the default
1209 EVT_ERASE_BACKGROUND event handler function under Windows and
1210 automatically under GTK.
1212 Note that setting the background colour does not cause an immediate
1213 refresh, so you may wish to call ClearBackground or Refresh after
1214 calling this function.
1216 Use this function with care under GTK+ as the new appearance of the
1217 window might not look equally well when used with themes, i.e GTK+'s
1218 ability to change its look as the user wishes with run-time loadable
1222 virtual bool , SetForegroundColour( const wxColour &colour ),
1223 "Sets the foreground colour of the window. Returns True is the colour
1224 was changed. The interpretation of foreground colour is dependent on
1225 the window class; it may be the text colour or other colour, or it may
1226 not be used at all.");
1230 wxColour , GetBackgroundColour() const,
1231 "Returns the background colour of the window.");
1234 wxColour , GetForegroundColour() const,
1235 "Returns the foreground colour of the window. The interpretation of
1236 foreground colour is dependent on the window class; it may be the text
1237 colour or other colour, or it may not be used at all.");
1243 virtual bool , SetCursor( const wxCursor &cursor ),
1244 "Sets the window's cursor. Notice that the window cursor also sets it
1245 for the children of the window implicitly.
1247 The cursor may be wx.NullCursor in which case the window cursor will
1248 be reset back to default.");
1251 wxCursor& , GetCursor(),
1252 "Return the cursor associated with this window.");
1257 virtual bool , SetFont( const wxFont &font ),
1258 "Sets the font for this window.");
1261 wxFont& , GetFont(),
1262 "Returns the default font used for this window.");
1267 void , SetCaret(wxCaret *caret),
1268 "Sets the caret associated with the window.");
1271 wxCaret *, GetCaret() const,
1272 "Returns the caret associated with the window.");
1277 virtual int , GetCharHeight() const,
1278 "Get the (average) character size for the current font.");
1281 virtual int , GetCharWidth() const,
1282 "Get the (average) character size for the current font.");
1287 void, GetTextExtent(const wxString& string, int *OUTPUT, int *OUTPUT),
1288 "GetTextExtent(String string) -> (width, height)",
1289 "Get the width and height of the text using the current font.");
1291 void, GetTextExtent(const wxString& string,
1292 int *OUTPUT, int *OUTPUT, int *OUTPUT, int* OUTPUT,
1293 const wxFont* font = NULL),
1294 "GetFullTextExtent(String string, Font font=None) ->\n (width, height, descent, externalLeading)",
1295 "Get the width, height, decent and leading of the text using the
1296 current or specified font.",
1301 // client <-> screen coords
1302 // ------------------------
1304 %apply int * INOUT { int* x, int* y };
1306 // translate to/from screen/client coordinates
1308 void , ClientToScreen( int *x, int *y ) const,
1309 "ClientToScreenXY(int x, int y) -> (x,y)",
1310 "Converts to screen coordinates from coordinates relative to this window.",
1314 void , ScreenToClient( int *x, int *y ) const,
1315 "ScreenToClientXY(int x, int y) -> (x,y)",
1316 "Converts from screen to client window coordinates.",
1321 wxPoint , ClientToScreen(const wxPoint& pt) const,
1322 "Converts to screen coordinates from coordinates relative to this window.");
1325 wxPoint , ScreenToClient(const wxPoint& pt) const,
1326 "Converts from screen to client window coordinates.");
1331 wxHitTest , HitTest(wxCoord x, wxCoord y) const,
1332 "Test where the given (in client coords) point lies",
1336 wxHitTest , HitTest(const wxPoint& pt) const,
1337 "Test where the given (in client coords) point lies");
1345 %nokwargs GetBorder;
1347 wxBorder , GetBorder(long flags) const,
1348 "Get the window border style from the given flags: this is different
1349 from simply doing flags & wxBORDER_MASK because it uses
1350 GetDefaultBorder() to translate wxBORDER_DEFAULT to something
1355 wxBorder , GetBorder() const,
1356 "Get border for the flags of this window");
1362 virtual void , UpdateWindowUI(long flags = wxUPDATE_UI_NONE),
1363 "This function sends EVT_UPDATE_UI events to the window. The particular
1364 implementation depends on the window; for example a wx.ToolBar will
1365 send an update UI event for each toolbar button, and a wx.Frame will
1366 send an update UI event for each menubar menu item. You can call this
1367 function from your application to ensure that your UI is up-to-date at
1368 a particular point in time (as far as your EVT_UPDATE_UI handlers are
1369 concerned). This may be necessary if you have called
1370 wx.UpdateUIEvent.SetMode or wx.UpdateUIEvent.SetUpdateInterval to
1371 limit the overhead that wxWindows incurs by sending update UI events
1374 The flags should be a bitlist of one or more of the following values:
1376 wx.UPDATE_UI_NONE No particular value
1377 wx.UPDATE_UI_RECURSE Call the function for descendants
1378 wx.UPDATE_UI_FROMIDLE Invoked from OnIdle
1380 If you are calling this function from an OnIdle function, make sure
1381 you pass the wx.UPDATE_UI_FROMIDLE flag, since this tells the window to
1382 only update the UI elements that need to be updated in idle time. Some
1383 windows update their elements only when necessary, for example when a
1384 menu is about to be shown. The following is an example of how to call
1385 UpdateWindowUI from an idle function.
1387 def OnIdle(self, evt):
1388 if wx.UpdateUIEvent.CanUpdate(self):
1389 self.UpdateWindowUI(wx.UPDATE_UI_FROMIDLE);
1393 // TODO: using directors?
1394 // // do the window-specific processing after processing the update event
1395 // virtual void DoUpdateWindowUI(wxUpdateUIEvent& event) ;
1399 "Pops up the given menu at the specified coordinates, relative to this
1400 window, and returns control when the user has dismissed the menu. If a
1401 menu item is selected, the corresponding menu event is generated and
1402 will be processed as usual.");
1403 %name(PopupMenuXY) bool PopupMenu(wxMenu *menu, int x, int y);
1404 bool PopupMenu(wxMenu *menu, const wxPoint& pos);
1411 "Returns the platform-specific handle (as a long integer) of the
1412 physical window. Currently on wxMac it returns the handle of the
1413 toplevel parent of the window.");
1415 return wxPyGetWinHandle(self);
1422 // A way to do the native draw first... Too bad it isn't in wxGTK too.
1423 void OnPaint(wxPaintEvent& event);
1433 bool , HasScrollbar(int orient) const,
1434 "Does the window have the scrollbar for this orientation?");
1437 // configure the window scrollbars
1439 virtual void , SetScrollbar( int orientation,
1443 bool refresh = True ),
1444 "Sets the scrollbar properties of a built-in scrollbar.
1446 orientation: Determines the scrollbar whose page size is to be
1447 set. May be wx.HORIZONTAL or wx.VERTICAL.
1449 position: The position of the scrollbar in scroll units.
1451 thumbSize: The size of the thumb, or visible portion of the
1452 scrollbar, in scroll units.
1454 range: The maximum position of the scrollbar.
1456 refresh: True to redraw the scrollbar, false otherwise.");
1459 virtual void , SetScrollPos( int orientation, int pos, bool refresh = True ),
1460 "Sets the position of one of the built-in scrollbars.");
1463 virtual int , GetScrollPos( int orientation ) const,
1464 "Returns the built-in scrollbar position.");
1467 virtual int , GetScrollThumb( int orientation ) const,
1468 "Returns the built-in scrollbar thumb size.");
1471 virtual int , GetScrollRange( int orientation ) const,
1472 "Returns the built-in scrollbar range.");
1478 virtual void , ScrollWindow( int dx, int dy,
1479 const wxRect* rect = NULL ),
1480 "Physically scrolls the pixels in the window and move child windows
1481 accordingly. Use this function to optimise your scrolling
1482 implementations, to minimise the area that must be redrawn. Note that
1483 it is rarely required to call this function from a user program.
1485 dx: Amount to scroll horizontally.
1487 dy: Amount to scroll vertically.
1489 rect: Rectangle to invalidate. If this is None, the whole window
1490 is invalidated. If you pass a rectangle corresponding to the
1491 area of the window exposed by the scroll, your painting
1492 handler can optimize painting by checking for the
1493 invalidated region.");
1497 virtual bool , ScrollLines(int lines),
1498 "If the platform and window class supports it, scrolls the window by
1499 the given number of lines down, if lines is positive, or up if lines
1500 is negative. Returns True if the window was scrolled, False if it was
1501 already on top/bottom and nothing was done.");
1504 virtual bool , ScrollPages(int pages),
1505 "If the platform and window class supports it, scrolls the window by
1506 the given number of pages down, if pages is positive, or up if pages
1507 is negative. Returns True if the window was scrolled, False if it was
1508 already on top/bottom and nothing was done.");
1513 "This is just a wrapper for ScrollLines(-1).");
1517 "This is just a wrapper for ScrollLines(1).");
1521 "This is just a wrapper for ScrollPages(-1).");
1525 "This is just a wrapper for ScrollPages(1).");
1530 // context-sensitive help
1531 // ----------------------
1534 void , SetHelpText(const wxString& text),
1535 "Sets the help text to be used as context-sensitive help for this
1536 window. Note that the text is actually stored by the current
1537 wxHelpProvider implementation, and not in the window object itself.");
1541 void , SetHelpTextForId(const wxString& text),
1542 "Associate this help text with all windows with the same id as this
1547 wxString , GetHelpText() const,
1548 "Gets the help text to be used as context-sensitive help for this
1549 window. Note that the text is actually stored by the current
1550 wxHelpProvider implementation, and not in the window object itself.");
1559 "Attach a tooltip to the window.");
1560 %name(SetToolTipString) void SetToolTip( const wxString &tip );
1561 void SetToolTip( wxToolTip *tip );
1564 wxToolTip* , GetToolTip() const,
1565 "get the associated tooltip or None if none");
1567 // LINK ERROR --> wxString GetToolTipText() const;
1576 // set/retrieve the drop target associated with this window (may be
1577 // NULL; it's owned by the window and will be deleted by it)
1578 %apply SWIGTYPE *DISOWN { wxPyDropTarget *dropTarget };
1581 virtual void , SetDropTarget( wxPyDropTarget *dropTarget ),
1582 "Associates a drop target with this window. If the window already has
1583 a drop target, it is deleted.");
1585 %clear wxPyDropTarget *dropTarget;
1589 virtual wxPyDropTarget *, GetDropTarget() const,
1590 "Returns the associated drop target, which may be None.");
1593 #ifdef __WXMSW__ // TODO: should I drop-kick this?
1595 void , DragAcceptFiles(bool accept),
1596 "Enables or disables eligibility for drop file events, EVT_DROP_FILES.
1597 Only available on Windows.");
1602 // constraints and sizers
1603 // ----------------------
1605 // set the constraints for this window or retrieve them (may be NULL)
1607 void , SetConstraints( wxLayoutConstraints *constraints ),
1608 "Sets the window to have the given layout constraints. If an existing
1609 layout constraints object is already owned by the window, it will be
1610 deleted. Pass None to disassociate and delete the window's current
1613 You must call SetAutoLayout to tell a window to use the constraints
1614 automatically in its default EVT_SIZE handler; otherwise, you must
1615 handle EVT_SIZE yourself and call Layout() explicitly. When setting
1616 both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have
1620 wxLayoutConstraints *, GetConstraints() const,
1621 "Returns a pointer to the window's layout constraints, or None if there
1626 void , SetAutoLayout( bool autoLayout ),
1627 "Determines whether the Layout function will be called automatically
1628 when the window is resized. It is called implicitly by SetSizer but
1629 if you use SetConstraints you should call it manually or otherwise the
1630 window layout won't be correctly updated when its size changes.");
1633 bool , GetAutoLayout() const,
1634 "Returns the current autoLayout setting");
1638 virtual bool , Layout(),
1639 "Invokes the constraint-based layout algorithm or the sizer-based
1640 algorithm for this window. See SetAutoLayout: when auto layout is on,
1641 this function gets called automatically by the default EVT_SIZE
1642 handler when the window is resized.");
1646 void , SetSizer(wxSizer *sizer, bool deleteOld = True ),
1647 "Sets the window to have the given layout sizer. The window will then
1648 own the object, and will take care of its deletion. If an existing
1649 layout sizer object is already owned by the window, it will be deleted
1650 if the deleteOld parameter is true. Note that this function will also
1651 call SetAutoLayout implicitly with a True parameter if the sizer is
1652 non-NoneL and False otherwise.");
1655 void , SetSizerAndFit( wxSizer *sizer, bool deleteOld = True ),
1656 "The same as SetSizer, except it also sets the size hints for the
1657 window based on the sizer's minimum size.");
1661 wxSizer *, GetSizer() const,
1662 "Return the sizer associated with the window by a previous call to
1663 SetSizer or None if there isn't one.");
1666 // Track if this window is a member of a sizer
1668 void , SetContainingSizer(wxSizer* sizer),
1669 "This normally does not need to be called by application code. It is
1670 called internally when a window is added to a sizer, and is used so
1671 the window can remove itself from the sizer when it is destroyed.");
1674 wxSizer *, GetContainingSizer() const,
1675 "Return the sizer that this window is a member of, if any, otherwise None.");
1681 // ----------------------
1682 #if wxUSE_ACCESSIBILITY
1683 // Override to create a specific accessible object.
1684 virtual wxAccessible* CreateAccessible();
1686 // Sets the accessible object.
1687 void SetAccessible(wxAccessible* accessible) ;
1689 // Returns the accessible object.
1690 wxAccessible* GetAccessible() { return m_accessible; };
1692 // Returns the accessible object, creating if necessary.
1693 wxAccessible* GetOrCreateAccessible() ;
1699 def PostCreate(self, pre):
1701 Phase 3 of the 2-phase create <wink!>
1702 Call this method after precreating the window with the 2-phase create method.
1704 self.this = pre.this
1705 self.thisown = pre.thisown
1707 if hasattr(self, '_setOORInfo'):
1708 self._setOORInfo(self)
1709 if hasattr(self, '_setCallbackInfo'):
1710 self._setCallbackInfo(self, self.__class__)
1722 def DLG_PNT(win, point_or_x, y=None):
1724 Convenience function for converting a Point or (x,y) in
1725 dialog units to pixel units.
1728 return win.ConvertDialogPointToPixels(point_or_x)
1730 return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y))
1732 def DLG_SZE(win, size_width, height=None):
1734 Convenience function for converting a Size or (w,h) in
1735 dialog units to pixel units.
1738 return win.ConvertDialogSizeToPixels(size_width)
1740 return win.ConvertDialogSizeToPixels(wx.Size(size_width, height))
1746 // Unfortunatly the names of these new static methods clash with the
1747 // names wxPython has been using forever for the overloaded
1748 // wxWindow::FindWindow, so instead of swigging them as statics create
1749 // standalone functions for them.
1752 DocStr(wxFindWindowById,
1753 "Find the first window in the application with the given id. If parent
1754 is None, the search will start from all top-level frames and dialog
1755 boxes; if non-None, the search will be limited to the given window
1756 hierarchy. The search is recursive in both cases.");
1758 DocStr(wxFindWindowByName,
1759 "Find a window by its name (as given in a window constructor or Create
1760 function call). If parent is None, the search will start from all
1761 top-level frames and dialog boxes; if non-None, the search will be
1762 limited to the given window hierarchy. The search is recursive in both
1765 If no window with such name is found, wx.FindWindowByLabel is called.");
1767 DocStr(wxFindWindowByLabel,
1768 "Find a window by its label. Depending on the type of window, the label
1769 may be a window title or panel item label. If parent is None, the
1770 search will start from all top-level frames and dialog boxes; if
1771 non-None, the search will be limited to the given window
1772 hierarchy. The search is recursive in both cases.");
1776 wxWindow* wxFindWindowById( long id, const wxWindow *parent = NULL ) {
1777 return wxWindow::FindWindowById(id, parent);
1780 wxWindow* wxFindWindowByName( const wxString& name,
1781 const wxWindow *parent = NULL ) {
1782 return wxWindow::FindWindowByName(name, parent);
1785 wxWindow* wxFindWindowByLabel( const wxString& label,
1786 const wxWindow *parent = NULL ) {
1787 return wxWindow::FindWindowByLabel(label, parent);
1795 #include <wx/msw/private.h> // to get wxGetWindowId
1800 wxWindow* wxWindow_FromHWND(wxWindow* parent, unsigned long _hWnd) {
1802 WXHWND hWnd = (WXHWND)_hWnd;
1803 long id = wxGetWindowId(hWnd);
1804 wxWindow* win = new wxWindow;
1805 parent->AddChild(win);
1806 win->SetEventHandler(win);
1809 win->SubclassWin(hWnd);
1810 win->AdoptAttributesFromHWND();
1811 win->SetupColours();
1814 wxPyRaiseNotImplemented();
1820 //---------------------------------------------------------------------------
1821 //---------------------------------------------------------------------------