Sorry, I should have mentioned that it is designed to have a sister
class "Control" that all of these fake controls are derived from. So it
first checks to see if the passed in object is a "Sizer" which is the
fake sizer class, if not then it checks to see if it is a "Control"
which would be a custom draw-on-parent class, and lastly it just passes
whatever it is to the real wx.Sizer class in case it is a real
wx.Control or (w,h) tuple for an actual spacer, etc. So your non-widget
classes need to derive from "Control". See the attached Control class
as an example. All the code I'm sending you is hacked from what I
actually use so I haven't tested it yet
Note that your controls need to implement GetBestSize() (Another little
detail I forgot to mention).
I'll see if I can put together a demo tonight. You wouldn't happen to
have a 2.7 preview installed would you? Or just a windows machine (I
have a wxruntime built fomr CVSHEAD). All my code is designed to use
the new PseudoDC class I wrote that's in 2.7. If not I can still come
up with a demo, just takes longer.
-Paul
Controls.py (2.68 KB)