I'd like to treat certain wx.Panel instances as if they were controls on their own right - in particular, being _themselves_ part of the tab traversal scheme, and getting focus individually, regardless of whether there are child windows inside them or not.
I'd like to implement effects such as the panel changing color or getting a border drawn around it when it gets the focus. Of course, the panel should also change its (visible) focus status when any of its _children_ are clicked and get the focus.
However, implementing this does not seem to be quite that straightforward. The best solution I've found this far is going through all the children recursively, and binding event handlers for EVT_KILL_FOCUS and EVT_SET_FOCUS to them. But this approach quickly gets quite messy as wx.StaticText widgets, for example, don't seem to get focus at all (which is quite natural, of course!) and will thus "shield" the Panel from getting focus events if the user clicks over the label areas. And in order to keep track whether focus has truly left the panel and all its children, I need to receive and compare the focus "kill" events for all its children, which is rather awkward and complicated.
Is there some more obvious and cleaner way that would make wx.Panel act more like a regular control in this regard? Or could wx.Panel somehow be subclassed to include this functionality?
(I was wondering about the SetFocusIgnoringChildren() method, since it seems to be related to this dilemma, but can't quite see how I could use it to my advantage here.)
ยทยทยท
--
znark