Prima::InputLine - standard input line widget
use Prima qw(InputLine Application); Prima::InputLine-> new( text => 'Hello world!'); run Prima;
The class provides basic functionality of an input line, including hidden input, read-only state, selection, and clipboard operations. The input line text data is contained in text property.
The notification is called when the text property is changed, either interactively or as a result of direct call.
One of the following ta:: constants, defining the text alignment:
ta::
ta::Left ta::Right ta::Center
Default value: ta::Left
ta::Left
If 1, adjusts the height of the widget automatically when its font changes.
Default value: 1
If 1, all the text is selected when the widget becomes focused.
If 1, the keyboard kb::Left and kb::Right commands, if received when the cursor is at the beginning or at the end of text, and cannot be mover farther, not processed. The result of this is that the default handler moves focus to a neighbor widget, in a way as if the Tab key was pressed.
kb::Left
kb::Right
Default value: 0
Width of 3d-shade border around the widget.
Default value: 2
Selects the position of the cursor in characters starting from the beginning of visual text.
Selects the first visible character of text
Governs the typing mode - if 1, the typed text is inserted, if 0, the text overwrites the old text. When insertMode is 0, the cursor shape is thick and covers the whole character; when 1, it is of default width.
insertMode
Default toggle key: Insert
The maximal length of the text, that can be stored into text or typed by the user.
Default value: 256
A character to be shown instead of the text letters when writeOnly property value is 1.
Default value: '*'
'*'
If 1, the text cannot be edited by the user.
Two integers, specifying the beginning and the end of the selected text. A case with no selection is when START equals END.
Selects the start of text selection.
Selects the end of text selection.
If set, indicates RTL text input.
Contains string of character that are used for locating a word break. Default STRING value consists of punctuation marks, space and tab characters, and \xff character.
\xff
If 1, the input is not shown but mapped to passwordChar characters. Useful for a password entry.
Copies the selected text, if any, to the clipboard.
Default key: Ctrl+Insert
Cuts the selected text into the clipboard.
Default key: Shift+Delete
Removes the selected text.
Default key: Delete
Copies text from the clipboard and inserts it in the cursor position.
Default key: Shift+Insert
Selects all text
When bidi is enabled, methods firstChar, charOffset, selection etc change their meaning, so that these cannot be used to calculate text offsets f.ex. via substr. Also, selection ranges of bidi text are not straighforward. Use the following methods whenever text manipulations are needed:
firstChar
charOffset
selection
substr
Returns 1 if visual layout does not correspond to storage layout.
Returns character at OFFSET
Converts visual offset to storage offset
Returns the character offset in storage directly under the cursor.
Returns range of characters covered by the selection.
Dmitry Karasik, <dmitry@karasik.eu.org>.
Prima, Prima::Widget, Prima::Bidi, examples/edit.pl.
To install Prima, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Prima
CPAN shell
perl -MCPAN -e shell install Prima
For more information on module installation, please visit the detailed CPAN module installation guide.