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