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