7
.TH cdk_entry 3X "24 April 1997"
9
newCDKEntry, activateCDKEntry, injectCDKEntry, setCDKEntry,
10
setCDKEntryValue, getCDKEntryValue,
11
setCDKEntryMax, getCDKEntryMax,
12
setCDKEntryMin, getCDKEntryMin,
13
setCDKEntryFillerChar, getCDKEntryFillerChar,
14
setCDKEntryHiddenChar, getCDKEntryHiddenChar,
15
setCDKEntryBox, getCDKEntryBox,
16
setCDKEntryULChar, setCDKEntryURChar,
17
setCDKEntryLLChar, setCDKEntryLRChar,
18
setCDKEntryVerticalChar, setCDKEntryHorizontalChar,
19
setCDKEntryBoxAttribute,
20
setCDKEntryBackgroundColor,
21
setCDKEntryCB, drawCDKEntry, eraseCDKEntry, cleanCDKEntry, destroyCDKEntry,
22
setCDKEntryPreProcess, setCDKEntryPostProcess \- Creates a managed curses
27
.RI "[ " "flag" " \|.\|.\|. ] " "file" " \|.\|.\|."
29
.RI "[ " "library" " \|.\|.\|. ]"
33
.BI "CDKENTRY *newCDKEntry (CDKSCREEN *" "cdkscreen",
38
.BI "chtype " "fieldAttribute",
39
.BI "chtype " "fillerCharacter",
40
.BI "EDisplayType " "displayType",
41
.BI "int " "fieldWidth",
42
.BI "int " "minimumLength",
43
.BI "int " "maximumLength",
45
.BI "boolean " "shadow");
47
.BI "char *activateCDKEntry (CDKENTRY *" "entry",
48
.BI "chtype *" "actions");
50
.BI "int injectCDKEntry (CDKENTRY *" "entry",
51
.BI "chtype " "input");
53
.BI "void setCDKEntry (CDKENTRY *" "entry",
55
.BI "int " "minimumLength",
56
.BI "int " "maximumLength",
57
.BI "boolean " "box");
59
.BI "void setCDKEntryValue (CDKENTRY *" "entry",
60
.BI "char *" "value");
62
.BI "char *getCDKEntryValue (CDKENTRY *" "entry");
64
.BI "void setCDKEntryMax (CDKENTRY *" "entry",
65
.BI "int " "maximum");
67
.BI "int getCDKEntryMax (CDKENTRY *" "entry");
69
.BI "void setCDKEntryMin (CDKENTRY *" "entry",
70
.BI "int " "minimum");
72
.BI "int getCDKEntryMin (CDKENTRY *" "entry");
74
.BI "void setCDKEntryBox (CDKENTRY *" "entry",
75
.BI "boolean " "box");
77
.BI "void setCDKEntryFillerChar (CDKENTRY *" "entry",
78
.BI "chtype " "character");
80
.BI "chtype getCDKEntryFillerChar *CDKENTRY *" "entry");
82
.BI "void setCDKEntryHiddenChar (CDKENTRY *" "entry",
83
.BI "chtype " "character");
85
.BI "chtype getCDKEntryHiddenChar *CDKENTRY *" "entry");
87
.BI "boolean getCDKEntryBox (CDKENTRY *" "entry");
89
.BI "void setCDKEntryBox (CDKENTRY *" "entry",
90
.BI "boolean " "box");
92
.BI "boolean getCDKEntryBox (CDKENTRY *" "entry");
94
.BI "void setCDKEntryULChar (CDKENTRY *", "entry",
95
.BI "chtype " "character");
97
.BI "void setCDKEntryURChar (CDKENTRY *", "entry",
98
.BI "chtype " "character");
100
.BI "void setCDKEntryLLChar (CDKENTRY *", "entry",
101
.BI "chtype " "character");
103
.BI "void setCDKEntryLRChar (CDKENTRY *", "entry",
104
.BI "chtype " "character");
106
.BI "void setCDKEntryVerticalChar (CDKENTRY *", "entry",
107
.BI "chtype " "character");
109
.BI "void setCDKEntryHorizontalChar (CDKENTRY *", "entry",
110
.BI "chtype " "character");
112
.BI "void setCDKEntryBoxAttribute (CDKENTRY *", "entry",
113
.BI "chtype " "character");
115
.BI "void setCDKEntryBackgroundColor (CDKENTRY *", "entry",
116
.BI "char * " "color");
118
.BI "void setCDKEntryCB (CDKENTRY *" "entry",
119
.BI "ENTRYCB " "callBackFunction");
121
.BI "void moveCDKEntry (CDKENTRY *" "entry",
124
.BI "boolean " "relative",
125
.BI "boolean " "refresh");
127
.BI "void positionCDKEntry (CDKENTRY *" "entry");
129
.BI "void drawCDKEntry (CDKENTRY *" "entry",
130
.BI "boolean " "box");
132
.BI "void eraseCDKEntry (CDKENTRY *" "entry");
134
.BI "void cleanCDKEntry (CDKENTRY *" "entry");
136
.BI "void destroyCDKEntry (CDKENTRY *" "entry");
138
.BI "void setCDKEntryPreProcess (CDKENTRY *" "entry",
139
.BI "PROCESSFN " "callback",
140
.BI "void * " "data");
142
.BI "void setCDKEntryPostProcess (CDKENTRY *" "entry",
143
.BI "PROCESSFN " "callback",
144
.BI "void * " "data");
146
.BI "void bindCDKObject (EObjectType " "widgetType",
147
.BI "void *" "object",
149
.BI "BINDFN" "function",
150
.BI "void *" "data");
152
The Cdk entry widget creates an entry box with a label and an entry field. The
153
following are functions which create or manipulate the Cdk entry box widget.
155
.SH AVAILABLE FUNCTIONS
156
CDKENTRY *newCDKEntry (CDKSCREEN *\f2screen\f1, int \f2xpos\f1, int \f2ypos\f1, char *\f2title\f1, char *\f2label\f1, chtype \f2fieldAttribute\f1, chtype \f2fillerCharacter\f1, EDisplayType \f2displayType\f1, int \f2fieldWidth\f1, int \f2minimumLength\f1, int \f2maximumLength\f1, boolean \f2box\f1, boolean \f2shadow\f1);
158
This function creates a pointer to an entry widget. The \f2screen\f1 parameter
159
is the screen you wish this widget to be placed in. The parameter \f2xpos\f1
160
controls the placement of the object along the horizontal axis. This parameter
161
can accept an integer value or one of the pre-defined values of \f4LEFT\f1,
162
\f4RIGHT\f1, and \f4CENTER\f1. The parameter \f2ypos\f1 controls the placement
163
of the object along the vertical axis. This parameter can accept an integer
164
value or one of the pre-defined values of \f4TOP\f1, \f4BOTTOM\f1, and \f4CENTER\f1.
165
The \f2title\f1 parameter is the string which will be displayed at the top of
166
the widget. The title can be more than one line; just provide a carriage
167
return character at the line break. The \f2label\f1 parameter is the string which
168
will be displayed in the label of the entry field. The \f2fieldAttribute\f1 is
169
the attribute of the characters to be displayed when they are typed in.
170
\f2filler\f1 is the character which is to be displayed in an empty space in
171
the entry field. The parameter \f2displayType\f1 tells how the entry field
172
will behave when a character is entered into the field. The following table
173
outlines valid values for this field and what they mean:
177
\f2Display_Type Meaning\f1
178
vCHAR Only accepts alphabetic characters.
179
vLCHAR Only accepts alphabetic characters.
180
Maps the character to lower case
181
when a character has been accepted.
182
vUCHAR Only accepts alphabetic characters.
183
Maps the character to upper case
184
when a character has been accepted.
185
vHCHAR Only accepts alphabetic characters.
186
Displays a \f4.\f1 when a character
188
vUHCHAR Only accepts alphabetic characters.
189
Displays a \f4.\f1 and maps the
190
character to upper case when a
191
character has been accepted.
192
vLHCHAR Only accepts alphabetic characters.
193
Displays a \f4.\f1 and maps the
194
character to lower case when a
195
character has been accepted.
196
vINT Only accepts numeric characters.
197
vHINT Only accepts numeric characters.
198
Displays a \f4.\f1 when a character
200
vMIXED Accepts any character types.
201
vLMIXED Accepts any character types.
202
Maps the character to lower case
203
when an alphabetic character has
205
vUMIXED Accepts any character types.
206
Maps the character to upper case
207
when an alphabetic character has
209
vHMIXED Accepts any character types.
210
Displays a \f4.\f1 when a character
212
vLHMIXED Accepts any character types.
213
Displays a \f4.\f1 and maps the
214
character to lower case when a
215
character has been accepted.
216
vUHMIXED Accepts any character types.
217
Displays a \f4.\f1 and maps the
218
character to upper case when a
219
character has been accepted.
220
vVIEWONLY Uneditable field.
225
The \f2fieldWidth\f1 parameter states how wide the field will be. If a value
226
of zero is provided, the field will be made as wide as possible on the
227
screen. If a negative value is given, then the field width will be the
228
maximum width minus the value provided. The parameter \f2minimumLength\f1
229
states how many characters have to be entered before the user can exit the
230
entry field. The \f2maximumLength\f1 parameter sets the maximum number of
231
characters that can be entered. The \f2box\f1 parameter states whether the
232
widget will be drawn with a box around it or not. The \f2shadow\f1 parameter
233
accepts a boolean value to turn the shadow on or off around this widget. If
234
the widget could not be created then a \f4NULL\f1 pointer is returned.
237
char *activateCDKEntry (CDKENTRY *\f2entry\f1, chtype *\f2actions\f1);
239
This function activates the entry widget and lets the user interact with the
240
widget. The parameter \f2entry\f1 is a pointer to a non-NULL entry widget.
241
If the \f2actions\f1 parameter is passed with a non-NULL value, the characters
242
in the array will be injected into the widget. To activate the widget
243
interactively pass in a \f4NULL\f1 pointer for \f2actions\f1. If the character entered
244
into this widget is \f4RETURN\f1 or \f4TAB\f1 then this function will return
245
a \f4char *\f1 representing the information typed into the widget and the
246
structure member \f4exitType\f1 will be set to \f4vNORMAL\f1. If the character
247
entered was \f4ESCAPE\f1 then the function will returns \f4NULL\f1 pointer and
248
the structure member \f4exitType\f1 is set to \f4vESCAPE_HIT\f1.
251
char *injectCDKEntry (CDKENTRY *\f2entry\f1, chtype \f2character\f1);
253
This function injects a single character into the widget. The parameter
254
\f2entry\f1 is a pointer to a non-NULL entry. The parameter
255
\f2character\f1 is the character to inject into the widget. If the character
256
injected into this widget was \f4RETURN\f1 or \f4TAB\f1 then this function will
257
return a \f4char *\f1 representing the information typed into the widget and the
258
structure member \f4exitType\f1 will be set to \f4vNORMAL\f1. If the character
259
entered was \f4ESCAPE\f1 then the function will returns \f4NULL\f1 pointer and
260
the structure member \f4exitType\f1 is set to \f4vESCAPE_HIT\f1. Any other
261
character injected into the widget will set the structure member \f4exitType\f1
262
to \f4vEARLY_EXIT\f1 and the function will return a \f4NULL\f1 pointer.
265
void setCDKEntry (CDKENTRY *\f2entry\f1, char *\f2value\f1, int \f2minimumLength\f1, int \f2maximumLength\f1, boolean \f2box\f1);
267
This function lets the programmer modify certain elements of an already defined
268
entry widget. The \f2value\f1 parameter sets the value of the contents of the
269
entry field. The other parameter names correspond to the same parameter names
270
listed in the \f4newCDKEntry\f1 function.
273
void setCDKEntryValue (CDKENTRY *\f2entry\f1, char *\f2value\f1);
275
This sets the current value of the widget.
278
char *getCDKEntryValue (CDKENTRY *\f2entry\f1);
280
This returns the current value of the widget.
283
void setCDKEntryMax (CDKENTRY *\f2entry\f1, int \f2maximum\f1);
285
This sets the maximum length of the string that the widget will allow.
288
int getCDKEntryMax (CDKENTRY *\f2entry\f1);
290
This returns the maximum length of a string the widget will allow.
293
void setCDKEntryMin (CDKENTRY *\f2entry\f1, int \f2maximum\f1);
295
This sets the minimum length of the string that the widget will allow.
298
int getCDKEntryMin (CDKENTRY *\f2entry\f1);
300
This returns the minimum length of a string the widget will allow.
303
void setCDKEntryFillerChar (CDKENTRY *\f2entry\f1, chtype \f2filler\f1);
305
This sets the character to use when drawing unused space in the field.
308
chtype getCDKEntryFillerChar (CDKENTRY *\f2entry\f1);
310
This returns the character being used to draw unused space in the widget.
313
void setCDKEntryHiddenChar (CDKENTRY *\f2entry\f1, chtype \f2character\f1);
315
This sets the character to use when using a hidden character type.
318
chtype getCDKEntryHiddenChar (CDKENTRY *\f2entry\f1);
320
This returns the character being used to draw the hidden character type.
323
void setCDKEntryBox (CDKENTRY *\f2entry\f1, boolean \f2boxWidget\f1);
325
This sets whether or not the widget will be draw with a box around it.
328
boolean getCDKEntryBox (CDKENTRY *\f2entry\f1);
330
This returns whether or not the widget will be drawn with a box around it.
333
void setCDKEntryULChar (CDKENTRY *\f2entry\f1, chtype \f2character\f1);
335
This function sets the upper left hand corner of the widgets box to
339
void setCDKEntryURChar (CDKENTRY *\f2entry\f1, chtype \f2character\f1);
341
This function sets the upper right hand corner of the widgets box to
345
void setCDKEntryLLChar (CDKENTRY *\f2entry\f1, chtype \f2character\f1);
347
This function sets the lower left hand corner of the widgets box to
351
void setCDKEntryLRChar (CDKENTRY *\f2entry\f1, chtype \f2character\f1);
353
This function sets the lower right hand corner of the widgets box to
357
void setCDKEntryVerticalChar (CDKENTRY *\f2entry\f1, chtype \f2character\f1);
359
This function sets the vertical drawing character for the box to
363
void setCDKEntryHorizontalChar (CDKENTRY *\f2entry\f1, chtype \f2character\f1);
365
This function sets the horizontal drawing character for the box to
369
void setCDKEntryBoxAttribute (CDKENTRY *\f2entry\f1, chtype \f2attribute\f1);
371
This function sets the attribute of the box.
374
void setCDKEntryBackgroundColor (CDKENTRY *\f2entry\f1, char *\f2color\f1);
376
This sets the background color of the widget. The parameter \f2color\f1
377
is in the format of the Cdk format strings. To get more information look
378
at the \f4cdk_display\f1 manual page.
381
void setCDKEntryCB (CDKENTRY *\f2entry\f1, ENTRYCB \f2callbackFunction\f1);
383
This function allows the programmer to set a different widget input handler.
384
The parameter \f2callbackFunction\f1 is of type \f4ENTRYCB\f1. The current
385
default function is \f4CDKEntryCallBack\f1.
388
void moveCDKEntry (CDKENTRY *\f2entry\f1, int \f2xpos\f1, int \f2ypos\f1, boolean \f2relative\f1, boolean \f2refresh\f1);
390
This function moves the given widget to the given position. The parameters
391
\f2xpos\f1 and \f2ypos\f1 is the new position of the widget. The parameter
392
\f2xpos\f1 can accept an integer value or one of the pre-defined values of
393
\f4TOP\f1, \f4BOTTOM\f1, and \f4CENTER\f1. The parameter \f2ypos\f1 can
394
accept an integer value or one of the pre-defined values of \f4LEFT\f1,
395
\f4RIGHT\f1, and \f4CENTER\f1. The parameter \f2relative\f1 states whether
396
the \f2xpos\f1/\f2ypos\f1 pair is a relative move or an absolute move. For
397
example if \f2xpos\f1 = 1 and \f2ypos\f1 = 2 and \f2relative\f1 = \f2TRUE\f1,
398
then the widget would move one row down and two columns right. If the value
399
of \f2relative\f1 was \f2FALSE\f1 then the widget would move to the position
400
(1,2). Do not use the values of \f4TOP\f1, \f4BOTTOM\f1, \f4LEFT\f1,
401
\f4RIGHT\f1, or \f4CENTER\f1 when \f2relative\f1 = \f4TRUE\f1. (wierd things
402
may happen). The final parameter \f2refresh\f1 is a boolean value which states
403
whether the widget will get refreshed after the move or not.
406
void positionCDKEntry (CDKENTRY *\f2entry\f1);
408
This function allows the user to move the widget around the screen via the
409
cursor/keypad keys. The following key bindings can be used to move the
410
widget around the screen.
416
Up Arrow Moves the widget up one line.
417
Down Arrow Moves the widget down one line.
418
Left Arrow Moves the widget left one column
419
Right Arrow Moves the widget right one column
420
Keypad-1 Moves the widget down one line
422
Keypad-2 Moves the widget down one line.
423
Keypad-3 Moves the widget down one line
424
and right one column.
425
Keypad-4 Moves the widget left one column
426
Keypad-5 Centers the widget both vertically
428
Keypad-6 Moves the widget right one column
429
Keypad-7 Moves the widget up one line
431
Keypad-8 Moves the widget up one line.
432
Keypad-9 Moves the widget up one line
433
and right one column.
434
t Moves the widget to the top of the screen.
435
b Moves the widget to the bottom of the screen.
436
l Moves the widget to the left of the screen.
437
r Moves the widget to the right of the screen.
438
c Centers the widget between the left and
440
C Centers the widget between the top and
441
bottom of the window.
442
Escape Returns the widget to it's original position.
443
Return Exits the function and leaves the widget
449
Keypad means that if the keyboard you are using has a keypad, then the
450
Num-Lock light has to be on in order to use the keys as listed. (The
451
numeric keys at the top of the keyboard will work as well.)
453
void drawCDKEntry (CDKENTRY *\f2entry\f1, boolean \f2box\f1);
455
This function draws the entry widget on the screen. The \f2box\f1 option
456
draws the widget with or without a box.
459
void eraseCDKEntry (CDKENTRY *\f2entry\f1);
461
This function removes the widget from the screen. This does \f4NOT\f1 destroy
465
void cleanCDKEntry (CDKENTRY *\f2entry\f1);
467
This function clears the information from the field.
470
void destroyCDKEntry (CDKENTRY *\f2entry\f1);
472
This function removes the widget from the screen and frees up any memory the
476
void setCDKEntryPreProcess (CDKENTRY *\f2entry\f1, PROCESSFN \f2function\f1, void *\f2data\f1);
478
This function allows the user to have the widget call a function after a key
479
is hit and before the key is applied to the widget. The parameter \f2function\f1
480
if of type \f4PROCESSFN\f1. The parameter \f2data\f1 is a pointer to
481
\f4void\f1. To learn more about pre-processing read the \f4cdk_process\f1
485
void setCDKEntryPostProcess (CDKENTRY *\f2entry\f1, PROCESSFN \f2function\f1, void *\f2data\f1);
487
This function allows the user to have the widget call a function after the
488
key has been applied to the widget. The parameter \f2function\f1 if of type
489
\f4PROCESSFN\f1. The parameter \f2data\f1 is a pointer to \f4void\f1. To
490
learn more about post-processing read the \f4cdk_process\f1 manual page.
493
void bindCDKObject (EObjectType \f2widgetType\f1, void *\f2object\f1, chtype \f2key\f1, BINDFN \f2function\f1, void *\f2data\f1);
495
This function allows the user to create special key bindings. The
496
\f2widgetType\f1 parameter is a defined type which states what Cdk object type
497
is being used. To learn more about the type \f4EObjectType\f1 read the
498
\f4cdk_binding\f1 manual page. The \f2object\f1 parameter is the pointer to the
499
widget object. The \f2key\f1 is the character to bind. The \f2function\f1 is
500
the function type. To learn more about the key binding callback function types
501
read the \f4cdk_binding\f1 manual page. The last parameter \f2data\f1 is a
502
pointer to any data that needs to get passed to the callback function.
506
When the widget is activated there are several default key bindings which will
507
help the user enter or manipulate the information quickly. The following table
508
outlines the keys and their actions for this widget.
513
Left Arrow Moves the cursor the the left.
514
CTRL-B Moves the cursor the the left.
515
Right Arrow Moves the cursor the the right.
516
CTRL-F Moves the cursor the the right.
517
Delete Deletes the character to the left of the cursor.
518
Backspace Deletes the character to the left of the cursor.
519
CTRL-H Deletes the character to the left of the cursor.
520
CTRL-V Pastes whatever is in the paste buffer, into the widget.
521
CTRL-X Cuts the contents from the widget and saves a copy in
523
CTRL-Y Copies the contents of the widget into the paste buffer.
524
CTRL-U Erases the contents of the widget.
525
CTRL-A Moves the cursor to the begining of the entry field.
526
CTRL-E Moves the cursor to the end of the entry field.
527
CTRL-T Transposes the characer under the cursor with the
528
character to the right.
529
Return Exits the widget and returns a \f4char *\f1 representing
530
the information which was typed into the field. It also
531
sets the structure member \f4exitType\f1 in the widget
532
pointer to \f4vNORMAL\f1.
533
Tab Exits the widget and returns a \f4char *\f1 representing
534
the information which was typed into the field. It also
535
sets the structure member \f4exitType\f1 in the widget
536
pointer to \f4vNORMAL\f1.
537
Escape Exits the widget and returns a \f4NULL\f1 pointer. It also
538
sets the structure member \f4exitType\f1 in the widget pointer
539
to the value of \f4vESCAPE_HIT\f1.
540
Ctrl-L Refreshes the screen.
545
.BR cdk_binding (3X),
546
.BR cdk_display (3X),
547
.BR cdk_process (3X),
551
The header file \f4<cdk.h>\f1 automatically includes the header files
552
\f4<curses.h>\f1, \f4<stdlib.h>\f1, \f4<string.h>\f1, \f4<ctype.h>\f1,
553
\f4<unistd.h>\f1, \f4<dirent.h>\f1, \f4<time.h>\f1, \f4<errno.h>\f1,
554
\f4<pwd.h>\f1, \f4<grp.h>\f1, \f4<sys/stat.h>\f1, and \f4<sys/types.h>\f1.
555
The \f4<curses.h>\f1 header file includes \f4<stdio.h>\f1 and \f4<unctrl.h>\f1.
557
If you have \f4Ncurses\f1 installed on your machine add -DNCURSES to the
558
compile line to include the Ncurses header files instead.