Discussion:
How to change wxNotebook page pressing TAB?
Fulvio Senore
2014-02-16 16:01:53 UTC
Permalink
I have a dialog that must show a lot of controls. There is no room for
all those controls at the same time so I put a wxNotebook in the lower
part of the dialog and I put logically grouped controls in different
pages of the notebook.

If the user presses the TAB key in a notebook page the focus moves among
the controls in the page until the last one, then it moves to the OK
button outside the notebook. The selected notebook page does not change.

Now suppose that the notebook is showing its first page and the focus is
on the last control of the page: if I press TAB I would like to show the
second page of the notebook and move the focus to the first control in
that page.
In this way the user would be able to move to all the controls without
using the mouse to change the notebook page.
In a data-entry intensive program this would be very handy.

May anybody suggest a way to obtain this behaviour?

Thanks in advance.

Fulvio Senore
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Vadim Zeitlin
2014-02-16 18:18:35 UTC
Permalink
On Sun, 16 Feb 2014 17:01:53 +0100 Fulvio Senore wrote:

FS> Now suppose that the notebook is showing its first page and the focus is
FS> on the last control of the page: if I press TAB I would like to show the
FS> second page of the notebook and move the focus to the first control in
FS> that page.
FS> In this way the user would be able to move to all the controls without
FS> using the mouse to change the notebook page.
FS> In a data-entry intensive program this would be very handy.
FS>
FS> May anybody suggest a way to obtain this behaviour?

TL;DR: Don't do it.


You should be able to do it by catching TAB explicitly, checking if the
focus is on the last (or first, in case of Shift-TAB) control and changing
the page but it would be a bad idea IMNSHO.

There are at least 3 reasons for this:

1. You can already change the notebook page from the keyboard using
[Shift-]Ctrl-Tab or, under GTK, Ctrl-Page{Up,Down}, so this is just
completely unnecessary to begin with.

2. You take away the possibility to TAB away from the notebook, so now
you do have to use mouse to return to any of the controls above it.

3. You break the user expectations. If I Tab into the notebook, I expect
Shift-Tab to take me out of it, not switch to a previous notebook page.

Regards,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
Igor Korot
2014-02-16 19:58:06 UTC
Permalink
Hi, Fulvio,
Post by Vadim Zeitlin
FS> Now suppose that the notebook is showing its first page and the focus is
FS> on the last control of the page: if I press TAB I would like to show the
FS> second page of the notebook and move the focus to the first control in
FS> that page.
It probably should behave like this:

Pressing TAB on the last control will give focus to the OK button. Pressing
TAB again will give the focus to the Notebook page, so user can switch pages
simply by pressing arrow keys.

I think I saw this behavior on Windows.
Vadim, what do you think?

Thank you.
Post by Vadim Zeitlin
FS> In this way the user would be able to move to all the controls without
FS> using the mouse to change the notebook page.
FS> In a data-entry intensive program this would be very handy.
FS>
FS> May anybody suggest a way to obtain this behaviour?
TL;DR: Don't do it.
You should be able to do it by catching TAB explicitly, checking if the
focus is on the last (or first, in case of Shift-TAB) control and changing
the page but it would be a bad idea IMNSHO.
1. You can already change the notebook page from the keyboard using
[Shift-]Ctrl-Tab or, under GTK, Ctrl-Page{Up,Down}, so this is just
completely unnecessary to begin with.
2. You take away the possibility to TAB away from the notebook, so now
you do have to use mouse to return to any of the controls above it.
3. You break the user expectations. If I Tab into the notebook, I expect
Shift-Tab to take me out of it, not switch to a previous notebook page.
Regards,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Fulvio Senore
2014-02-16 20:21:25 UTC
Permalink
Post by Vadim Zeitlin
FS> Now suppose that the notebook is showing its first page and the focus is
FS> on the last control of the page: if I press TAB I would like to show the
FS> second page of the notebook and move the focus to the first control in
FS> that page.
FS> In this way the user would be able to move to all the controls without
FS> using the mouse to change the notebook page.
FS> In a data-entry intensive program this would be very handy.
FS>
FS> May anybody suggest a way to obtain this behaviour?
TL;DR: Don't do it.
You should be able to do it by catching TAB explicitly, checking if the
focus is on the last (or first, in case of Shift-TAB) control and changing
the page but it would be a bad idea IMNSHO.
1. You can already change the notebook page from the keyboard using
[Shift-]Ctrl-Tab or, under GTK, Ctrl-Page{Up,Down}, so this is just
completely unnecessary to begin with.
2. You take away the possibility to TAB away from the notebook, so now
you do have to use mouse to return to any of the controls above it.
3. You break the user expectations. If I Tab into the notebook, I expect
Shift-Tab to take me out of it, not switch to a previous notebook page.
Thank you, I did not know about Ctrl-Tab.

Fulvio
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Loading...