~cfuhrman/+junk/netbsd-othersrc-trunk

« back to all changes in this revision

Viewing changes to dist/cdk/man/cdk_scale.3

  • Committer: garbled
  • Date: 2001-01-04 19:59:48 UTC
  • Revision ID: svn-v4:288d5a72-fed7-e111-8680-000c29dcf8fe:trunk:174
Initial import of CDK 4.9.9.  The work to port this was performed by
Charles Hannum, and that is the version being imported:
cdk-4.9.9-20000407-myc3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
.de It
 
2
.br
 
3
.ie \\n(.$>=3 .ne \\$3
 
4
.el .ne 3
 
5
.IP "\\$1" \\$2
 
6
..
 
7
.TH cdk_scale 3 "24 April 1997"
 
8
.SH NAME
 
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.
 
20
.SH SYNOPSIS
 
21
.LP
 
22
.B cc
 
23
.RI "[ " "flag" " \|.\|.\|. ] " "file" " \|.\|.\|."
 
24
.B \-lcdk
 
25
.RI "[ " "library" " \|.\|.\|. ]"
 
26
.LP
 
27
#include <cdk.h>
 
28
.LP
 
29
.BI "CDKSCALE *newCDKScale (CDKSCREEN *" "cdkscreen",
 
30
.BI "int " "xpos",
 
31
.BI "int " "ypos",
 
32
.BI "char *" "title",
 
33
.BI "char *" "label",
 
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",
 
41
.BI "boolean " "box",
 
42
.BI "boolean " "shadow");
 
43
.LP
 
44
.BI "int activateCDKScale (CDKSCALE *" "scale",
 
45
.BI "chtype *" "actions");
 
46
.LP
 
47
.BI "int injectCDKScale (CDKSCALE *" "scale",
 
48
.BI "chtype " "input");
 
49
.LP
 
50
.BI "void setCDKScale (CDKSCALE *" "scale",
 
51
.BI "int " "lowValue",
 
52
.BI "int " "highValue",
 
53
.BI "int " "currentValue",
 
54
.BI "boolean " "box");
 
55
.LP
 
56
.BI "void setCDKScaleLowHigh (CDKSCALE *" "scale",
 
57
.BI "int " "low",
 
58
.BI "int " "high");
 
59
.LP
 
60
.BI "int getCDKScaleLowValue ((CDKSCALE *" "scale");
 
61
.LP
 
62
.BI "int getCDKScaleHighValue ((CDKSCALE *" "scale");
 
63
.LP
 
64
.BI "void setCDKScaleValue (CDKSCALE *" "scale",
 
65
.BI "int " "value");
 
66
.LP
 
67
.BI "int getCDKScaleValue (CDKSCALE *" "scale");
 
68
.LP
 
69
.BI "void setCDKScaleBox (CDKSCALE *" "scale",
 
70
.BI "boolean " "box");
 
71
.LP
 
72
.BI "boolean getCDKScaleBox (CDKSCALE *" "scale");
 
73
.LP
 
74
.BI "void setCDKScaleULChar (CDKSCALE *", "scale",
 
75
.BI "chtype " "character");
 
76
.LP
 
77
.BI "void setCDKScaleURChar (CDKSCALE *", "scale",
 
78
.BI "chtype " "character");
 
79
.LP
 
80
.BI "void setCDKScaleLLChar (CDKSCALE *", "scale",
 
81
.BI "chtype " "character");
 
82
.LP
 
83
.BI "void setCDKScaleLRChar (CDKSCALE *", "scale",
 
84
.BI "chtype " "character");
 
85
.LP
 
86
.BI "void setCDKScaleVerticalChar (CDKSCALE *", "scale",
 
87
.BI "chtype " "character");
 
88
.LP
 
89
.BI "void setCDKScaleHorizontalChar (CDKSCALE *", "scale",
 
90
.BI "chtype " "character");
 
91
.LP
 
92
.BI "void setCDKScaleBoxAttribute (CDKSCALE *", "scale",
 
93
.BI "chtype " "character");
 
94
.LP
 
95
.BI "void setCDKScaleBackgroundColor (CDKSCALE *", "scale",
 
96
.BI "char * " "color");
 
97
.LP
 
98
.BI "void moveCDKScale (CDKSCALE *" "scale",
 
99
.BI "int " "box",
 
100
.BI "int " "box",
 
101
.BI "boolean " "relative",
 
102
.BI "boolean " "refresh");
 
103
.LP
 
104
.BI "void positionCDKScale (CDKSCALE *" "scale");
 
105
.LP
 
106
.BI "void drawCDKScale (CDKSCALE *" "scale",
 
107
.BI "boolean " "box");
 
108
.LP
 
109
.BI "void eraseCDKScale (CDKSCALE *" "scale");
 
110
.LP
 
111
.BI "void destroyCDKScale (CDKSCALE *" "scale");
 
112
.LP
 
113
.BI "void setCDKScalePreProcess (CDKSCALE *" "scale",
 
114
.BI "PROCESSFN " "callback",
 
115
.BI "void * " "data");
 
116
.LP
 
117
.BI "void setCDKScalePostProcess (CDKSCALE *" "scale",
 
118
.BI "PROCESSFN " "callback",
 
119
.BI "void * " "data");
 
120
.LP
 
121
.BI "void bindCDKObject (EObjectType " "widgetType",
 
122
.BI "void *" "object",
 
123
.BI "chtype " "key",
 
124
.BI "BINDFN " "function",
 
125
.BI "void *" "data");
 
126
.SH DESCRIPTION
 
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.
 
129
 
 
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);
 
132
.RS 3
 
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
 
156
pointer is returned.
 
157
.RE
 
158
 
 
159
int activateCDKScale (CDKSCALE \f2scale\f1, chtype *\f2actions\f1);
 
160
.RS 3
 
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.
 
171
.RE
 
172
 
 
173
int injectCDKScale (CDKSCALE *\f2scale\f1, chtype \f2character\f1);
 
174
.RS 3
 
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.
 
186
.RE
 
187
 
 
188
void setCDKScale (CDKSCALE *\f2scale\f1, int \f2value\f1, int \f2minimumLength\f1, int \f2maximumLength\f1, boolean \f2box\f1);
 
189
.RS 3
 
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.
 
193
.RE
 
194
 
 
195
void setCDKScaleLowHigh (CDKSCALE *\f2scale\f1, int \f2lowValue\f1, int \f2highValue\f1);
 
196
.RS 3
 
197
This sets the low and high values of the widget.
 
198
.RE
 
199
 
 
200
int getCDKScaleLowValue (CDKSCALE *\f2scale\f1);
 
201
.RS 3
 
202
This returns the low value of the scale widget.
 
203
.RE
 
204
 
 
205
int getCDKScaleHighValue (CDKSCALE *\f2scale\f1);
 
206
.RS 3
 
207
This returns the high value of the scale widget.
 
208
.RE
 
209
 
 
210
void setCDKScaleValue (CDKSCALE *\f2scale\f1, int \f2value\f1);
 
211
.RS 3
 
212
This sets the current value of the widget.
 
213
.RE
 
214
 
 
215
int getCDKScaleValue (CDKSCALE *\f2scale\f1);
 
216
.RS 3
 
217
This returns the current value of the widget.
 
218
.RE
 
219
 
 
220
void setCDKScaleBox (CDKSCALE *\f2scale\f1, boolean \f2boxWidget\f1);
 
221
.RS 3
 
222
This sets whether or not the widget will be draw with a box around it.
 
223
.RE
 
224
 
 
225
boolean getCDKScaleBox (CDKSCALE *\f2scale\f1);
 
226
.RS 3
 
227
This returns whether or not the widget will be drawn with a box around it.
 
228
.RE
 
229
 
 
230
void setCDKScaleULChar (CDKSCALE *\f2scale\f1, chtype \f2character\f1);
 
231
.RS 3
 
232
This function sets the upper left hand corner of the widgets box to
 
233
the given character.
 
234
.RE
 
235
 
 
236
void setCDKScaleURChar (CDKSCALE *\f2scale\f1, chtype \f2character\f1);
 
237
.RS 3
 
238
This function sets the upper right hand corner of the widgets box to
 
239
the given character.
 
240
.RE
 
241
 
 
242
void setCDKScaleLLChar (CDKSCALE *\f2scale\f1, chtype \f2character\f1);
 
243
.RS 3
 
244
This function sets the lower left hand corner of the widgets box to
 
245
the given character.
 
246
.RE
 
247
 
 
248
void setCDKScaleLRChar (CDKSCALE *\f2scale\f1, chtype \f2character\f1);
 
249
.RS 3
 
250
This function sets the lower right hand corner of the widgets box to
 
251
the given character.
 
252
.RE
 
253
 
 
254
void setCDKScaleVerticalChar (CDKSCALE *\f2scale\f1, chtype \f2character\f1);
 
255
.RS 3
 
256
This function sets the vertical drawing character for the box to
 
257
the given character.
 
258
.RE
 
259
 
 
260
void setCDKScaleHorizontalChar (CDKSCALE *\f2scale\f1, chtype \f2character\f1);
 
261
.RS 3
 
262
This function sets the horizontal drawing character for the box to
 
263
the given character.
 
264
.RE
 
265
 
 
266
void setCDKScaleBoxAttribute (CDKSCALE *\f2scale\f1, chtype \f2attribute\f1);
 
267
.RS 3
 
268
This function sets the attribute of the box.
 
269
.RE
 
270
 
 
271
void setCDKScaleBackgroundColor (CDKSCALE *\f2scale\f1, char *\f2color\f1);
 
272
.RS 3
 
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.
 
276
.RE
 
277
 
 
278
void moveCDKScale (CDKSCALE *\f2scale\f1, int \f2xpos\f1, int \f2ypos\f1, boolean \f2relative\f1, boolean \f2refresh\f1);
 
279
.RS 3
 
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.
 
294
.RE
 
295
 
 
296
void positionCDKScale (CDKSCALE *\f2scale\f1);
 
297
.RS 3
 
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.
 
301
.LP
 
302
.nf
 
303
\f4Key Bindings\f1
 
304
.RS 3
 
305
\f2Key          Action\f1
 
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
 
311
             and left one column.
 
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
 
317
             and horizontally.
 
318
Keypad-6     Moves the widget right one column
 
319
Keypad-7     Moves the widget up one line
 
320
             and left one column.
 
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 
 
329
             right of the window.
 
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
 
334
             where it was.
 
335
.fi
 
336
.RE
 
337
.RS 3
 
338
.LP
 
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.)
 
342
.LP
 
343
void drawCDKScale (CDKSCALE *\f2scale\f1, boolean \f2box\f1);
 
344
.RS 3
 
345
This function draws the scale widget on the screen. The \f2box\f1 option 
 
346
draws the widget with or without a box.
 
347
.RE
 
348
 
 
349
void eraseCDKScale (CDKSCALE *\f2scale\f1);
 
350
.RS 3
 
351
This function removes the widget from the screen. This does \f4NOT\f1 destroy
 
352
the widget.
 
353
.RE
 
354
 
 
355
void destroyCDKScale (CDKSCALE *\f2scale\f1);
 
356
.RS 3
 
357
This function removes the widget from the screen and frees up any memory the
 
358
object may be using.
 
359
.RE
 
360
 
 
361
void setCDKScalePreProcess (CDKSCALE *\f2scale\f1, PROCESSFN \f2function\f1, void *\f2data\f1);
 
362
.RS 3
 
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
 
367
manual page.
 
368
.RE
 
369
 
 
370
void setCDKScalePostProcess (CDKSCALE *\f2scale\f1, PROCESSFN \f2function\f1, void *\f2data\f1);
 
371
.RS 3
 
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.
 
376
.RE
 
377
 
 
378
void bindCDKObject (EObjectType \f2widgetType\f1, void *\f2object\f1, char \f2key\f1, BINDFN \f2function\f1, void *\f2data\f1);
 
379
.RS 3
 
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.
 
389
.RE
 
390
 
 
391
.SH KEY BINDINGS
 
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.
 
395
.LP
 
396
.nf
 
397
.RS 3
 
398
\f2Key         Action\f1
 
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
 
438
            \f4vNORMAL\f1.
 
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 
 
447
            \f4vESCAPE_HIT\f1.
 
448
Ctrl-R      Refreshes the screen.
 
449
.RE
 
450
.fi
 
451
.SH SEE ALSO
 
452
.BR cdk (3),
 
453
.BR cdk_binding (3),
 
454
.BR cdk_display (3),
 
455
.BR cdk_screen (3)
 
456
.SH NOTES
 
457
.PP
 
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.
 
463
.PP
 
464
If you have \f4Ncurses\f1 installed on your machine add -DNCURSES to the 
 
465
compile line to include the Ncurses header files instead.