1
.\" $Id: cdk_traverse.3,v 1.3 2002/07/09 21:51:16 tom Exp $
1
.\" $Id: cdk_traverse.3,v 1.7 2005/12/30 01:47:25 tom Exp $
10
resetCDKScreenOf - functions to support keyboard traversal
6
.XX exitCancelCDKScreen
7
.XX exitCancelCDKScreenOf
10
.XX getCDKFocusCurrent
13
.XX setCDKFocusCurrent
17
.XX setCDKFocusPrevious
20
cdk_traverse - functions to support keyboard traversal
16
26
.RI "[ " "library" " \|.\|.\|. ]"
31
.BI "CDKOBJS *getCDKFocusCurrent (CDKSCREEN *" "screen");
33
.BI "CDKOBJS *setCDKFocusCurrent (CDKSCREEN *" "screen\fB, CDKOBJS *\fPobj");
35
.BI "CDKOBJS *setCDKFocusFirst (CDKSCREEN *" "screen");
37
.BI "CDKOBJS *setCDKFocusLast (CDKSCREEN *" "screen");
39
.BI "CDKOBJS *setCDKFocusNext (CDKSCREEN *" "screen");
41
.BI "CDKOBJS *setCDKFocusPrevious (CDKSCREEN *" "screen");
20
43
.BI "int traverseCDKScreen (CDKSCREEN *" "screen");
22
45
.BI "void exitOKCDKScreen (CDKSCREEN *" "screen");
30
53
.BI "void exitCancelCDKScreenOf (CDKOBJS *" "obj");
32
55
.BI "void resetCDKScreenOf (CDKOBJS *" "obj");
57
.BI "void traverseCDKOnce ("
58
.BI "CDKSCREEN *\fIscreen\fP,"
59
.BI "CDKOBJS *\fIcurobj\fP,"
60
.BI "int \fIkeyCode\fP,"
61
.BI "boolean \fIfunctionKey\fP,"
62
.BI "CHECK_KEYCODE \fIfuncMenuKey\fP);
34
66
The functions above handle the traversal of a screen populated with various
35
widgets. Once the screen has been created and populated with widgets, a
36
single call to \f2traverseCDKScreen()\f1 will allow the user to move between
37
widgets and enter data (or otherwise manipulate widgets). The remainder of
38
the functions above are intended to be used as callbacks by the widgets on
68
Once the screen has been created and populated with widgets, a
69
single call to \fBtraverseCDKScreen()\fP will allow the user to move between
70
widgets and enter data (or otherwise manipulate widgets).
71
Other functions are provided for use as callbacks by the widgets on
73
Finally, there are several functions which allow the caller to manipulate
74
the state of the traversal, i.e., the object which has focus.
41
76
In order for widgets to be used on a screen which is to be handled by
42
\f2traverseCDKScreen()\f1, it must have the following methods available:
77
\fBtraverseCDKScreen()\fP, it must have the following methods available:
65
100
At the time of this writing, not all widgets have been modified to work with
66
101
the screen-traversal facility.
67
102
.SH AVAILABLE FUNCTIONS
68
int traverseCDKScreen (CDKSCREEN *\f2screen\f1);
103
.B int traverseCDKScreen (CDKSCREEN *\fIscreen\fP);
70
105
This function contains the main screen traversal engine.
71
106
It does the following:
94
129
If the keystroke is TAB/BACKTAB then call the unfocusObject method on the
95
130
current widget, and move focus to the next/previous widget (not counting
96
menu widgets). Call the focusObject method on the newly current widget.
132
Call the focusObject method on the newly current widget.
99
135
If the keystroke is the EXIT-SAVE keystroke, then call the saveData method
152
.B CDKOBJS *getCDKFocusCurrent (CDKSCREEN *\fIscreen\fP);
153
Return a pointer to the object which currently has focus in the given screen.
155
.B CDKOBJS *setCDKFocusCurrent (CDKSCREEN *\fIscreen\fP, CDKOBJS *\fIobj\fP);
156
Set the focus to the given object, if the screen contains that object.
157
If the screen does not contain the object, return null.
158
Otherwise, return the object.
160
.B CDKOBJS *setCDKFocusFirst (CDKSCREEN *\fIscreen\fP);
161
Set focus on the first object in the given screen.
163
.B CDKOBJS *setCDKFocusLast (CDKSCREEN *\fIscreen\fP);
164
Set focus on the last object in the given screen.
166
.B CDKOBJS *setCDKFocusNext (CDKSCREEN *\fIscreen\fP);
167
Set focus on the next object in the given screen.
169
.B CDKOBJS *setCDKFocusPrevious (CDKSCREEN *\fIscreen\fP);
170
Set focus on the previous object in the given screen.
116
172
.B exitOKCDKScreen
118
174
Causes the traversal engine to exit after calling the saveData
122
178
.B exitOKCDKScreenOf
124
Calls \f2exitOKCDKScreen()\f1 on the screen associated with widget
125
\f2obj\f1. This function was designed to be used as a callback routine
180
Calls \fBexitOKCDKScreen()\fP on the screen associated with widget
182
This function was designed to be used as a callback routine
126
183
for a button widget used as an OK button on a data-entry screen.
135
192
.B exitCancelCDKScreenOf
137
Calls \f2exitCancelCDKScreen()\f1 on the screen associated with widget
138
\f2obj\f1. This function was designed to be used as a callback routine
194
Calls \fBexitCancelCDKScreen()\fP on the screen associated with widget
196
This function was designed to be used as a callback routine
139
197
for a button widget used as a Cancel button on a data-entry screen.
142
200
.B resetCDKScreen
144
Causes the traversal engine to call the refreshData
145
method for each widget. This will cause any unsaved changes to be discarded
202
Causes the traversal engine to call the refreshData method for each widget.
203
This will cause any unsaved changes to be discarded
146
204
and the widget states will be restored to their initial values.
149
207
.B resetCDKScreenOf
151
Calls \f2resetCDKScreen()\f1 on the screen associated with widget
152
\f2obj\f1. This function was designed to be used as a callback routine
209
Calls \fBresetCDKScreen()\fP on the screen associated with widget \fIobj\fP.
210
This function was designed to be used as a callback routine
153
211
for a button widget used as a Reset button on a data-entry screen.
216
This is a utility function, one of the pieces from which you can
217
construct a customized version of \fBtraverseCDKScreen\fP.
156
220
Not all widgets have had the extra methods added so that they work with
157
221
the screen traversal engine.
159
223
Grant Edwards, Aspen Research Corporation
225
Thomas Dickey and contributors.
162
228
.BR cdk_binding (3),