I'd like to create a custom panel class by...
1) Deriving it from wx.PyPanel
2) Setting the client area of that derived panel class
to a smaller size than the panel itself.
3) Drawing decorative custom border graphics around the
shrunk-down client area.
OK; I can base my custom class on wx.PyPanel and override the DoGetClientSize() method, and this does get me a smaller client area. If I then add any child windows and sizers, they will respect the smaller client area that I give them, and only draw themselves within that smaller area.
So no problems here; everything seems to work fine.
However, the origin of this shrunk-down client area is still located at (0,0) - the top-left corner of my panel widget. This means that I can only draw my custom borders to the left and bottom edges of the panel; not around all edges, as I originally hoped.
Overriding GetClientOrigin() does not seem to help here. Neither does overriding GetClientRect().
"DoGetClientAreaOrigin()" could have been a logical choice of name for an overridable virtual function that would let the programmer set the position of the client area origin but a function by that name does not seem to exist.
So... how _does_ one reposition the origin of the client area in a custom panel class? Is that possible at all?
If not, why not? (Is there some specific wxWidgets design principle behind the decision to not allow this?)
* * *
I should perhaps mention that I've already found this old thread where this very same problem was discussed...
<http://thread.gmane.org/gmane.comp.python.wxpython/49418/>
...but that discussion quickly swerved off into the direction of circumventing the problem with alternative solutions, instead of explaining why this approach doesn't work, or delving into the details of whether overriding the origin of the client area is at all technically possible in wxPython/wxWidgets.
···
--
znark