wxRuby Documentation Home

# Wx::NavigationKeyEvent

A navigation key event is triggered when the user uses the TAB key to
move forwards or backwards through the controls in a group. For example,
it may be used to track movements between multiple buttons
contained in a panel, by attaching the event handler to the
panel object.

## Derived from

Event

## See also

CommandEvent, KeyEvent

## Methods

- NavigationKeyEvent.new
- NavigationKeyEvent#get_current_focus
- NavigationKeyEvent#get_direction
- NavigationKeyEvent#is_from_tab
- NavigationKeyEvent#is_window_change
- NavigationKeyEvent#set_current_focus
- NavigationKeyEvent#set_direction
- NavigationKeyEvent#set_from_tab
- NavigationKeyEvent#set_window_change

### new

NavigationKeyEvent.new()

Constructor. Should not need to be used directly by an application.

### get_current_focus

Window get_current_focus()

Returns the child window which currently has the focus. This may be nil,
in which case use Window#find_focus

### get_direction

Boolean get_direction()

Returns `true` if the TAB move was forward, or `false` if it was
backwards through the window focus cycle. Backward tabbing is commonly
enabled by holding down SHIFT when pressing TAB.

### is_from_tab

Boolean is_from_tab()

Set to true under MSW if the event was generated by pressing the TAB
key. This is needed for proper navigation over radio buttons.

### is_window_change

Boolean is_window_change()

Returns `true` if the event resulted in a change of window – for example,
moving between the tabs of Notebook or MDI control, or `false` if it was
between different controls in a group, for example, on a panel.

### set_current_focus

set_current_focus(%(arg-type)Window% win)

Set the current focused window in this event.

### set_direction

set_direction(%(arg-type)Boolean% forward)

Sets the direction of the navigation, forward if `true` or backward if `false`.

### is_from_tab

is_from_tab(%(arg-type)Boolean% from_tab)

Sets whether or not the event arose from pressing the TAB key.

### is_window_change

is_window_change(%(arg-type)Boolean% window_change)

Sets whether the event arose from a change of Window or a change between
controls.

[This page automatically generated from the Textile source at 2023-06-09 00:45:35 +0000]