How do you configure how tab-cycling works? I want to be able to set the
order in which widgets are focused when the user presses the tab key. It
usually works automatically, but in a few cases it doesn't.
···
--
Jesper Eskilson
Virtutech
http://www.virtutech.com
Jesper Eskilson wrote:
How do you configure how tab-cycling works? I want to be able to set the
order in which widgets are focused when the user presses the tab key. It
usually works automatically, but in a few cases it doesn't.
The tab order is the same as the order in which the controls were created. At this time, it can't be modified.
Also, by default, tabbing only works in a wxPanel or wxDialog, unless you use the wxWindow style wxTAB_TRAVERSAL.
David
"David C. Fox" <davidcfox@post.harvard.edu> writes:
The tab order is the same as the order in which the controls were created.
At this time, it can't be modified.
I'm out of luck, then. I need to dynamically change the tabbing order in a
window where I display different sets of widgets depending on a selection
in a wxListBox. Having a static tabbing order simply doesn't work.
/Jesper
···
--
Jesper Eskilson
Virtutech
Jesper Eskilson wrote:
"David C. Fox" <davidcfox@post.harvard.edu> writes:
The tab order is the same as the order in which the controls were created.
At this time, it can't be modified.
I'm out of luck, then. I need to dynamically change the tabbing order in a
window where I display different sets of widgets depending on a selection
in a wxListBox. Having a static tabbing order simply doesn't work.
Oh, also, if I recall, controls which are disabled are skipped. If the different sets of widgets are disjoint, you might still be able to do this by calling Disable on the controls not currently being shown.
David
···
/Jesper
At least in wxPython 2.3.3.1 and earlier it is not just the creation order
that determines the tab order. Hiding and showing a control has the
side-effect of changing the tab order. I actually use that in the PythonCard
resourceEditor to dynamically adjust the order of widgets on a panel.
This may have been changed for 2.3.4, but I haven't seen mention of a
change. For a long time there has been talk about a tab order mechanism in
wxWindows/wxPython. I'm not sure why something like the code Bruce posted is
not just used as the default key handler along with a standard list of
controls for the tab order, ways of changing the list, etc. Perhaps it
should be part of wxPython?
The side-effect method I'm using will go away at some point and is a fragile
hack at best.
ka
···
-----Original Message-----
From: Jesper Eskilson
"David C. Fox" <davidcfox@post.harvard.edu> writes:
> The tab order is the same as the order in which the controls
were created.
> At this time, it can't be modified.
I'm out of luck, then. I need to dynamically change the tabbing order in a
window where I display different sets of widgets depending on a selection
in a wxListBox. Having a static tabbing order simply doesn't work.