undocumented wx.PyWindow class?

The wx.PyWindow class appears in the demo code in several places where one
would expect a wx.Panel. I have not found any documentation for this. Does
any exist? I suspect that my not understanding this class is causing
problems, but at present it's only a vague feeling. Any help would be
appreciated.

Edward

···

--------------------------------------------------------------------
Edward K. Ream email: edreamleo@charter.net
Leo: http://webpages.charter.net/edreamleo/front.html
--------------------------------------------------------------------

The wxWidgets (C++) API includes many virtual functions. Making
virtual function overrides work properly in the wxPython wrappers is
expensive, and the overriding isn't that common, so theres a separate
set of wx.Py* classes that allow you to override the controls, so you
don't have that cost in the common case. This is documented somewhere
but I couldn't tell you where.

···

On 12/15/06, Edward K. Ream <edreamleo@charter.net> wrote:

The wx.PyWindow class appears in the demo code in several places where one
would expect a wx.Panel. I have not found any documentation for this. Does
any exist? I suspect that my not understanding this class is causing
problems, but at present it's only a vague feeling. Any help would be
appreciated.

Edward

Edward K. Ream wrote:

The wx.PyWindow class appears in the demo code in several places where one
would expect a wx.Panel. I have not found any documentation for this. Does
any exist? I suspect that my not understanding this class is causing
problems, but at present it's only a vague feeling. Any help would be
appreciated.

See http://wiki.wxpython.org/index.cgi/OverridingMethods

In general the wx.PyFoo classes are derived from wxFoo and are specially engineered to allow some C++ virtual methods to be overridden in Python derived classes. wx.PyWindow, wx.PyPanel, wx.PyControl, and etc. go beyond what is described in the wiki (just allowing those that need to be overridden for normal operation) and allow some methods to be overridden that normally are not needed, but that are handy to have in custom controls and certain other situations. Here is the current list:

     bool DoEraseBackground(wxDC* dc);

     void DoMoveWindow(int x, int y, int width, int height);
     void DoSetSize(int x, int y, int width, int height,
                    int sizeFlags = wxSIZE_AUTO);
     void DoSetClientSize(int width, int height);
     void DoSetVirtualSize( int x, int y );

     void DoGetSize( int *OUTPUT, int *OUTPUT ) const;
     void DoGetClientSize( int *OUTPUT, int *OUTPUT ) const;
     void DoGetPosition( int *OUTPUT, int *OUTPUT ) const;

     wxSize DoGetVirtualSize() const;
     wxSize DoGetBestSize() const;

     void InitDialog();
     bool TransferDataToWindow();
     bool TransferDataFromWindow();
     bool Validate();

     bool AcceptsFocus() const;
     bool AcceptsFocusFromKeyboard() const;
     wxSize GetMaxSize() const;

     void AddChild(wxWindow* child);
     void RemoveChild(wxWindow* child);

     bool ShouldInheritColours() const;
     wxVisualAttributes GetDefaultAttributes();

     void OnInternalIdle();

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!