Input Focus(3W) UNIX System V Input Focus(3W)
NAME
Input Focus: OlCallAcceptFocus, OlCanAcceptFocus,
OlGetCurrentFocusWidget, OlHasFocus, OlMoveFocus, OlSetInputFocus -
manipulates input focus for widgets and gadgets.
SYNOPSIS
Six convenience routines are available for manipulating input focus.
Each of these routines work with widgets or gadgets.
Boolean OlCallAcceptFocus(w, time)
Widget w;
Time time;
Boolean OlCanAcceptFocus(w, time)
Widget w;
Time time;
void OlSetInputFocus(w, revert_to, time)
Widget w;
int revertto;
Time time;
Widget OlGetCurrentFocusWidget(w)
Widget w;
Boolean OlHasFocus(w)
Widget w;
Widget OlMoveFocus(w, direction, time)
Widget w;
OlVirtualName direction;
Time time;
DESCRIPTION
OlCallAcceptFocus()
If widget w currently is capable of accepting input focus, focus is
assigned to w and the function returns TRUE; otherwise, FALSE is
returned. Time specifies the X server time of the event that initiated
this accept focus request.
OlCanAcceptFocus()
If the widget can accept focus, TRUE is returned; otherwise, FALSE is
returned. Acceptance of focus is determined by the following:
⊕ The widget is not being destroyed.
⊕ The widget is managed
⊕ The widget is mapped when managed (if it's not a gadget)
⊕ The widget is realized, or for a gadget, the gadget's parent must be
realized
⊕ The widget and its ancestors are sensitive
⊕ A query window attributes is successful and the widget's window is
10/89 Page 1
Input Focus(3W) UNIX System V Input Focus(3W)
viewable (i.e., the window and all its ancestor windows are mapped)
Otherwise, FALSE is returned.
OlSetInputFocus
OlSetInputFocus sets focus to a widget. Applications should use this
routine instead of XSetInputFocus since this routine checks the current
focus model and before setting focus.
OlGetCurrentFocusWidget()
OlGetCurrentFocusWidget returns the id of the widget which currently has
focus in the window group of the specified widget. If no widget in the
window group has focus, NULL is returned.
OlHasFocus()
This function is simply a convenience function that calls
OlGetCurrentFocusWidget and compares the result of that call to the
supplied widget id.
OlMoveFocus()
This function moves the input focus from one widget to another and
returns the id of the new focus widget. The routine OlCallAcceptFocus is
used to move the input focus. If the function is unable to move input
focus, NULL is returned.
When moving input focus between widgets contained within an exclusives or
non-exclusives widget, valid values for direction are:
Note: For the OL_MULTI directions below, the value of m is the value of
the application resource XtNmultiObjectCount.
OL_IMMEDIATE
Set focus to the next widget that will accept it, starting with w.
OL_MOVERIGHT
Set focus to the widget in the next column (and same row) that will
accept it, starting with the first column after w's column. If w
is located in the extreme right column, focus is set to the widget
in the extreme left column of the same row.
OL_MOVELEFT
Set focus to the widget in the previous column (and same row) that
will accept it, starting with the first column before w's column.
If w is located on the extreme left column, focus is set to the
widget in the extreme right column of the same row. (The widget
columns are searched in reverse order.)
OL_MOVEUP
Set focus to the widget in the next row (and same column) that will
accept it, starting with the first row after w's row. If w is
located in the top row, focus is set to the widget in the bottom
Page 2 10/89
Input Focus(3W) UNIX System V Input Focus(3W)
row of the same column. (The widget rows are searched in reverse
order.)
OL_MOVEDOWN
Set focus to the widget in the previous row (and same column) that
will accept it, starting with the first row before w's row. If w
is located in the bottom row, focus is set to the widget in the top
row of the same column.
OL_MULTIRIGHT
Set focus to the widget in the next column (and same row) that will
accept it, starting with the first column m columns after w's
column. If m is greater than the number of objects between w and
the extreme right column, focus is set to the widget in the extreme
left column of the same row.
OL_MULTILEFT
Set focus to the widget in the next column (and same row) that will
accept it, starting with the first column m columns before w's
column. If m is greater than the number of objects between w and
the extreme left column, focus is set to the widget in the extreme
right column of the same row. (The widget columns are searched in
reverse order.)
OL_MULTIUP
Set focus to the widget in the next row (and same column) that will
accept it, starting with the first row m rows after w's row. If m
is greater than the number of objects between w and the extreme
bottom row, focus is set to the widget in the extreme top row of
the same column. (The widget rows are searched in reverse order.)
OL_MULTIDOWN
Set focus to the widget in the next row (and same column) that will
accept it, starting with the first row m rows before w's row. If m
is greater than the number of objects between w and the extreme
bottom row, focus is set to the widget in the extreme bottom row of
the same column. When moving between widgets in a base window or
popup window, valid values for direction are:
OL_IMMEDIATE
Set focus to the next object that will accept it, starting with w.
OL_NEXTFIELD
Set focus to the next object that will accept it, starting with the
first object after w.
OL_PREVFIELD
Set focus to the next object that will accept it, starting with the
first object before w. (The list is searched in reverse order.)
10/89 Page 3
Input Focus(3W) UNIX System V Input Focus(3W)
OL_MOVERIGHT
Behaves like OL_NEXTFIELD direction.
OL_MOVELEFT
Behaves like OL_PREVFIELD direction.
OL_MOVEUP
Behaves like OL_PREVFIELD direction.
OL_MOVEDOWN
Behaves like OL_NEXTFIELD direction.
OL_MULTIRIGHT
Set focus to the next object that will accept it, starting with the
first object m objects after w.
OL_MULTILEFT
Set focus to the next object that will accept it, starting with the
first object m objects before w. (The list is searched in reverse
order.)
OL_MULTIUP
Behaves like OL_MULTILEFT direction.
OL_MULTIDOWN
Behaves like OL_MULTIRIGHT direction.
Page 4 10/89