eraseCDKEntry3
Cdk text-entry widget.
Part of cdk_entry(3).
Usage
cc [flag ...]
file ...
-lcdk
[library ...]
Overview
The Cdk entry widget creates a text-entry box with a label and an entry field. The following functions create or manipulate the Cdk entry box widget.
Available functions
activateCDKEntry-
activates the entry widget and lets the user interact with the widget.
- •
-
The parameter
entryis a pointer to a non-NULL entry widget.
- •
-
If the
actionsparameter is passed with a non-NULL value, the characters in the array will be injected into the widget.
-
To activate the widget interactively pass in a NULL pointer for
actions.
-
If the character entered into this widget is RETURN or TAB then this function will return a char * representing the information typed into the widget and the widget data exitType will be set to vNORMAL.
-
If the character entered was ESCAPE then the function will return NULL pointer and the widget data exitType is set to vESCAPE_HIT.
cleanCDKEntry-
clears the information from the field.
destroyCDKEntry-
removes the widget from the screen and frees memory the object used.
drawCDKEntry-
draws the entry widget on the screen.
-
If the
boxparameter is true, the widget is drawn with a box.
eraseCDKEntry-
removes the widget from the screen. This does NOT destroy the widget.
getCDKEntryBox-
returns true if the widget will be drawn with a box around it.
getCDKEntryFillerChar-
returns the character being used to draw unused space in the widget.
getCDKEntryHiddenChar-
returns the character being used to draw the hidden character type.
getCDKEntryMax-
returns the maximum length of a string the widget will allow.
getCDKEntryMin-
returns the minimum length of a string the widget will allow.
getCDKEntryValue-
returns the current value of the widget.
injectCDKEntry-
injects a single character into the widget.
- •
-
The parameter
entryis a pointer to a non-NULL entry widget.
- •
-
The parameter
characteris the character to inject into the widget.
-
The return value and side-effect (setting the widget data exitType) depend upon the injected character:
- RETURN or TAB
-
the function returns a char * representing the information typed into the widget. The widget data exitType is set to vNORMAL.
- ESCAPE
-
the function returns a NULL pointer. The widget data exitType is set to vESCAPE_HIT.
- Otherwise
-
unless modified by preprocessing, postprocessing or key bindings, the function returns a NULL pointer. The widget data exitType is set to vEARLY_EXIT.
moveCDKEntry-
moves the given widget to the given position.
- •
-
The parameters
xposandyposare the new position of the widget.
-
The parameter
xposmay be an integer or one of the pre-defined values TOP, BOTTOM, and CENTER.
-
The parameter
yposmay be an integer or one of the pre-defined values LEFT, RIGHT, and CENTER.
- •
-
The parameter
relativestates whether thexpos/ypospair is a relative move or an absolute move.
-
For example, if
xpos= 1 andypos= 2 andrelative= TRUE, then the widget would move one row down and two columns right. If the value ofrelativewas FALSE, then the widget would move to the position (1,2).
-
Do not use the values TOP, BOTTOM, LEFT, RIGHT, or CENTER when
relative= TRUE. (weird things may happen).
- •
-
The final parameter
refreshis a boolean value which states whether the widget will get refreshed after the move.
newCDKEntry-
creates a pointer to an entry widget. Parameters:
- •
-
The
screenparameter is the screen you wish this widget to be placed in.
- •
-
xposcontrols the placement of the object along the horizontal axis. It may be an integer or one of the pre-defined values LEFT, RIGHT, and CENTER.
- •
-
yposcontrols the placement of the object along the vertical axis. It may be an integer or one of the pre-defined values TOP, BOTTOM, and CENTER.
- •
-
titleis the string which will be displayed at the top of the widget. The title can be more than one line; just provide a carriage return character at the line break.
- •
-
labelis the string which will be displayed in the label of the entry field.
- •
-
fieldAttributeis the attribute of the characters which are typed in.
- •
-
filleris the character which is to be displayed in an empty space in the entry field.
- •
-
displayTypetells how the entry field will behave when a character is entered into the field. See cdk_display (3) for valid values for this field.
- •
-
fieldWidthdenotes the width of the field:- •
-
If a value of zero is provided, the field will be made as wide as possible on the screen.
- •
-
If a negative value is given, then the field width will be the maximum width minus the value provided.
- •
-
minimumLengthcontrols the number of characters which must be entered before the user can exit the entry field.
- •
-
maximumLengthsets the maximum number of characters that can be entered.
- •
-
boxis true if the widget should be drawn with a box around it.
- •
-
shadowturns the shadow on around this widget.
-
If the widget could not be created then a NULL pointer is returned.
positionCDKEntry-
allows the user to move the widget around the screen via the cursor/keypad keys. The following key bindings can be used to move the widget around the screen. See cdk_position (3) for key bindings.
setCDKEntry-
lets the programmer modify certain elements of an existing entry widget.
- •
-
The
valueparameter sets the value of the contents of the entry field.
- •
-
The other parameter names correspond to the same parameter names listed in the
newCDKEntryfunction.
setCDKEntryBackgroundAttrib-
sets the background attribute of the widget.
-
The parameter
attributeis a curses attribute, e.g., A_BOLD.
setCDKEntryBackgroundColor-
sets the background color of the widget.
-
The parameter
coloris in the format of the Cdk format strings. See cdk_display (3).
setCDKEntryBox-
sets whether the widget will be drawn with a box around it.
setCDKEntryBoxAttribute-
function sets the attribute of the box.
setCDKEntryCB-
allows the programmer to set a different widget input handler.
-
The parameter
callbackFunctionis of type ENTRYCB.
-
The default function is CDKEntryCallBack.
setCDKEntryFillerChar-
sets the character to use when drawing unused space in the field.
setCDKEntryHiddenChar-
sets the character to use when using a hidden character type.
setCDKEntryHighlight-
sets the attribute of the entry field.
setCDKEntryHorizontalChar-
sets the horizontal drawing character for the box to the given character.
setCDKEntryLLChar-
sets the lower left hand corner of the widget's box to the given character.
setCDKEntryLRChar-
sets the lower right hand corner of the widget's box to the given character.
setCDKEntryMax-
sets the maximum length of the string that the widget will allow.
setCDKEntryMin-
sets the minimum length of the string that the widget will allow.
setCDKEntryPostProcess-
allows the user to have the widget call a function after the key has been applied to the widget.
- •
-
The parameter
functionis the callback function.
- •
-
The parameter
datapoints to data passed to the callback function.
-
To learn more about post-processing see cdk_process(3).
setCDKEntryPreProcess-
allows the user to have the widget call a function after a key is hit and before the key is applied to the widget.
- •
-
The parameter
functionis the callback function.
- •
-
The parameter
datapoints to data passed to the callback function.
-
To learn more about pre-processing see cdk_process(3).
setCDKEntryULChar-
sets the upper left hand corner of the widget's box to the given character.
setCDKEntryURChar-
sets the upper right hand corner of the widget's box to the given character.
setCDKEntryValue-
sets the current value of the widget.
setCDKEntryVerticalChar-
sets the vertical drawing character for the box to the given character.
Key bindings
When the widget is activated there are several default key bindings which will help the user enter or manipulate the information quickly. The following table outlines the keys and their actions for this widget.
| Key | Action |
| Left Arrow | Moves the cursor to the left. |
| CTRL-B | Moves the cursor to the left. |
| Right Arrow | Moves the cursor to the right. |
| CTRL-F | Moves the cursor to the right. |
| Delete | Deletes the character at the cursor. |
| Backspace | Deletes the character before cursor, moves cursor left. |
| CTRL-V | Pastes whatever is in the paste buffer, into the widget. |
| CTRL-X | Cuts the contents from the widget and saves a copy in the paste buffer. |
| CTRL-Y | Copies the contents of the widget into the paste buffer. |
| CTRL-U | Erases the contents of the widget. |
| CTRL-A | Moves the cursor to the beginning of the entry field. |
| CTRL-E | Moves the cursor to the end of the entry field. |
| CTRL-T | Transposes the character under the cursor with the character to the right. |
| Return | Exits the widget and returns a char * representing the information which was typed into the field. It also sets the widget data exitType to vNORMAL. |
| Tab | Exits the widget and returns a char * representing the information which was typed into the field. It also sets the widget data exitType to vNORMAL. |
| Escape | Exits the widget and returns a NULL pointer. It also sets the widget data exitType to vESCAPE_HIT. |
| Ctrl-L | Refreshes the screen. |
History
- Debian 13 (Trixie): the text shown here
- Debian 12 (Bookworm) to Debian 9 (Stretch)
- Debian 8 (Jessie) to Debian 7 (Wheezy)
- Debian 6.0 (Squeeze) to Debian 5.0 (Lenny)
- Debian 4.0 (Etch)
- Debian 3.1 (Sarge)
- Debian 3.0 (Woody)