Ticket #9911 (confirmed defect)

Opened 4 years ago

Last modified 4 years ago

AiuNotebook doesn't behave properly like a container as far as tab traversal is concerned

Reported by: raf Owned by:
Priority: normal Milestone:
Component: wxAui Version: 2.8.8
Keywords: TAB_TRAVERSAL AuiNotebook Cc:
Blocked By: Patch: no
Blocking:

Description

raf wrote:

python 2.5.2, wxpython 2.8.8.1, macosx 10.4.11

i have an app with a splitter window.
the left hand side contains a treectrl in a panel.
the right hand side contains an auinotebook in a panel.
there is a widget-filled scrolledpanel in the auinotebook
containing textctrls, comboboxes and checkboxes.

i would like tabbing to stay within the panel but it doesn't.
pressing tab traverses all of the widgets and then,
instead of returning to the first widget, the focus
goes over to the treectrl in the left hand side of
the splitter window (and never comes back). i'd prefer
to enlist Ctrl-Tab of something to make that happen.

anyway, the tab order behaviour is strange. once the focus
is stuck in the treectrl on the left hand side, there is one
textctrl widget in the panel of the auinotebook (inside a
staticboxsizer) that won't accept focus even by clicking on it!
i have to first click on the auinotebook panel's tab and then
press the tab key to get it to accept focus.

note: this inability for the textctrl to accept focus was remedied
by removing the staticboxsizer (but the attqached program does
use the staticboxsizer).

and the datepickerctrl
widgets then seem to get skipped in the tab order. perhaps not
skipped but rather when it's meant to have focus, it doesn't look
like it has focus and it doesn't receive keystrokes but on the other
hand, no other widget has focus either.

...

i've attached a cut down version of the application to
demonstrate but it sometimes behaves differently. if you
start the app and press enter, it'll create the auinotebook
pane and set focus to the first widget. pressing tab now
progresses until it reaches the datepickerctrl labelled
"Left:" after that, pressing tab briefly goes to the next
widget and then continually returns to the Left:
datepickerctrl. sometimes it exhibits the behaviour
described earlier. removing the datepickerctrls should
make the behaviour more consistent.

note: i have removed the datepickerctrls from the attached program
in order to avoid that other behaviour.

...

robin dunn wrote:

...

This is where the second problem is. The AuiNotebook is not properly
behaving like a container as far as the tab traversal is concerned.
(Please create a bug report about this.) You can partially work around
this by also using the wx.TAB_TRAVERSAL style with the AuiNotebook, but
it still has a problem as it takes a few extra presses of the tab key to
get through the AuiNotebook and the AuiTabCtrl (with no visual clue what
is happening) until focus reaches the page window and it is then reset
to the first widget again. You can probably work around this part by
hooking set_focus handlers to the AuiNotbook and its AuiTabCtrl child
and resetting the focus to the current page window, or maybe just use
navigation events so back-tabs will be handled too. You'll need to
experiment a bit...

note: i have followed robin's suggestions but focus never passed
from the treectrl back to the auinotebook.

Attachments

wx-auinotebook-tab-traversal-problem.py download (22.9 KB) - added by raf 4 years ago.

Change History

Changed 4 years ago by raf

Changed 4 years ago by robind

  • status changed from new to confirmed
  • component changed from wxMac to wxAui

Changing to wxAUI component. There may still be some mac related tab traversal issue though...

Note: See TracTickets for help on using tickets.