7
.TH cdk_scale 3 "24 April 1997"
9
newCDKScale, activateCDKScale, injectCDKScale, setCDKScale,
10
setCDKScaleLowHigh, getCDKScaleLowValue, getCDKScaleHighValue,
11
setCDKScaleValue, getCDKScaleValue, setCDKScaleBox, getCDKScaleBox,
12
setCDKScaleULChar, setCDKScaleURChar,
13
setCDKScaleLLChar, setCDKScaleLRChar,
14
setCDKScaleVerticalChar, setCDKScaleHorizontalChar,
15
setCDKScaleBoxAttribute,
16
setCDKScaleBackgroundColor,
17
drawCDKScale, eraseCDKScale, destroyCDKScale,
18
setCDKScalePreProcess, setCDKScalePostProcess
19
\- Creates a managed curses scale widget.
23
.RI "[ " "flag" " \|.\|.\|. ] " "file" " \|.\|.\|."
25
.RI "[ " "library" " \|.\|.\|. ]"
29
.BI "CDKSCALE *newCDKScale (CDKSCREEN *" "cdkscreen",
34
.BI "chtype " "fieldAttribute",
35
.BI "int " "fieldWidth",
36
.BI "int " "currentValue",
37
.BI "int " "lowValue",
38
.BI "int " "highValue",
39
.BI "int " "increment",
40
.BI "int " "fastIncrement",
42
.BI "boolean " "shadow");
44
.BI "int activateCDKScale (CDKSCALE *" "scale",
45
.BI "chtype *" "actions");
47
.BI "int injectCDKScale (CDKSCALE *" "scale",
48
.BI "chtype " "input");
50
.BI "void setCDKScale (CDKSCALE *" "scale",
51
.BI "int " "lowValue",
52
.BI "int " "highValue",
53
.BI "int " "currentValue",
54
.BI "boolean " "box");
56
.BI "void setCDKScaleLowHigh (CDKSCALE *" "scale",
60
.BI "int getCDKScaleLowValue ((CDKSCALE *" "scale");
62
.BI "int getCDKScaleHighValue ((CDKSCALE *" "scale");
64
.BI "void setCDKScaleValue (CDKSCALE *" "scale",
67
.BI "int getCDKScaleValue (CDKSCALE *" "scale");
69
.BI "void setCDKScaleBox (CDKSCALE *" "scale",
70
.BI "boolean " "box");
72
.BI "boolean getCDKScaleBox (CDKSCALE *" "scale");
74
.BI "void setCDKScaleULChar (CDKSCALE *", "scale",
75
.BI "chtype " "character");
77
.BI "void setCDKScaleURChar (CDKSCALE *", "scale",
78
.BI "chtype " "character");
80
.BI "void setCDKScaleLLChar (CDKSCALE *", "scale",
81
.BI "chtype " "character");
83
.BI "void setCDKScaleLRChar (CDKSCALE *", "scale",
84
.BI "chtype " "character");
86
.BI "void setCDKScaleVerticalChar (CDKSCALE *", "scale",
87
.BI "chtype " "character");
89
.BI "void setCDKScaleHorizontalChar (CDKSCALE *", "scale",
90
.BI "chtype " "character");
92
.BI "void setCDKScaleBoxAttribute (CDKSCALE *", "scale",
93
.BI "chtype " "character");
95
.BI "void setCDKScaleBackgroundColor (CDKSCALE *", "scale",
96
.BI "char * " "color");
98
.BI "void moveCDKScale (CDKSCALE *" "scale",
101
.BI "boolean " "relative",
102
.BI "boolean " "refresh");
104
.BI "void positionCDKScale (CDKSCALE *" "scale");
106
.BI "void drawCDKScale (CDKSCALE *" "scale",
107
.BI "boolean " "box");
109
.BI "void eraseCDKScale (CDKSCALE *" "scale");
111
.BI "void destroyCDKScale (CDKSCALE *" "scale");
113
.BI "void setCDKScalePreProcess (CDKSCALE *" "scale",
114
.BI "PROCESSFN " "callback",
115
.BI "void * " "data");
117
.BI "void setCDKScalePostProcess (CDKSCALE *" "scale",
118
.BI "PROCESSFN " "callback",
119
.BI "void * " "data");
121
.BI "void bindCDKObject (EObjectType " "widgetType",
122
.BI "void *" "object",
124
.BI "BINDFN " "function",
125
.BI "void *" "data");
127
The Cdk scale widget creates a scale box with a label and a scale field. The
128
following are functions which create or manipulate the Cdk scale box widget.
130
.SH AVAILABLE FUNCTIONS
131
CDKSCALE *newCDKScale (CDKSCREEN *\f2screen\f1, int \f2xpos\f1, int \f2ypos\f1, char *\f2title\f1, char *\f2label\f1, chtype \f2fieldAttribute\f1, chtype \f2fillerCharacter\f1, EDisplayType \f2displayType\f1, int \f2fieldWidth\f1, int \f2minimumLength\f1, int \f2maximumLength\f1, boolean \f2box\f1, boolean \f2shadow\f1);
133
This function creates a pointer to a scale widget. The \f2screen\f1 parameter
134
is the screen you wish this widget to be placed in. The parameter \f2xpos\f1
135
controls the placement of the object along the horizontal axis. This parameter
136
can accept an integer value or one of the pre-defined values of \f4LEFT\f1,
137
\f4RIGHT\f1, and \f4CENTER\f1. The parameter \f2ypos\f1 controls the placement
138
of the object along the vertical axis. This parameter can accept an integer
139
value or one of the pre-defined values of \f4TOP\f1, \f4BOTTOM\f1, and \f4CENTER\f1.
140
The \f2title\f1 parameter is the string which will be displayed at the top of the
141
widget. The title can be more than one line; just provide a carriage return
142
character at the line break. The \f2label\f1 parameter is the string which will be
143
displayed in the label of the scale field. The \f2fieldAttribute\f1 is the
144
attribute of the characters displayed in the field.
145
The parameter \f2fieldWidth\f1 controls the width of the widget. If you
146
provide a value of zero the widget will be created with the full width of
147
the screen. If you provide a negative value, the widget will be created
148
the full width minus the value provided. The parameter \f2currentValue\f1
149
is the value of the scale field when the widget is activated. The parameters
150
\f2lowValue\f1 and \f2highValue\f1 are the low and high values of the widget
151
respectively. The parameter \f2increment\f1 is the regular increment value
152
while \f2fastIncrement\f1 is the accelerated increment value. The \f2box\f1
153
parameter states whether the widget will be drawn with a box around it or not.
154
The \f2shadow\f1 parameter accepts a boolean value to turn the shadow on or
155
off around this widget. If the widget could not be created then a \f4NULL\f1
159
int activateCDKScale (CDKSCALE \f2scale\f1, chtype *\f2actions\f1);
161
This function activates the scale widget and lets the user interact with the
162
widget. The parameter \f2scale\f1 is a pointer to a non-NULL scale widget.
163
If the \f2actions\f1 parameter is passed with a non-NULL value, the characters
164
in the array will be injected into the widget. To activate the widget
165
interactively pass in a \f4NULL\f1 pointer for \f2actions\f1. If the character entered
166
into this widget is \f4RETURN\f1 or \f4TAB\f1 then this function will return a
167
value from the low value to the high value. It will also set the structure
168
member \f4exitType\f1 to \f4vNORMAL\f1. If the character entered into this
169
widget was \f4ESCAPE\f1 then the widget will return a value of -1 and the
170
structure member \f4exitType\f1 will be set to \f4vESCAPE_HIT\f1.
173
int injectCDKScale (CDKSCALE *\f2scale\f1, chtype \f2character\f1);
175
This function injects a single character into the widget. The parameter
176
\f2scale\f1 is a pointer to a non-NULL scale widget. The parameter
177
\f2character\f1 is the character to inject into the widget. If the character
178
injected into this widget was \f4RETURN\f1 then the character injected into
179
this widget is \f4RETURN\f1 or \f4TAB\f1 then this function will return a
180
value from the low value to the high value. It will also set the structure
181
member \f4exitType\f1 to \f4vNORMAL\f1. If the character entered into this
182
widget was \f4ESCAPE\f1 then the widget will return a value of -1 and the
183
structure member \f4exitType\f1 will be set to \f4vESCAPE_HIT\f1. Any other
184
character injected into the widget will set the structure member \f4exitType\f1
185
to \f4vEARLY_EXIT\f1 and the function will return -1.
188
void setCDKScale (CDKSCALE *\f2scale\f1, int \f2value\f1, int \f2minimumLength\f1, int \f2maximumLength\f1, boolean \f2box\f1);
190
This function lets the programmer modify certain elements of an already
191
defined scale widget. The parameter names correspond to the same parameter
192
names listed in the \f4newCDKScale\f1 function.
195
void setCDKScaleLowHigh (CDKSCALE *\f2scale\f1, int \f2lowValue\f1, int \f2highValue\f1);
197
This sets the low and high values of the widget.
200
int getCDKScaleLowValue (CDKSCALE *\f2scale\f1);
202
This returns the low value of the scale widget.
205
int getCDKScaleHighValue (CDKSCALE *\f2scale\f1);
207
This returns the high value of the scale widget.
210
void setCDKScaleValue (CDKSCALE *\f2scale\f1, int \f2value\f1);
212
This sets the current value of the widget.
215
int getCDKScaleValue (CDKSCALE *\f2scale\f1);
217
This returns the current value of the widget.
220
void setCDKScaleBox (CDKSCALE *\f2scale\f1, boolean \f2boxWidget\f1);
222
This sets whether or not the widget will be draw with a box around it.
225
boolean getCDKScaleBox (CDKSCALE *\f2scale\f1);
227
This returns whether or not the widget will be drawn with a box around it.
230
void setCDKScaleULChar (CDKSCALE *\f2scale\f1, chtype \f2character\f1);
232
This function sets the upper left hand corner of the widgets box to
236
void setCDKScaleURChar (CDKSCALE *\f2scale\f1, chtype \f2character\f1);
238
This function sets the upper right hand corner of the widgets box to
242
void setCDKScaleLLChar (CDKSCALE *\f2scale\f1, chtype \f2character\f1);
244
This function sets the lower left hand corner of the widgets box to
248
void setCDKScaleLRChar (CDKSCALE *\f2scale\f1, chtype \f2character\f1);
250
This function sets the lower right hand corner of the widgets box to
254
void setCDKScaleVerticalChar (CDKSCALE *\f2scale\f1, chtype \f2character\f1);
256
This function sets the vertical drawing character for the box to
260
void setCDKScaleHorizontalChar (CDKSCALE *\f2scale\f1, chtype \f2character\f1);
262
This function sets the horizontal drawing character for the box to
266
void setCDKScaleBoxAttribute (CDKSCALE *\f2scale\f1, chtype \f2attribute\f1);
268
This function sets the attribute of the box.
271
void setCDKScaleBackgroundColor (CDKSCALE *\f2scale\f1, char *\f2color\f1);
273
This sets the background color of the widget. The parameter \f2color\f1
274
is in the format of the Cdk format strings. To get more information look
275
at the \f4cdk_display\f1 manual page.
278
void moveCDKScale (CDKSCALE *\f2scale\f1, int \f2xpos\f1, int \f2ypos\f1, boolean \f2relative\f1, boolean \f2refresh\f1);
280
This function moves the given widget to the given position. The parameters
281
\f2xpos\f1 and \f2ypos\f1 is the new position of the widget. The parameter
282
\f2xpos\f1 can accept an integer value or one of the pre-defined values of
283
\f4TOP\f1, \f4BOTTOM\f1, and \f4CENTER\f1. The parameter \f2ypos\f1 can
284
accept an integer value or one of the pre-defined values of \f4LEFT\f1,
285
\f4RIGHT\f1, and \f4CENTER\f1. The parameter \f2relative\f1 states whether
286
the \f2xpos\f1/\f2ypos\f1 pair is a relative move or an absolute move. For
287
example if \f2xpos\f1 = 1 and \f2ypos\f1 = 2 and \f2relative\f1 = \f2TRUE\f1,
288
then the widget would move one row down and two columns right. If the value
289
of \f2relative\f1 was \f2FALSE\f1 then the widget would move to the position
290
(1,2). Do not use the values of \f4TOP\f1, \f4BOTTOM\f1, \f4LEFT\f1,
291
\f4RIGHT\f1, or \f4CENTER\f1 when \f2relative\f1 = \f4TRUE\f1. (wierd things
292
may happen). The final parameter \f2refresh\f1 is a boolean value which
293
states whether the widget will get refreshed after the move or not.
296
void positionCDKScale (CDKSCALE *\f2scale\f1);
298
This function allows the user to move the widget around the screen via the
299
cursor/keypad keys. The following key bindings can be used to move the
300
widget around the screen.
306
Up Arrow Moves the widget up one line.
307
Down Arrow Moves the widget down one line.
308
Left Arrow Moves the widget left one column
309
Right Arrow Moves the widget right one column
310
Keypad-1 Moves the widget down one line
312
Keypad-2 Moves the widget down one line.
313
Keypad-3 Moves the widget down one line
314
and right one column.
315
Keypad-4 Moves the widget left one column
316
Keypad-5 Centers the widget both vertically
318
Keypad-6 Moves the widget right one column
319
Keypad-7 Moves the widget up one line
321
Keypad-8 Moves the widget up one line.
322
Keypad-9 Moves the widget up one line
323
and right one column.
324
t Moves the widget to the top of the screen.
325
b Moves the widget to the bottom of the screen.
326
l Moves the widget to the left of the screen.
327
r Moves the widget to the right of the screen.
328
c Centers the widget between the left and
330
C Centers the widget between the top and
331
bottom of the window.
332
Escape Returns the widget to it's original position.
333
Return Exits the function and leaves the widget
339
Keypad means that if the keyboard you are using has a keypad, then the
340
Num-Lock light has to be on in order to use the keys as listed. (The
341
numeric keys at the top of the keyboard will work as well.)
343
void drawCDKScale (CDKSCALE *\f2scale\f1, boolean \f2box\f1);
345
This function draws the scale widget on the screen. The \f2box\f1 option
346
draws the widget with or without a box.
349
void eraseCDKScale (CDKSCALE *\f2scale\f1);
351
This function removes the widget from the screen. This does \f4NOT\f1 destroy
355
void destroyCDKScale (CDKSCALE *\f2scale\f1);
357
This function removes the widget from the screen and frees up any memory the
361
void setCDKScalePreProcess (CDKSCALE *\f2scale\f1, PROCESSFN \f2function\f1, void *\f2data\f1);
363
This function allows the user to have the widget call a function after a key
364
is hit and before the key is applied to the widget. The parameter \f2function\f1
365
if of type \f4PROCESSFN\f1. The parameter \f2data\f1 is a pointer to
366
\f4void\f1. To learn more about pre-processing read the \f4cdk_process\f1
370
void setCDKScalePostProcess (CDKSCALE *\f2scale\f1, PROCESSFN \f2function\f1, void *\f2data\f1);
372
This function allows the user to have the widget call a function after the
373
key has been applied to the widget. The parameter \f2function\f1 if of type
374
\f4PROCESSFN\f1. The parameter \f2data\f1 is a pointer to \f4void\f1. To
375
learn more about post-processing read the \f4cdk_process\f1 manual page.
378
void bindCDKObject (EObjectType \f2widgetType\f1, void *\f2object\f1, char \f2key\f1, BINDFN \f2function\f1, void *\f2data\f1);
380
This function allows the user to create special key bindings. The
381
\f2widgetType\f1 parameter is a defined type which states what Cdk object
382
type is being used. To learn more about the type \f4EObjectType\f1 read
383
the \f2cdk_binding\f1 manual page. The \f2object\f1 parameter is the pointer
384
to the widget object. The \f2key\f1 is the character to bind. The
385
\f2function\f1 is the function type. To learn more about the key binding
386
callback function types read the \f4cdk_binding\f1 manual page. The last
387
parameter \f2data\f1 is a pointer to any data that needs to get passed to
388
the callback function.
392
When the widget is activated there are several default key bindings which will
393
help the user enter or manipulate the information quickly. The following table
394
outlines the keys and their actions for this widget.
399
Left Arrow Decrements the value in the field
400
by the normal decrement value.
401
Down Arrow Decrements the value in the field
402
by the normal decrement value.
403
d Decrements the value in the field
404
by the normal decrement value.
405
- Decrements the value in the field
406
by the normal decrement value.
407
Right Arrow Increments the value in the field
408
by the normal increment value.
409
Up Arrow Increments the value in the field
410
by the normal increment value.
411
u Increments the value in the field
412
by the normal increment value.
413
+ Increments the value in the field
414
by the normal increment value.
415
Prev Page Decrements the value in the field
416
by the accelerated decrement value.
417
U Decrements the value in the field
418
by the accelerated decrement value.
419
Ctrl-B Decrements the value in the field
420
by the accelerated decrement value.
421
Next Page Increments the value in the field
422
by the accelerated increment value.
423
D Increments the value in the field
424
by the accelerated increment value.
425
Ctrl-F Increments the value in the field
426
by the accelerated increment value.
427
Home Sets the value to the low value.
428
g Sets the value to the low value.
429
0 Sets the value to the low value.
430
End Sets the value to the high value.
431
G Sets the value to the high value.
432
$ Sets the value to the high value.
433
Return Exits the widget and returns an
434
integer value representing which
435
item was selected. This also sets
436
the structure member \f4exitType\f1
437
in the widget pointer to the value of
439
Tab Exits the widget and returns an integer
440
value representing which item was
441
selected. This also sets the structure
442
member \f4exitType\f1 in the widget pointer
443
to the value of \f4vNORMAL\f1.
444
Escape Exits the widget and returns -1. This
445
also sets the structure member \f4exitType\f1
446
in the widget pointer to the value of
448
Ctrl-R Refreshes the screen.
458
The header file \f4<cdk.h>\f1 automatically includes the header files
459
\f4<curses.h>\f1, \f4<stdlib.h>\f1, \f4<string.h>\f1, \f4<ctype.h>\f1,
460
\f4<unistd.h>\f1, \f4<dirent.h>\f1, \f4<time.h>\f1, \f4<errno.h>\f1,
461
\f4<pwd.h>\f1, \f4<grp.h>\f1, \f4<sys/stat.h>\f1, and \f4<sys/types.h>\f1.
462
The \f4<curses.h>\f1 header file includes \f4<stdio.h>\f1 and \f4<unctrl.h>\f1.
464
If you have \f4Ncurses\f1 installed on your machine add -DNCURSES to the
465
compile line to include the Ncurses header files instead.