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

NAME

6       cdk_buttonbox - Creates a managed curses buttonbox widget.
7

SYNOPSIS

9       cc [ flag ... ] file ...  -lcdk [ library ... ]
10
11       #include <cdk.h>
12
13       int activateCDKButtonbox (
14                      CDKBUTTONBOX *buttonbox,
15                      chtype * actions);
16
17       void destroyCDKButtonbox (
18                      CDKBUTTONBOX *buttonbox);
19
20       void drawCDKButtonbox (
21                      CDKBUTTONBOX *buttonbox,
22                      boolean box);
23
24       void drawCDKButtonboxButtons (
25                      CDKBUTTONBOX *buttonbox);
26
27       void eraseCDKButtonbox (
28                      CDKBUTTONBOX *buttonbox);
29
30       boolean getCDKButtonboxBox (
31                      CDKBUTTONBOX *buttonbox);
32
33       int getCDKButtonboxButtonCount (
34                      CDKBUTTONBOX *buttonbox);
35
36       int getCDKButtonboxCurrentButton (
37                      CDKBUTTONBOX *buttonbox);
38
39       chtype getCDKButtonboxHighlight (
40                      CDKBUTTONBOX *buttonbox);
41
42       int injectCDKButtonbox (
43                      CDKBUTTONBOX *buttonbox,
44                      chtype input);
45
46       void moveCDKButtonbox (
47                      CDKBUTTONBOX *buttonbox,
48                      int xpos,
49                      int ypos,
50                      boolean relative,
51                      boolean refresh);
52
53       CDKBUTTONBOX *newCDKButtonbox (
54                      CDKSCREEN *cdkscreen,
55                      int xpos,
56                      int ypos,
57                      int height,
58                      int width,
59                      char * title,
60                      int rows,
61                      int cols,
62                      char ** buttons,
63                      int buttonCount,
64                      chtype highlight,
65                      boolean box,
66                      boolean shadow);
67
68       void positionCDKButtonbox (
69                      CDKBUTTONBOX *buttonbox);
70
71       void setCDKButtonbox (
72                      CDKBUTTONBOX *buttonbox,
73                      chtype highlight,
74                      boolean box);
75
76       void setCDKButtonboxBackgroundAttrib (
77                      CDKBUTTONBOX *buttonbox,
78                      chtype attribute);
79
80       void setCDKButtonboxBackgroundColor (
81                      CDKBUTTONBOX *buttonbox,
82                      char * color);
83
84       void setCDKButtonboxBox (
85                      CDKBUTTONBOX *buttonbox,
86                      boolean box);
87
88       void setCDKButtonboxBoxAttribute (
89                      CDKBUTTONBOX *buttonbox,
90                      chtype character);
91
92       void setCDKButtonboxCurrentButton (
93                      CDKBUTTONBOX *buttonbox,
94                      int button);
95
96       void setCDKButtonboxHighlight (
97                      CDKBUTTONBOX *buttonbox,
98                      chtype highlight);
99
100       void setCDKButtonboxHorizontalChar (
101                      CDKBUTTONBOX *buttonbox,
102                      chtype character);
103
104       void setCDKButtonboxLLChar (
105                      CDKBUTTONBOX *buttonbox,
106                      chtype character);
107
108       void setCDKButtonboxLRChar (
109                      CDKBUTTONBOX *buttonbox,
110                      chtype character);
111
112       void setCDKButtonboxPostProcess (
113                      CDKBUTTONBOX *buttonbox,
114                      PROCESSFN callback,
115                      void * data);
116
117       void setCDKButtonboxPreProcess (
118                      CDKBUTTONBOX *buttonbox,
119                      PROCESSFN callback,
120                      void * data);
121
122       void setCDKButtonboxULChar (
123                      CDKBUTTONBOX *buttonbox,
124                      chtype character);
125
126       void setCDKButtonboxURChar (
127                      CDKBUTTONBOX *buttonbox,
128                      chtype character);
129
130       void setCDKButtonboxVerticalChar (
131                      CDKBUTTONBOX *buttonbox,
132                      chtype character);
133

DESCRIPTION

135       The  Cdk  buttonbox widget creates a buttonbox box with a message and a
136       varied number of buttons to choose from.  The following functions  cre‐
137       ate or manipulate the Cdk buttonbox box widget.
138

AVAILABLE FUNCTIONS

140       activateCDKButtonbox
141            activates the buttonbox widget and lets the user interact with the
142            widget.  The parameter buttonbox is a pointer to a  non-NULL  but‐
143            tonbox widget.  If the actions parameter is passed with a non-NULL
144            value, the characters in the array will be injected into the  wid‐
145            get.   To activate the widget interactively pass in a NULL pointer
146            for actions.  If the character entered into this widget is  RETURN
147            or TAB then this function will return a value from 0 to the number
148            of buttons -1, representing the button selected.  It will also set
149            the  widget  data  exitType  to vNORMAL.  If the character entered
150            into this widget was ESCAPE then the widget will return a value of
151            -1 and the widget data exitType will be set to vESCAPE_HIT.
152
153       destroyCDKButtonbox
154            removes  the  widget  from  the screen and releases any memory the
155            object used.
156
157       drawCDKButtonbox
158            draws the buttonbox widget on the screen.  If the box parameter is
159            true, the widget is drawn with a box.
160
161       drawCDKButtonboxButtons
162            draws the buttons.
163
164       eraseCDKButtonbox
165            removes  the  widget  from  the screen.  This does NOT destroy the
166            widget.
167
168       getCDKButtonboxBox
169            returns true if the widget will be drawn with a box around it.
170
171       getCDKButtonboxButtonCount
172            returns the number of buttons in the button box.
173
174       getCDKButtonboxCurrentButton
175            returns the current button-number.
176
177       getCDKButtonboxHighlight
178            returns the highlight attribute of the widget.
179
180       injectCDKButtonbox
181            injects a single character into the widget.  The parameter button‐
182            box  is  a  pointer to a non-NULL buttonbox widget.  The parameter
183            character is the character to inject into the widget.  The  return
184            value  and  side-effect  (setting the widget data exitType) depend
185            upon the injected character:
186
187            RETURN or TAB
188                   the function returns a value ranging from zero to one  less
189                   than   the  number  of  buttons,  representing  the  button
190                   selected.  The widget data exitType is set to vNORMAL.
191
192            ESCAPE the function returns -1.   vESCAPE_HIT.   The  widget  data
193                   exitType is set to vESCAPE_HIT.
194
195            Otherwise
196                   unless  modified  by  preprocessing,  postprocessing or key
197                   bindings, the function returns -1.  The widget  data  exit‐
198                   Type is set to vEARLY_EXIT.
199
200       moveCDKButtonbox
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       newCDKButtonbox
216            creates a pointer to a buttonbox widget.  Parameters:
217
218            screen
219                 is the screen you wish this widget to be placed in.
220
221            xpos controls  the  placement  of  the object along the horizontal
222                 axis.  It may be an integer or one of the pre-defined  values
223                 LEFT, RIGHT, and CENTER.
224
225            ypos controls the placement of the object along the vertical axis.
226                 It be an integer value or one of the pre-defined values  TOP,
227                 BOTTOM, and CENTER.
228
229            height and
230
231            width
232                 control the height and width of the widget.
233
234            title
235                 is the title of the widget.
236
237            rows is the number of rows of buttons.
238
239            cols sets the number of columns.
240
241            buttons
242                 is an array containing the button labels.
243
244            buttonCount
245                 is the number of elements in the buttons array.
246
247            highlight
248                 is the attribute of the currently highlighted button.
249
250            box  is true if the widget should be drawn with a box around it.
251
252            shadow
253                 turns the shadow on or off around this widget.
254
255            If  the  widget  could  not  be  created  then  a  NULL pointer is
256            returned.
257
258       positionCDKButtonbox
259            allows the user to move the widget around the screen via the  cur‐
260            sor/keypad keys.  See cdk_position (3) for key bindings.
261
262       setCDKButtonbox
263            lets the programmer modify certain elements of an existing button‐
264            box widget.  The parameter names correspond to the same  parameter
265            names listed in the newCDKButtonbox function.
266
267       setCDKButtonboxBackgroundAttrib
268            sets  the  background  attribute  of  the  widget.   The parameter
269            attribute is a curses attribute, e.g., A_BOLD.
270
271       setCDKButtonboxBackgroundColor
272            sets the background color of the widget.  The parameter  color  is
273            in the format of the Cdk format strings.  (See cdk_display).
274
275       setCDKButtonboxBox
276            sets true if the widget will be drawn with a box around it.
277
278       setCDKButtonboxBoxAttribute
279            sets the attribute of the box.
280
281       setCDKButtonboxCurrentButton
282            sets the current button-number for the box.
283
284       setCDKButtonboxHighlight
285            sets the highlight attribute of the selected button.
286
287       setCDKButtonboxHorizontalChar
288            sets  the  horizontal  drawing  character for the box to the given
289            character.
290
291       setCDKButtonboxLLChar
292            sets the lower left hand corner of the widget's box to  the  given
293            character.
294
295       setCDKButtonboxLRChar
296            sets  the lower right hand corner of the widget's box to the given
297            character.
298
299       setCDKButtonboxPostProcess
300            allows the user to have the widget call a function after  the  key
301            has  been  applied  to  the widget.  The parameter function is the
302            callback function.  (See cdk_process).
303
304       setCDKButtonboxPreProcess
305            allows the user to have the widget call a function after a key  is
306            hit  and  before  the key is applied to the widget.  The parameter
307            function is the callback function.  (See cdk_process).
308
309       setCDKButtonboxULChar
310            sets the upper left hand corner of the widget's box to  the  given
311            character.
312
313       setCDKButtonboxURChar
314            sets  the upper right hand corner of the widget's box to the given
315            character.
316
317       setCDKButtonboxVerticalChar
318            sets the vertical drawing character for the box to the given char‐
319            acter.
320

KEY BINDINGS

322       When  the  widget  is  activated there are several default key bindings
323       which will help the user enter or manipulate the  information  quickly.
324       The  following  table outlines the keys and their actions for this wid‐
325       get.
326
327             ┌────────────────────┬─────────────────────────────────────┐
328Key          Action │                                     │
329             ├────────────────────┼─────────────────────────────────────┤
330             ├────────────────────┼─────────────────────────────────────┤
331             │Left Arrow          │ Selects the button to the  left  of │
332             │                    │ the current button.                 │
333             ├────────────────────┼─────────────────────────────────────┤
334             │Right Arrow         │ Selects  the button to the right of │
335             │                    │ the current button.                 │
336             ├────────────────────┼─────────────────────────────────────┤
337             │Tab                 │ Selects the button to the right  of │
338             │                    │ the current button.                 │
339             ├────────────────────┼─────────────────────────────────────┤
340             │Space               │ Selects  the button to the right of │
341             │                    │ the current button.                 │
342             ├────────────────────┼─────────────────────────────────────┤
343             │Return              │ Exits the widget  and  returns  the │
344             │                    │ index of the selected button.  This │
345             │                    │ also sets the widget data  exitType
346             │                    │ to vNORMAL.                         │
347             ├────────────────────┼─────────────────────────────────────┤
348             │Tab                 │ Exits  the  widget  and returns the │
349             │                    │ index of the selected button.  This │
350             │                    │ also  sets the widget data exitType
351             │                    │ to vNORMAL.                         │
352             ├────────────────────┼─────────────────────────────────────┤
353             │Escape              │ Exits the widget  and  returns  -1. │
354             │                    │ This  also  sets  the  widget  data │
355             │                    │ exitType to vESCAPE_HIT.            │
356             ├────────────────────┼─────────────────────────────────────┤
357             │Ctrl-L              │ Refreshes the screen.               │
358             └────────────────────┴─────────────────────────────────────┘

SEE ALSO

360       cdk(3),      cdk_binding(3),      cdk_display(3),      cdk_position(3),
361       cdk_process(3), cdk_screen(3)
362
363
364
365                                                              cdk_buttonbox(3)
Impressum