TAB Traversal question

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
mbeardsley
Experienced Solver
Experienced Solver
Posts: 74
Joined: Thu Sep 25, 2014 7:40 pm

TAB Traversal question

Post by mbeardsley »

I have a Frame that I pop up (by calling Show()) when the user wants to edit something.

The frame has about 6 data entry fields, but I can't seem to get the Tab Traversal working. I have tried setting the wxTAB_TRAVERSAL on the individual controls, the panel that they are on, and the frame that holds the panel.

Strangely, when hitting the TAB key in the first field, it sounds a error beep, while hitting TAB in any of the other fields does nothing.

The documentation states for wxTAB_TRAVERSAL - "Use this to enable tab traversal for non-dialog windows".
My window is not a wxDialog, but it does popup sort of like one. Is there some other mechanism for enabling TAB traversal for a pop-up window?

I don't know if it makes a difference or not, but I am using wxFormBuilder to create this frame.

I am running wxWidgets 3.0.2 under Win7-64 with VisualStudio 2010.

Thanks.
New Pagodi
Super wx Problem Solver
Super wx Problem Solver
Posts: 469
Joined: Tue Jun 20, 2006 6:47 pm
Contact:

Re: TAB Traversal question

Post by New Pagodi »

I'd guess you're trying to create the items directly on the frame like this:
withpanel.png
withpanel.png (4.4 KiB) Viewed 2691 times
Instead, put a panel between the frame and the items like this:
nopanel.png
nopanel.png (3.4 KiB) Viewed 2691 times
mbeardsley
Experienced Solver
Experienced Solver
Posts: 74
Joined: Thu Sep 25, 2014 7:40 pm

Re: TAB Traversal question

Post by mbeardsley »

I had tried that already, but I tried it again and it works. I must have done it incorrectly the first time.

Thank you, that was very helpful.

As a side note, having that additional hierarchy meant that I also had to enable the window extra style "wxWS_EX_VALIDATE_RECURSIVELY" for my validators to work. This is not a big deal, but is mentioned just for future reference in case others run into this same issue.

Thanks again for the help.
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4204
Joined: Sun Jan 03, 2010 5:45 pm

Re: TAB Traversal question

Post by PB »

mbeardsley wrote:As a side note, having that additional hierarchy meant that I also had to enable the window extra style "wxWS_EX_VALIDATE_RECURSIVELY" for my validators to work. This is not a big deal, but is mentioned just for future reference in case others run into this same issue.
Also for future reference, the style is not needed anymore in wxWidgets 3.1 and later:
https://github.com/wxWidgets/wxWidgets/ ... baac567e4d
Post Reply