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 const char *title,
58 const 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 const 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.
152
153 · The parameter slider is a pointer to a non-NULL slider widget.
154
155 · If the actions parameter is passed with a non-NULL value, the
156 characters in the array will be injected into the widget.
157
158 To activate the widget interactively pass in a NULL pointer
159 for actions.
160
161 If the character entered into this widget is RETURN or TAB then
162 this function will return a value from the low value to the high
163 value. It will also set the widget data exitType to vNORMAL.
164
165 If the character entered into this widget was ESCAPE then the wid‐
166 get returns the unknownFloat value (see the cdk_objs.h header
167 file). The widget data exitType is set to vESCAPE_HIT.
168
169 destroyCDKFSlider
170 removes the widget from the screen and frees memory the object
171 used.
172
173 drawCDKFSlider
174 draws the slider widget on the screen. If the box option is true,
175 the widget is drawn with a box.
176
177 eraseCDKFSlider
178 removes the widget from the screen. This does NOT destroy the
179 widget.
180
181 getCDKFSliderBox
182 returns true if the widget will be drawn with a box around it.
183
184 getCDKFSliderDigits
185 returns the number of digits shown after the decimal point for the
186 box value.
187
188 getCDKFSliderHighValue
189 returns the high value of the slider widget.
190
191 getCDKFSliderLowValue
192 returns the low value of the slider widget.
193
194 getCDKFSliderValue
195 returns the current value of the widget.
196
197 injectCDKFSlider
198 injects a single character into the widget.
199
200 · The parameter slider is a pointer to a non-NULL slider widget.
201
202 · The parameter character is the character to inject into the
203 widget.
204
205 The return value and side-effect (setting the widget data
206 exitType) depend upon the injected character:
207
208 RETURN or TAB
209 the function returns a value ranging from the slider's
210 low value to the slider's high value. The widget data
211 exitType is set to vNORMAL.
212
213 ESCAPE the function returns the unknownFloat value (see the
214 cdk_objs.h header file). The widget data exitType is
215 set to vESCAPE_HIT.
216
217 Otherwise unless modified by preprocessing, postprocessing or key
218 bindings, the function returns the unknownFloat value (see the
219 cdk_objs.h header file). The widget data exitType is set to
220 vEARLY_EXIT.
221
222 moveCDKFSlider
223 moves the given widget to the given position.
224
225 · The parameters xpos and ypos are the new position of the wid‐
226 get.
227
228 The parameter xpos may be an integer or one of the pre-defined
229 values TOP, BOTTOM, and CENTER.
230
231 The parameter ypos may be an integer or one of the pre-defined
232 values LEFT, RIGHT, and CENTER.
233
234 · The parameter relative states whether the xpos/ypos pair is a
235 relative move or an absolute move.
236
237 For example, if xpos = 1 and ypos = 2 and relative = TRUE,
238 then the widget would move one row down and two columns right.
239 If the value of relative was FALSE, then the widget would move
240 to the position (1,2).
241
242 Do not use the values TOP, BOTTOM, LEFT, RIGHT, or CENTER when
243 relative = TRUE. (weird things may happen).
244
245 · The final parameter refresh is a boolean value which states
246 whether the widget will get refreshed after the move.
247
248 newCDKFSlider
249 function creates a slider widget and returns a pointer to it..
250 Parameters:
251
252 screen
253 is the screen you wish this widget to be placed in.
254
255 xpos controls the placement of the object along the horizontal
256 axis. It may be an integer or one of the pre-defined values
257 LEFT, RIGHT, and CENTER.
258
259 ypos controls the placement of the object along the vertical axis.
260 It may be an integer or one of the pre-defined values TOP,
261 BOTTOM, and CENTER.
262
263 title
264 is the string to display at the top of the widget. The title
265 can be more than one line; just provide a carriage return
266 character at the line break.
267
268 label
269 is the string to display in the label of the slider field.
270
271 fillerCharacter
272 is the character to be used to draw the slider bar in the
273 field.
274
275 fieldWidth
276 controls the width of the widget. If you provide a value of
277 zero the widget will be created with the full width of the
278 screen. If you provide a negative value, the widget will be
279 created the full width minus the value provided.
280
281 currentValue
282 is the value of the slider field when the widget is acti‐
283 vated.
284
285 lowValue and
286
287 highValue
288 are the low and high values of the widget respectively.
289
290 increment
291 is the regular increment value
292
293 fastIncrement
294 is the accelerated increment value.
295
296 box is true if the widget should be drawn with a box around it.
297
298 shadow
299 turns the shadow on or off around this widget.
300
301 If the widget could not be created then a NULL pointer is
302 returned.
303
304 positionCDKFSlider
305 allows the user to move the widget around the screen via the cur‐
306 sor/keypad keys. See cdk_position (3) for key bindings.
307
308 setCDKFSlider
309 lets the programmer modify certain elements of an existing slider
310 widget. The parameter names correspond to the same parameter
311 names listed in the newCDKFSlider function.
312
313 setCDKFSliderBackgroundAttrib
314 sets the background attribute of the widget.
315
316 The parameter attribute is a curses attribute, e.g., A_BOLD.
317
318 setCDKFSliderBackgroundColor
319 sets the background color of the widget.
320
321 The parameter color is in the format of the Cdk format strings.
322
323 See cdk_display (3).
324
325 setCDKFSliderBox
326 sets whether the widget will be drawn with a box around it.
327
328 setCDKFSliderBoxAttribute
329 function sets the attribute of the box.
330
331 setCDKFSliderDigits
332 sets the number of digits shown after the decimal point for the
333 box value.
334
335 setCDKFSliderHorizontalChar
336 sets the horizontal drawing character for the box to the given
337 character.
338
339 setCDKFSliderLLChar
340 sets the lower left hand corner of the widget's box to the given
341 character.
342
343 setCDKFSliderLRChar
344 sets the lower right hand corner of the widget's box to the given
345 character.
346
347 setCDKFSliderLowHigh
348 sets the low and high values of the widget.
349
350 setCDKFSliderPostProcess
351 allows the user to have the widget call a function after the key
352 has been applied to the widget.
353
354 · The parameter function is the callback function.
355
356 · The parameter data points to data passed to the callback func‐
357 tion.
358
359 To learn more about post-processing see cdk_process [4m(3).
360
361 setCDKFSliderPreProcess
362 allows the user to have the widget call a function after a key is
363 hit and before the key is applied to the widget.
364
365 · The parameter function is the callback function.
366
367 · The parameter data points to data passed to the callback func‐
368 tion.
369
370 To learn more about pre-processing see cdk_process [4m(3).
371
372 setCDKFSliderULChar
373 sets the upper left hand corner of the widget's box to the given
374 character.
375
376 setCDKFSliderURChar
377 sets the upper right hand corner of the widget's box to the given
378 character.
379
380 setCDKFSliderValue
381 sets the current value of the widget.
382
383 setCDKFSliderVerticalChar
384 sets the vertical drawing character for the box to the given char‐
385 acter.
386
388 When the widget is activated there are several default key bindings
389 which will help the user enter or manipulate the information quickly.
390 The following table outlines the keys and their actions for this wid‐
391 get.
392
393 ┌─────────────────────────────────────────────────────────────────────┐
394 │Key Action │
395 ├─────────────────────────────────────────────────────────────────────┤
396 │Down Arrow Decrements the field by the normal decrement │
397 │ value. │
398 │Up Arrow Increments the field by the normal increment │
399 │ value. │
400 │u Increments the field by the normal increment │
401 │ value. │
402 │Prev Page Decrements the field by the accelerated decrement │
403 │ value. │
404 │U Decrements the field by the accelerated decrement │
405 │ value. │
406 │Ctrl-B Decrements the field by the accelerated decrement │
407 │ value. │
408 │Next Page Increments the field by the accelerated increment │
409 │ value. │
410 │D Increments the field by the accelerated increment │
411 │ value. │
412 │Ctrl-F Increments the field by the accelerated increment │
413 │ value. │
414 │Home Sets the value to the low value. │
415 │g Sets the value to the low value. │
416 │End Sets the value to the high value. │
417 │G Sets the value to the high value. │
418 │$ Sets the value to the high value. │
419 │Return Exits the widget and returns the current value. │
420 │ This also sets the widget data exitType to vNOR‐ │
421 │ MAL. │
422 │Tab Exits the widget and returns the current value. │
423 │ This also sets the widget data exitType to vNOR‐ │
424 │ MAL. │
425 │Escape Exits the widget and returns the unknownFloat │
426 │ value (see the cdk_objs.h header file). This also │
427 │ sets the widget data exitType to vESCAPE_HIT. │
428 │Ctrl-R Refreshes the screen. │
429 └─────────────────────────────────────────────────────────────────────┘
430 If the cursor is not pointing to the field's value, the following key
431 bindings apply. You may use the left/right arrows to move the cursor
432 onto the field's value and modify it by typing characters to replace
433 the digits and sign.
434
435 ┌─────────────────────────────────────────────────────────────────────┐
436 │Key Action │
437 ├─────────────────────────────────────────────────────────────────────┤
438 │Left Arrow Decrements the scale by the normal value. │
439 │Right Arrow Increments the scale by the normal value. │
440 ├─────────────────────────────────────────────────────────────────────┤
441 │d Decrements the scale by the normal value. │
442 │D Increments the scale by the accelerated value. │
443 │- Decrements the scale by the normal value. │
444 │+ Increments the scale by the normal value. │
445 │0 Sets the scale to the low value. │
446 └─────────────────────────────────────────────────────────────────────┘
448 cdk(3), cdk_binding(3), cdk_display(3), cdk_position(3), cdk_screen(3)
449
450
451
452 cdk_fslider(3)