• Aucun résultat trouvé

Component Navigation

Dans le document Style Guide (Page 57-63)

Problem Reporting

Chapter 2 Input Models

3.2 Keyboard-Based Navigation

3.2.3 Component Navigation

Component navigation moves the location cursor, and therefore the keyboard focus, among components in a window. The window is divided into fields, and operations that use the <Tab> key move the cursor from one field to another. For this reason, fields are also known as tab groups. The directional keys <-1->, <I>, <~>, and <~> are used for navigation within a field.

Menu systems, including the MenuBar, follow a different traversal model, described in Section 3.3.

A field can be an individual control, such as a Text control. In this case, the directional keys are used for internal navigation within the control.

Alternately, a field can consist of a group of controls such as a RadioBox, which holds a group of RadioButtons. In this case, the directional keys are used to navigate among the component controls of the group.

The fields in a window are ordered. <Tab> generally moves the location cursor to the next field, and <Shift> <Tab> moves the location cursor to the previous field. However, a field can use <Tab> and <Shift> <Tab> for

Navigation

internal navigation. For example, within a multiline Text control, <Tab> is used to tab within the text. Consequently, <Ctrl> <Tab> must always

*

navigate to the next field, and <Ctrl> <Shift> <Tab> must always navigate

*

to the previous field.

<Tab> (if not used for internal navigation) and <Ctrl> <Tab> must move

*

the location cursor forward through fields according to the following rules:

• If the next field is a control, <Tab> (if not used for internal navigation)

*

and <Ctrl> <Tab> must move the location cursor to that control.

• If the next field is a group, <Tab> (if not used for internal navigation)

*

and <Ctrl> <Tab> must move the location cursor to a traversable

*

component within the group. If the field contains a button that currently shows default highlighting, the location cursor should be placed on that button; otherwise, the first control in the field (the top-leftmost one in a left-to-right language environment) should get focus.

If the next field contains no traversable components, <Tab> (if not used for

*

internal navigation) and <Ctrl> <Tab> must skip the field. Note that Separators and Labels should not be traversable. The ScrollBars of ScrolledWindows also should not be traversable, particularly if a

<ScroIlLock> key is available on the keyboard.

<Shift> <Tab> (if not used for internal navigation) and <Ctrl> <Shift>

*

a button press other than within the client area of the window.

*

• The window had the focus at some time in the past.

• The control that last had focus in the window is still traversable.

If the component that last had focus is no longer traversable, or if the

in the window-in a left-to-right language environment, the top-leftmost field.

Developers should follow these general rules for field navigation:

• Fields should be traversed from the upper left to the lower right in a left-to-right language environment. In a right-to-Ieft language environment, fields should be traversed from the upper right to the lower left.

• Field navigation must wrap between the first and last fields of the

*

window.

• In a PanedWindow, each Pane should consist of one or more fields, and each Sash should be a field. Fields in a PanedWindow should be traversed in the following order:

1. All fields in the topmost Pane 2. The topmost Sash

3. All fields in the next Pane toward the bottom 4. The next Sash toward the bottom

and so on, to the bottom of the PanedWindow.

Directional keys are used both for component navigation within a field and for internal purposes, including internal navigation, within a control.

When <~> and <I> are used for component navigation within a field, they

*

must behave in the following way:

*

• In a left-to-right language environment, <~> must move the location

*

cursor through all traversable controls in the field, starting at the upper

*

left and ending at the lower right, then wrapping to the upper left. If the

*

controls are aligned in a matrix-like arrangement, <~> must first

*

traverse one column from top to bottom, then traverse the column to its

*

right, and so on. In a right-to-Ieft language environment, <-!,> must

*

move the location cursor through all traversable controls, starting at the

*

upper right and ending at the lower left.

*

• <I> must move the location cursor through all traversable controls in

*

the field in the order opposite to that of <~>.

*

Navigation

location cursor through all traversable controls, starting at the lower left

*

and ending at the upper right.

*

<~> must move the location cursor through all traversable controls in

*

the field in the order opposite to that of <~>.

*

Controls that use directional keys internally -such as Text, List, Canvas, Sash, ScrollBar, and Scale-should be fields. If a control that uses

*

directional keys internally does not act like a field, the directional keys must

*

be used for both internal purposes and component navigation.

In particular, controls can use directional keys in one dimension for internal purposes and in another dimension for component navigation. For example, a vertically organized group of single-line Text controls can be grouped together as a single field. <J,> and <I> navigate among the single-line Text controls in the field. <~>, <Ctrl> <~>, <~>, and <Ctrl> <~> navigate among characters and words within an individual single-line Text control.

The directional keys modified with <Ctrl> can also be used for component navigation, following the same rules specified above. If the directional keys modified with <Ctrl> are used for component navigation, the unmodified directional keys can be used for internal purposes.

For example, a table can consist of an array of single-word Text controls, with <I> and <J,> used to navigate up and down a column. <~> and <~>

can navigate among characters within an individual single-word Text control, while <Ctrl> <~> and <Ctrl> <~> navigate horizontally among the Text components in a row.

Within a control, the directional keys can be used in a variety of ways. In list-like controls, or in graphics-like controls in which the elements are laid out in a matrix-like arrangement, internal navigation using the directional keys should move the cursor among elements using the same rules followed for component navigation. However, if the control is scrollable, directional navigation should not wrap between the first and last elements of the

control; a directional key that would otherwise cause wrapping should have no effect at the first or last element.

Additional internal navigation techniques may be needed in situations not covered by this guide, such as the following:

• Graphics-like controls in which the elements are densely populated or are organized into layers

• Applications that use 3-dimensional navigation

• Applications that organize elements hierarchically

In such cases, navigation models should not deviate unnecessarily from the standard navigation models.

Rather than move the cursor among elements, a graphics-like control can use a positional cursor. In this case, <~>, <i>, <~>, and <~> must

*

internally navigate by moving the cursor one unit (for example, one pixel) at

*

a time in the direction indicated by the key. In this model, the cursor is sometimes on an element and sometimes in the background of the control.

The use of the directional keys for internal navigation in text-like controls is described in the Text reference page in Chapter 9. In a control that displays a value, the directional keys can increment or decrement that value.

When the directional keys cause changes that are based on some unit, the directional keys modified by <Ctrl> can cause changes based on a larger unit. For example:

• In Text, <~> moves the cursor a character to the right, and <Ctrl> <~>

moves the cursor a word to the right.

• In a Canvas, <~> can move a positional cursor one pixel to the right, and <Ctrl> <~> can move the cursor some number of pixels to the right.

• In a Scale, <~> can increment the Scale value by one unit indicated by minor tick marks, and <Ctrl> <~> can increment the Scale value by an amount corresponding to the distance between major tick marks.

If a control uses <~> and <~> for internal navigation, it must support the

*

following behavior:

*

<Begin> In a left-to-right language environment, this action

*

must move the location cursor to the leftmost edge

*

of the data or the leftmost element. In a right-to-

*

left language environment, this action must move

*

<End>

Navigation

the location cursor to the rightmost edge of the data

*

or the rightmost element.

*

In a left-to-right language environment, this action

*

must move the location cursor to the rightmost edge

*

of the data or the rightmost element. In a right-to-

*

left language environment, this action must move

*

the location cursor to the leftmost edge of the data

*

or the leftmost element.

*

If a control uses <I> and <t> for internal navigation, it must support the

*

following behavior:

*

<Ctrl> <Begin>

<Ctrl> <End>

This action must move the location cursor to one of

*

the following:

*

• The first element

*

• The topmost edge of the data

*

• In a left-to-right language environment, the

*

topmost left edge of the data; in a right-to-Ieft

*

language environment, the topmost right edge

*

of the data

*

This action must move the location cursor to one of

*

the following:

*

• The last element

*

• The bottommost edge of the data

*

• In a left-to-right language environment, the

*

bottommost right edge of the data; in aright -

*

to-left language environment, the bottommost

*

left edge of the data

*

Groups that are fields can also use <Begin>, <End>, <Ctrl> <Begin>, and

<Ctrl> <End> to move the location cursor to appropriate controls within the group.

Dans le document Style Guide (Page 57-63)