_______________________________________________________
STRING Widget
Allows the user to enter a string of text
_______________________________________________________
Legal Usage Level-0 Widget: Yes
Parent to: None
Child of: PANEL
Example Image
Example Program
See STRING Widget for a program that creates a STRING widget with a display similar to that shown above.See the following programs for other examples using the STRING widget.
Attributes
Remarks
The STRING widget allows the user to enter a string of text. The STRING widget can be used as a rudimentary editor, providing file read/write functionsin addition to cut, copy, delete and paste.
The CUT SELECTION, COPY SELECTION, DELETE SELECTION, and PASTE attributes are not meant to be interactive from the mouse. You must add a button or other interactive widget to create a fully interactive editor.
The STRING widget allows the user interface to accept strings of text from the user. The MULTILINE attribute allows the STRING widget to accept multiline inputs.
Cut, copy, and delete work on the current selection:
·
|
To make a selection, click and drag the mouse on the desired area to highlight it.
|
·
|
To highlight a selection that takes more than one screen To display, click on an area and drag the mouse offscreen, either above or below the window, and the highlighted area will scroll until you release the mouse button or move the cursor back on the screen.
|
Cut, Copy, and Paste work with a global "clipboard" buffer area shared by all
widgets and applications:
·
|
Text cut or copied from a STRING replaces the buffer contents.
|
·
|
Paste copies the buffer contents to the widget or application at the current cursor position. In this way, text can be cut or copied from one STRING to another.
|
·
|
Clicking the mouse over text positions the cursor at the text.
|
STRING responds to the special keyboard keys as follows:
Key
|
Action
|
End
|
Clears from cursor to end of line
|
Shift-End
|
Clears entire line
|
Shift-Insert
|
Inserts a line, if MULTILINE:1
|
Shift-Delete
|
Deletes entire line
|
Insert
|
Toggles between insert (bar cursor) and overwrite (underline cursor)
|
Delete
|
Deletes current selection if highlighted. Otherwise, deletes character at current cursor position.
|
Home
|
Deletes from current character to last character in last line
|
Left Arrow,
Right Arrow,
Up Arrow,
Down Arrow
|
Moves cursor and scrolls if necessary
|
Shift-Left
|
Moves and scrolls (if necessary) to the first character in the line
|
Shift-Right
|
Moves and scrolls (if necessary) to the last character in the line
|
Shift-Up
|
Moves and scrolls (if necessary) to the first character in the first line
|
Shift-Down
|
Moves and scrolls (if necessary) to the last character in the last line
|
Page Up/
Page Down
|
Scrolls one screen, if MULTILINE:1
|
Events
Events for the STRING widget are:
DONE
This event is generated when the widget loses the focus.
KEYSTROKE
When the focus is in the STRING widget, this event is generatedas you depress a key that changes the contents of STRING.
RETURN
This event is generated when the operator presses the Return key.
SYSTEM MENU
This event is generated when the operator selects items from the SYSTEM MENU.