Tab transversal control within a wx.Panel

I am creating a form for entering information. This form is comprised of
many wx.Window objects within a wx.Panel. I want to control the tab
behavior. I do not want tab transversal to work through the entire list of
children - but only specific ones (specifically the wx.TextCtrls in the form
and not the button and other check boxes).

I am aware of w1.MoveBeforeInTabOrder(w2) and w1.MoveAfterInTabOrder(w2) but
this just rearranges the order of the list. How do I remove wx.Window
objects from the list? Is there a flag I am missing?

Note: My other option is to capture chars and roll my own tab transversal
behavior - but I was hoping that there was a simple straightforward way ...

···

--
View this message in context: http://wxpython-users.1045709.n5.nabble.com/Tab-transversal-control-within-a-wx-Panel-tp4291956p4291956.html
Sent from the wxPython-users mailing list archive at Nabble.com.

For custom widgets derived from one of the wx.Py classes (wx.PyControl, wx.PyPanel, etc.) then it should be doable by overriding the AcceptsFocus method and returning False. For native widgets this is not overridable (see OverridingMethods - wxPyWiki) so you're probably stuck with rolling your own tab traversal. I seem to recall a few years back that somebody made some classes that could help with this type of thing, but I don't remember details so perhaps some googling will help find it.

···

On 4/8/11 2:15 PM, rocketman wrote:

I am creating a form for entering information. This form is comprised of
many wx.Window objects within a wx.Panel. I want to control the tab
behavior. I do not want tab transversal to work through the entire list of
children - but only specific ones (specifically the wx.TextCtrls in the form
and not the button and other check boxes).

I am aware of w1.MoveBeforeInTabOrder(w2) and w1.MoveAfterInTabOrder(w2) but
this just rearranges the order of the list. How do I remove wx.Window
objects from the list? Is there a flag I am missing?

Note: My other option is to capture chars and roll my own tab transversal
behavior - but I was hoping that there was a simple straightforward way ...

--
Robin Dunn
Software Craftsman

Very interesting. I was not really aware of this overloading point ... I had
not really thought it through ... makes total sense. You probably saved me
an hour the first time I would have tripped into it.

Looks like I will need to do a custom job ... as there is bo PyTextCtrl.
Thanks for the info!

···

--
View this message in context: http://wxpython-users.1045709.n5.nabble.com/Tab-transversal-control-within-a-wx-Panel-tp4291956p4301691.html
Sent from the wxPython-users mailing list archive at Nabble.com.

I wonder if there is a way to hook a tab-traversal event and if a certain widget object is pointed to in the event then just generate a bunch more tab-traversals or change the object pointed to in the event. Hackish I know. Or if there is a way for a widget to know if it received focus from a tab-traversal to set focus to another widget.

On the triggering control bind the gained focus event to a handler that
sets the focus to the desired control?

···

On 19/04/2011 8:22 AM, Dev Player wrote:

I wonder if there is a way to hook a tab-traversal event and if a
certain widget object is pointed to in the event then just generate a
bunch more tab-traversals or change the object pointed to in the
event. Hackish I know. Or if there is a way for a widget to know if it
received focus from a tab-traversal to set focus to another widget.

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en