1cdk_dscale(3)              Library Functions Manual              cdk_dscale(3)
2
3
4

NAME

6       cdk_dscale - curses scale widget (type double).
7

SYNOPSIS

9       cc [ flag ... ] file ...  -lcdk [ library ... ]
10
11       #include <cdk.h>
12
13       double activateCDKDScale (
14                      CDKDSCALE *scale,
15                      chtype *actions);
16
17       void destroyCDKDScale (
18                      CDKDSCALE *scale);
19
20       void drawCDKDScale (
21                      CDKDSCALE *scale,
22                      boolean box);
23
24       void eraseCDKDScale (
25                      CDKDSCALE *scale);
26
27       boolean getCDKDScaleBox (
28                      CDKDSCALE *scale);
29
30       int getCDKDScaleDigits (
31                      CDKDSCALE *scale);
32
33       double getCDKDScaleHighValue (
34                      CDKDSCALE *scale);
35
36       double getCDKDScaleLowValue (
37                      CDKDSCALE *scale);
38
39       double getCDKDScaleValue (
40                      CDKDSCALE *scale);
41
42       int injectCDKDScale (
43                      CDKDSCALE *scale,
44                      chtype input);
45
46       void moveCDKDScale (
47                      CDKDSCALE *scale,
48                      int xpos,
49                      int ypos,
50                      boolean relative,
51                      boolean refresh);
52
53       CDKDSCALE *newCDKDScale (
54                      CDKSCREEN *cdkscreen,
55                      int xpos,
56                      int ypos,
57                      const char *title,
58                      const char *label,
59                      chtype fieldAttribute,
60                      int fieldWidth,
61                      double currentValue,
62                      double lowValue,
63                      double highValue,
64                      double increment,
65                      double fastIncrement,
66                      int digits,
67                      boolean box,
68                      boolean shadow);
69
70       void positionCDKDScale (
71                      CDKDSCALE *scale);
72
73       void setCDKDScale (
74                      CDKDSCALE *scale,
75                      double lowValue,
76                      double highValue,
77                      double currentValue,
78                      boolean box);
79
80       void setCDKDScaleBackgroundAttrib (
81                      CDKDSCALE *scale,
82                      chtype attribute);
83
84       void setCDKDScaleBackgroundColor (
85                      CDKDSCALE *scale,
86                      const char * color);
87
88       void setCDKDScaleBox (
89                      CDKDSCALE *scale,
90                      boolean box);
91
92       void setCDKDScaleBoxAttribute (
93                      CDKDSCALE *scale,
94                      chtype character);
95
96       void setCDKDScaleDigits (
97                      CDKDSCALE *scale,
98                      int digits);
99
100       void setCDKDScaleHorizontalChar (
101                      CDKDSCALE *scale,
102                      chtype character);
103
104       void setCDKDScaleLLChar (
105                      CDKDSCALE *scale,
106                      chtype character);
107
108       void setCDKDScaleLRChar (
109                      CDKDSCALE *scale,
110                      chtype character);
111
112       void setCDKDScaleLowHigh (
113                      CDKDSCALE *scale,
114                      double low,
115                      double high);
116
117       void setCDKDScalePostProcess (
118                      CDKDSCALE *scale,
119                      PROCESSFN callback,
120                      void * data);
121
122       void setCDKDScalePreProcess (
123                      CDKDSCALE *scale,
124                      PROCESSFN callback,
125                      void * data);
126
127       void setCDKDScaleULChar (
128                      CDKDSCALE *scale,
129                      chtype character);
130
131       void setCDKDScaleURChar (
132                      CDKDSCALE *scale,
133                      chtype character);
134
135       void setCDKDScaleValue (
136                      CDKDSCALE *scale,
137                      double value);
138
139       void setCDKDScaleVerticalChar (
140                      CDKDSCALE *scale,
141                      chtype character);
142

DESCRIPTION

144       The  Cdk  scale  widget  creates  a  scale box with a label and a scale
145       field.  The following functions create or manipulate the Cdk scale  box
146       widget.
147

AVAILABLE FUNCTIONS

149       activateCDKDScale
150            activates  the  scale  widget  and lets the user interact with the
151            widget.  The parameter scale is a pointer to a non-NULL scale wid‐
152            get.   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 will  return  the  unknownDouble  value  (see  the
160            cdk_objs.h  header file).  The widget data exitType will be set to
161            vESCAPE_HIT.
162
163       destroyCDKDScale
164            removes the widget from the screen and  frees  memory  the  object
165            used.
166
167       drawCDKDScale
168            draws  the  scale  widget  on the screen.  If the box parameter is
169            true, the widget is drawn with a box.
170
171       eraseCDKDScale
172            removes the widget from the screen.  This  does  NOT  destroy  the
173            widget.
174
175       getCDKDScaleBox
176            returns whether the widget will be drawn with a box around it.
177
178       getCDKDScaleDigits
179            returns the number of digits shown after the decimal point for the
180            box value.
181
182       getCDKDScaleHighValue
183            returns the high value of the scale widget.
184
185       getCDKDScaleLowValue
186            returns the low value of the scale widget.
187
188       getCDKDScaleValue
189            returns the current value of the widget.
190
191       injectCDKDScale
192            injects a single character into the widget.  The  parameter  scale
193            is  a pointer to a non-NULL scale widget.  The parameter character
194            is the character to inject into the widget.  The return value  and
195            side-effect  (setting  the  widget  data exitType) depend upon the
196            injected character:
197
198            RETURN or TAB
199                   the function returns a value ranging from the  scale's  low
200                   value  to the scale's high value.  The widget data exitType
201                   is set to vNORMAL.
202
203            ESCAPE the function  returns  the  unknownDouble  value  (see  the
204                   cdk_objs.h  header  file).  The widget data exitType is set
205                   to vESCAPE_HIT.
206
207            Otherwise
208                   unless modified by  preprocessing,  postprocessing  or  key
209                   bindings, the function returns the unknownDouble value (see
210                   the cdk_objs.h header file).  The widget data  exitType  is
211                   set to vEARLY_EXIT.
212
213       moveCDKDScale
214            moves the given widget to the given position.  The parameters xpos
215            and ypos are the new position of the widget.  The  parameter  xpos
216            may  be  an  integer or one of the pre-defined values TOP, BOTTOM,
217            and CENTER.  The parameter ypos may be an integer or  one  of  the
218            pre-defined  values  LEFT, RIGHT, and CENTER.  The parameter rela‐
219            tive states whether the xpos/ypos pair is a relative  move  or  an
220            absolute move.  For example, if xpos = 1 and ypos = 2 and relative
221            = TRUE, then the widget would move one row down  and  two  columns
222            right.   If  the value of relative was FALSE then the widget would
223            move to the position (1,2).  Do not use the  values  TOP,  BOTTOM,
224            LEFT,  RIGHT,  or  CENTER when relative = TRUE.  (weird things may
225            happen).  The final parameter refresh is  a  boolean  value  which
226            states whether the widget will get refreshed after the move.
227
228       newCDKDScale
229            creates a pointer to a scale widget.  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 scale field.
249
250            fieldAttribute
251                 is the attribute of the characters displayed in the field.
252
253            fieldWidth
254                 controls  the width of the widget.  If you provide a value of
255                 zero the widget will be created with the full  width  of  the
256                 screen.   If you provide a negative value, the widget will be
257                 created the full width minus the value provided.
258
259            currentValue
260                 is the value of the scale field when the widget is activated.
261
262            lowValue and
263
264            highValue
265                 are the low and high values of the widget respectively.
266
267            increment
268                 is the regular increment value
269
270            fastIncrement
271                 is the accelerated increment value.
272
273            box  is true if the widget should be drawn with a box around it.
274
275            shadow
276                 turns the shadow on or off around this widget.
277
278            If the widget  could  not  be  created  then  a  NULL  pointer  is
279            returned.
280
281       positionCDKDScale
282            allows  the user to move the widget around the screen via the cur‐
283            sor/keypad keys.  See cdk_position (3) for key bindings.
284
285       setCDKDScale
286            lets the programmer modify certain elements of an  existing  scale
287            widget.   The  parameter  names  correspond  to the same parameter
288            names listed in the newCDKDScale function.
289
290       setCDKDScaleBackgroundAttrib
291            sets the  background  attribute  of  the  widget.   The  parameter
292            attribute is a curses attribute, e.g., A_BOLD.
293
294       setCDKDScaleBackgroundColor
295            sets  the  background color of the widget.  The parameter color is
296            in the format of the Cdk format strings.  See cdk_display (3).
297
298       setCDKDScaleBox
299            sets whether the widget will be drawn with a box around it.
300
301       setCDKDScaleBoxAttribute
302            sets the attribute of the box.
303
304       setCDKDScaleDigits
305            sets the number of digits shown after the decimal  point  for  the
306            box value.
307
308       setCDKDScaleHorizontalChar
309            sets  the  horizontal  drawing  character for the box to the given
310            character.
311
312       setCDKDScaleLLChar
313            sets the lower left hand corner of the widget's box to  the  given
314            character.
315
316       setCDKDScaleLRChar
317            sets  the lower right hand corner of the widget's box to the given
318            character.
319
320       setCDKDScaleLowHigh
321            sets the low and high values of the widget.
322
323       setCDKDScalePostProcess
324            allows the user to have the widget call a function after  the  key
325            has  been  applied  to  the widget.  The parameter function is the
326            callback function.  The parameter data points to  data  passed  to
327            the  callback  function.   To learn more about post-processing see
328            cdk_process (3).
329
330       setCDKDScalePreProcess
331            allows the user to have the widget call a function after a key  is
332            hit  and  before  the key is applied to the widget.  The parameter
333            function is the callback function.  The parameter data  points  to
334            data  passed  to  the callback function.  To learn more about pre-
335            processing see cdk_process (3).
336
337       setCDKDScaleULChar
338            sets the upper left hand corner of the widget's box to  the  given
339            character.
340
341       setCDKDScaleURChar
342            sets  the upper right hand corner of the widget's box to the given
343            character.
344
345       setCDKDScaleValue
346            sets the current value of the widget.
347
348       setCDKDScaleVerticalChar
349            sets the vertical drawing character for the box to the given char‐
350            acter.
351

KEY BINDINGS

353       When  the  widget  is  activated there are several default key bindings
354       which will help the user enter or manipulate the  information  quickly.
355       The  following  table outlines the keys and their actions for this wid‐
356       get.
357
358       ┌─────────────────────────────────────────────────────────────────────┐
359Key               Action                                             
360       ├─────────────────────────────────────────────────────────────────────┤
361       │Down Arrow        Decrements the scale by the normal value.          │
362       │Up Arrow          Increments the scale by the normal value.          │
363       │u                 Increments the scale by the normal value.          │
364       │Prev Page         Decrements the scale by the accelerated value.     │
365       │U                 Decrements the scale by the accelerated value.     │
366       │Ctrl-B            Decrements the scale by the accelerated value.     │
367       │Next Page         Increments the scale by the accelerated value.     │
368       │Ctrl-F            Increments the scale by the accelerated value.     │
369       │Home              Sets the scale to the low value.                   │
370       │g                 Sets the scale to the low value.                   │
371       │^                 Sets the scale to the low value.                   │
372       │End               Sets the scale to the high value.                  │
373       │G                 Sets the scale to the high value.                  │
374       │$                 Sets the scale to the high value.                  │
375       │Return            Exits the widget and  returns  the  index  of  the │
376       │                  selected  value.   This  also sets the widget data │
377exitType to vNORMAL.                               │
378       │Tab               Exits the widget and  returns  the  index  of  the │
379       │                  selected  value.   This  also sets the widget data │
380exitType to vNORMAL.                               │
381       │Escape            Exits the widget  and  returns  the  unknownDouble │
382       │                  value (see the cdk_objs.h header file).  This also │
383       │                  sets the widget data exitType to vESCAPE_HIT.      │
384       │Ctrl-R            Refreshes the screen.                              │
385       └─────────────────────────────────────────────────────────────────────┘
386       If the cursor is not pointing to the field's value, the  following  key
387       bindings  apply.   You may use the left/right arrows to move the cursor
388       onto the field's value and modify it by typing  characters  to  replace
389       the digits and sign.
390
391       ┌─────────────────────────────────────────────────────────────────────┐
392Key               Action                                             
393       ├─────────────────────────────────────────────────────────────────────┤
394       │Left Arrow        Decrements the scale by the normal value.          │
395       │Right Arrow       Increments the scale by the normal value.          │
396       ├─────────────────────────────────────────────────────────────────────┤
397       │d                 Decrements the scale by the normal value.          │
398       │D                 Increments the scale by the accelerated value.     │
399       │-                 Decrements the scale by the normal value.          │
400       │+                 Increments the scale by the normal value.          │
401       │0                 Sets the scale to the low value.                   │
402       └─────────────────────────────────────────────────────────────────────┘

SEE ALSO

404       cdk(3), cdk_binding(3), cdk_display(3), cdk_position(3), cdk_screen(3)
405
406
407
408                                                                 cdk_dscale(3)
Impressum