I added a new style where the expanded pane is surrounded by a static box, and the toggle button is situated on upper left edge of the box. When it is collapsed then all you can see is the button. I think it has a very nice look and feel.
I made it possible when using the old style to choose positioning the static line above or to the side of the button on any platform. Personally I really dislike the positioning above the button that it (and the C++ version) was/is doing by default on the Mac.
I also changed it to derive from wx.PyPanel instead of wx.PyControl since it has child widgets. wx.Control doesn't deal very well with moving tab traversal into and out of itself when it is a container and Panels do. Unfortunately this means that the validator parameter is now worthless, but I'm not sure what good a validator would be for a collapsible pane widget anyway. This makes it diverge a bit from the C++ collapsible pane widget, but I don't think that poses much of a problem in this case.
Finally I refactored the code somewhat to accommodate these changes. I'm hoping I didn't make any silly mistakes here, which is why I'd like you to give it a look to be sure.
Thanks.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
I added a new style where the expanded pane is surrounded by a static box,
and the toggle button is situated on upper left edge of the box. When it is
collapsed then all you can see is the button. I think it has a very nice
look and feel.
I made it possible when using the old style to choose positioning the static
line above or to the side of the button on any platform. Personally I really
dislike the positioning above the button that it (and the C++ version)
was/is doing by default on the Mac.
I also changed it to derive from wx.PyPanel instead of wx.PyControl since it
has child widgets. wx.Control doesn't deal very well with moving tab
traversal into and out of itself when it is a container and Panels do.
Unfortunately this means that the validator parameter is now worthless, but
I'm not sure what good a validator would be for a collapsible pane widget
anyway. This makes it diverge a bit from the C++ collapsible pane widget,
but I don't think that poses much of a problem in this case.
Finally I refactored the code somewhat to accommodate these changes. I'm
hoping I didn't make any silly mistakes here, which is why I'd like you to
give it a look to be sure.
I have just updated my copy of SVN and tried PyCollapsiblePane. The
new style looks pretty slick, and I agree with you that it may look
much better on the Mac (although I don't have any direct experience, I
like the screenshot you posted).
I don't see anything strange in the implementation, everything seems
to work correctly on Window XP. I'll try and do some testing on GTK
next week but at first sight everything looks fine.