1cdk_fslider(3) Library Functions Manual cdk_fslider(3)
2
3
4
6 cdk_fslider - curses slider widget (type float)
7
9 cc [ flag ... ] file ... -lcdk [ library ... ]
10
11 #include <cdk.h>
12
13 int activateCDKFSlider (
14 CDKFSLIDER *slider,
15 chtype *actions);
16
17 void destroyCDKFSlider (
18 CDKFSLIDER *slider);
19
20 void drawCDKFSlider (
21 CDKFSLIDER *slider,
22 boolean box);
23
24 void eraseCDKFSlider (
25 CDKFSLIDER *slider);
26
27 boolean getCDKFSliderBox (
28 CDKFSLIDER *slider);
29
30 int getCDKFSliderDigits (
31 CDKFSLIDER *scale);
32
33 float getCDKFSliderHighValue (
34 CDKFSLIDER *slider);
35
36 float getCDKFSliderLowValue (
37 CDKFSLIDER *slider);
38
39 float getCDKFSliderValue (
40 CDKFSLIDER *slider);
41
42 float injectCDKFSlider (
43 CDKFSLIDER *slider,
44 chtype input);
45
46 void moveCDKFSlider (
47 CDKFSLIDER *slider,
48 int xpos,
49 int ypos,
50 boolean relative,
51 boolean refresh);
52
53 CDKFSLIDER *newCDKFSlider (
54 CDKSCREEN *cdkscreen,
55 int xpos,
56 int ypos,
57 char *title,
58 char *label,
59 chtype fillerCharacter,
60 int fieldWidth,
61 int currentValue,
62 float lowValue,
63 float highValue,
64 float increment,
65 float fastIncrement,
66 int digits,
67 boolean box,
68 boolean shadow);
69
70 void positionCDKFSlider (
71 CDKFSLIDER *slider);
72
73 void setCDKFSlider (
74 CDKFSLIDER *slider,
75 float lowValue,
76 float highValue,
77 float currentValue,
78 boolean box);
79
80 void setCDKFSliderBackgroundAttrib (
81 CDKFSLIDER *slider,
82 chtype attribute);
83
84 void setCDKFSliderBackgroundColor (
85 CDKFSLIDER *slider,
86 char * color);
87
88 void setCDKFSliderBox (
89 CDKFSLIDER *slider,
90 boolean boxWidget);
91
92 void setCDKFSliderBoxAttribute (
93 CDKFSLIDER *slider,
94 chtype character);
95
96 void setCDKFSliderDigits (
97 CDKFSLIDER *scale,
98 int digits);
99
100 void setCDKFSliderHorizontalChar (
101 CDKFSLIDER *slider,
102 chtype character);
103
104 void setCDKFSliderLLChar (
105 CDKFSLIDER *slider,
106 chtype character);
107
108 void setCDKFSliderLRChar (
109 CDKFSLIDER *slider,
110 chtype character);
111
112 void setCDKFSliderLowHigh (
113 CDKFSLIDER *slider,
114 float lowValue,
115 float highValue);
116
117 void setCDKFSliderPostProcess (
118 CDKFSLIDER *slider,
119 PROCESSFN callback,
120 void * data);
121
122 void setCDKFSliderPreProcess (
123 CDKFSLIDER *slider,
124 PROCESSFN callback,
125 void * data);
126
127 void setCDKFSliderULChar (
128 CDKFSLIDER *slider,
129 chtype character);
130
131 void setCDKFSliderURChar (
132 CDKFSLIDER *slider,
133 chtype character);
134
135 void setCDKFSliderValue (
136 CDKFSLIDER *slider,
137 float value);
138
139 void setCDKFSliderVerticalChar (
140 CDKFSLIDER *slider,
141 chtype character);
142
144 The Cdk slider widget creates a visual slider box with a label and a
145 slider field. The following are functions which create or manipulate
146 the Cdk slider box widget.
147
149 activateCDKFSlider
150 activates the slider widget and lets the user interact with the
151 widget. The parameter slider is a pointer to a non-NULL slider
152 widget. If the actions parameter is passed with a non-NULL value,
153 the characters in the array will be injected into the widget. To
154 activate the widget interactively pass in a NULL pointer for
155 actions. If the character entered into this widget is RETURN or
156 TAB then this function will return a value from the low value to
157 the high value. It will also set the widget data exitType to
158 vNORMAL. If the character entered into this widget was ESCAPE
159 then the widget returns the unknownFloat value (see the cdk_objs.h
160 header file). The widget data exitType is set to vESCAPE_HIT.
161
162 destroyCDKFSlider
163 removes the widget from the screen and frees memory the object
164 used.
165
166 drawCDKFSlider
167 draws the slider widget on the screen. If the box option is true,
168 the widget is drawn with a box.
169
170 eraseCDKFSlider
171 removes the widget from the screen. This does NOT destroy the
172 widget.
173
174 getCDKFSliderBox
175 returns true if the widget will be drawn with a box around it.
176
177 getCDKFSliderDigits
178 returns the number of digits shown after the decimal point for the
179 box value.
180
181 getCDKFSliderHighValue
182 returns the high value of the slider widget.
183
184 getCDKFSliderLowValue
185 returns the low value of the slider widget.
186
187 getCDKFSliderValue
188 returns the current value of the widget.
189
190 injectCDKFSlider
191 injects a single character into the widget. The parameter slider
192 is a pointer to a non-NULL slider widget. The parameter character
193 is the character to inject into the widget. The return value and
194 side-effect (setting the widget data exitType) depend upon the
195 injected character:
196
197 RETURN or TAB
198 the function returns a value ranging from the slider's low
199 value to the slider's high value. The widget data exitType
200 is set to vNORMAL.
201
202 ESCAPE the function returns the unknownFloat value (see the
203 cdk_objs.h header file). The widget data exitType is set
204 to vESCAPE_HIT.
205
206 Otherwise
207 unless modified by preprocessing, postprocessing or key
208 bindings, the function returns the unknownFloat value (see
209 the cdk_objs.h header file). The widget data exitType is
210 set to vEARLY_EXIT.
211
212 moveCDKFSlider
213 moves the given widget to the given position. The parameters xpos
214 and ypos are the new position of the widget. The parameter xpos
215 may be an integer or one of the pre-defined values TOP, BOTTOM,
216 and CENTER. The parameter ypos may be an integer or one of the
217 pre-defined values LEFT, RIGHT, and CENTER. The parameter rela‐
218 tive states whether the xpos/ypos pair is a relative move or an
219 absolute move. For example, if xpos = 1 and ypos = 2 and relative
220 = TRUE, then the widget would move one row down and two columns
221 right. If the value of relative was FALSE then the widget would
222 move to the position (1,2). Do not use the values TOP, BOTTOM,
223 LEFT, RIGHT, or CENTER when relative = TRUE. (weird things may
224 happen). The final parameter refresh is a boolean value which
225 states whether the widget will get refreshed after the move.
226
227 newCDKFSlider
228 function creates a slider widget and returns a pointer to it..
229 Parameters:
230
231 screen
232 is the screen you wish this widget to be placed in.
233
234 xpos controls the placement of the object along the horizontal
235 axis. It may be an integer or one of the pre-defined values
236 LEFT, RIGHT, and CENTER.
237
238 ypos controls the placement of the object along the vertical axis.
239 It may be an integer or one of the pre-defined values TOP,
240 BOTTOM, and CENTER.
241
242 title
243 is the string to display at the top of the widget. The title
244 can be more than one line; just provide a carriage return
245 character at the line break.
246
247 label
248 is the string to display in the label of the slider field.
249
250 fillerCharacter
251 is the character to be used to draw the slider bar in the
252 field.
253
254 fieldWidth
255 controls the width of the widget. If you provide a value of
256 zero the widget will be created with the full width of the
257 screen. If you provide a negative value, the widget will be
258 created the full width minus the value provided.
259
260 currentValue
261 is the value of the slider field when the widget is acti‐
262 vated.
263
264 lowValue and
265
266 highValue
267 are the low and high values of the widget respectively.
268
269 increment
270 is the regular increment value
271
272 fastIncrement
273 is the accelerated increment value.
274
275 box is true if the widget should be drawn with a box around it.
276
277 shadow
278 turns the shadow on or off around this widget.
279
280 If the widget could not be created then a NULL pointer is
281 returned.
282
283 positionCDKFSlider
284 allows the user to move the widget around the screen via the cur‐
285 sor/keypad keys. See cdk_position (3) for key bindings.
286
287 setCDKFSlider
288 lets the programmer modify certain elements of an existing slider
289 widget. The parameter names correspond to the same parameter
290 names listed in the newCDKFSlider function.
291
292 setCDKFSliderBackgroundAttrib
293 sets the background attribute of the widget. The parameter
294 attribute is a curses attribute, e.g., A_BOLD.
295
296 setCDKFSliderBackgroundColor
297 sets the background color of the widget. The parameter color is
298 in the format of the Cdk format strings. See cdk_display (3).
299
300 setCDKFSliderBox
301 sets whether the widget will be drawn with a box around it.
302
303 setCDKFSliderBoxAttribute
304 function sets the attribute of the box.
305
306 setCDKFSliderDigits
307 sets the number of digits shown after the decimal point for the
308 box value.
309
310 setCDKFSliderHorizontalChar
311 sets the horizontal drawing character for the box to the given
312 character.
313
314 setCDKFSliderLLChar
315 sets the lower left hand corner of the widget's box to the given
316 character.
317
318 setCDKFSliderLRChar
319 sets the lower right hand corner of the widget's box to the given
320 character.
321
322 setCDKFSliderLowHigh
323 sets the low and high values of the widget.
324
325 setCDKFSliderPostProcess
326 allows the user to have the widget call a function after the key
327 has been applied to the widget. The parameter function is the
328 callback function. The parameter data points to data passed to
329 the callback function. To learn more about post-processing see
330 cdk_process [4m(3).
331
332 setCDKFSliderPreProcess
333 allows the user to have the widget call a function after a key is
334 hit and before the key is applied to the widget. The parameter
335 function is the callback function. The parameter data points to
336 data passed to the callback function. To learn more about pre-
337 processing see cdk_process [4m(3).
338
339 setCDKFSliderULChar
340 sets the upper left hand corner of the widget's box to the given
341 character.
342
343 setCDKFSliderURChar
344 sets the upper right hand corner of the widget's box to the given
345 character.
346
347 setCDKFSliderValue
348 sets the current value of the widget.
349
350 setCDKFSliderVerticalChar
351 sets the vertical drawing character for the box to the given char‐
352 acter.
353
355 When the widget is activated there are several default key bindings
356 which will help the user enter or manipulate the information quickly.
357 The following table outlines the keys and their actions for this wid‐
358 get.
359
360 ┌─────────────────────────────────────────────────────────────────────┐
361 │Key Action │
362 ├─────────────────────────────────────────────────────────────────────┤
363 │Down Arrow Decrements the field by the normal decrement │
364 │ value. │
365 │Up Arrow Increments the field by the normal increment │
366 │ value. │
367 │u Increments the field by the normal increment │
368 │ value. │
369 │Prev Page Decrements the field by the accelerated decrement │
370 │ value. │
371 │U Decrements the field by the accelerated decrement │
372 │ value. │
373 │Ctrl-B Decrements the field by the accelerated decrement │
374 │ value. │
375 │Next Page Increments the field by the accelerated increment │
376 │ value. │
377 │D Increments the field by the accelerated increment │
378 │ value. │
379 │Ctrl-F Increments the field by the accelerated increment │
380 │ value. │
381 │Home Sets the value to the low value. │
382 │g Sets the value to the low value. │
383 │End Sets the value to the high value. │
384 │G Sets the value to the high value. │
385 │$ Sets the value to the high value. │
386 │Return Exits the widget and returns the current value. │
387 │ This also sets the widget data exitType to vNOR‐ │
388 │ MAL. │
389 │Tab Exits the widget and returns the current value. │
390 │ This also sets the widget data exitType to vNOR‐ │
391 │ MAL. │
392 │Escape Exits the widget and returns the unknownFloat │
393 │ value (see the cdk_objs.h header file). This also │
394 │ sets the widget data exitType to vESCAPE_HIT. │
395 │Ctrl-R Refreshes the screen. │
396 └─────────────────────────────────────────────────────────────────────┘
397 If the cursor is not pointing to the field's value, the following key
398 bindings apply. You may use the left/right arrows to move the cursor
399 onto the field's value and modify it by typing characters to replace
400 the digits and sign.
401
402 ┌─────────────────────────────────────────────────────────────────────┐
403 │Key Action │
404 ├─────────────────────────────────────────────────────────────────────┤
405 │Left Arrow Decrements the scale by the normal value. │
406 │Right Arrow Increments the scale by the normal value. │
407 ├─────────────────────────────────────────────────────────────────────┤
408 │d Decrements the scale by the normal value. │
409 │D Increments the scale by the accelerated value. │
410 │- Decrements the scale by the normal value. │
411 │+ Increments the scale by the normal value. │
412 │0 Sets the scale to the low value. │
413 └─────────────────────────────────────────────────────────────────────┘
415 cdk(3), cdk_binding(3), cdk_display(3), cdk_position(3), cdk_screen(3)
416
417
418
419 cdk_fslider(3)