Ticket #13271 (closed defect: fixed)
wxStaticBox parent, broken Tab order
| Reported by: | rollmark | Owned by: | vadz |
|---|---|---|---|
| Priority: | normal | Milestone: | 2.9.5 |
| Component: | wxMSW | Version: | 2.9.1 |
| Keywords: | msw wxStaticBox tab | Cc: | |
| Blocked By: | Patch: | no | |
| Blocking: |
Description
Hi,
I'm using wxWidgets wxWidgets-2.9.1 with Visual C++ 2010 on Windows 7
with DialogBlocks 4.40.
I noticed that the new recommended way is to use the wxStaticBox as
a parent to other controls (this change is also reflectd in the code
generated from DialogBlocks).
However there seems to be a bug with regard to the resulting tab
order. The controls that are grouped as children of the wxStaticBox
are not reachable via TAB key. Instead the next control that is not a
child of the wxStaticBox ist selected.
You can reproduce this behaviour in the controls sample. After line
996 in controls.cpp (where the wxStaticBoxSizer with the label 'Show
Buttons' is created) add these lines:
wxStaticBox* txtParent = csizer->GetStaticBox();
// wxPanel* txtParent = panel;
csizer->Add(new wxTextCtrl( txtParent, wxID_ANY, s, wxPoint(20,160),
wxSize(80,wxDefaultCoord)));
csizer->Add(new wxTextCtrl( txtParent, wxID_ANY, s, wxPoint(20,160),
wxSize(80,wxDefaultCoord)));
csizer->Add(new wxTextCtrl( txtParent, wxID_ANY, s, wxPoint(20,160),
wxSize(80,wxDefaultCoord)));
Place the cursor in the first text control on the wxSizer page. If the
static box is the wxTextCtrl parent, then pressing TAB moves the focus to the
checkbox with the label '1'. If the panel ist the parent, then
pressing TAB moves the focus to the second text control as expected.
Regards,

