1Prima::InputLine(3)   User Contributed Perl Documentation  Prima::InputLine(3)
2
3
4

NAME

6       Prima::InputLine - standard input line widget
7
8   SYNOPSIS
9               use Prima qw(InputLine Application);
10               Prima::InputLine-> new( text => 'Hello world!');
11               run Prima;
12

DESCRIPTION

14       The class provides basic functionality of an input line, including
15       hidden input, read-only state, selection, and clipboard operations. The
16       input line text data is contained in text property.
17

API

19   Events
20       Change
21           The notification is called when the text property is changed,
22           either interactively or as a result of direct call.
23
24   Properties
25       alignment INTEGER
26           One of the following "ta::" constants, defining the text alignment:
27
28                   ta::Left
29                   ta::Right
30                   ta::Center
31
32           Default value: "ta::Left"
33
34       autoHeight BOOLEAN
35           If 1, adjusts the height of the widget automatically when its font
36           changes.
37
38           Default value: 1
39
40       autoSelect BOOLEAN
41           If 1, all the text is selected when the widget becomes focused.
42
43           Default value: 1
44
45       autoTab BOOLEAN
46           If 1, the keyboard "kb::Left" and "kb::Right" commands, if received
47           when the cursor is at the beginning or at the end of text, and
48           cannot be mover farther, not processed. The result of this is that
49           the default handler moves focus to a neighbor widget, in a way as
50           if the Tab key was pressed.
51
52           Default value: 0
53
54       borderWidth INTEGER
55           Width of 3d-shade border around the widget.
56
57           Default value: 2
58
59       charOffset INTEGER
60           Selects the position of the cursor in clusters starting from the
61           beginning of visual text.
62
63       firstChar
64           Selects the first visible cluster of text
65
66       insertMode BOOLEAN
67           Governs the typing mode - if 1, the typed text is inserted, if 0,
68           the text overwrites the old text. When "insertMode" is 0, the
69           cursor shape is thick and covers the whole character; when 1, it is
70           of default width.
71
72           Default toggle key: Insert
73
74       maxLen INTEGER
75           The maximal length of the text, that can be stored into text or
76           typed by the user.
77
78           Default value: 256
79
80       passwordChar CHARACTER
81           A character to be shown instead of the text letters when writeOnly
82           property value is 1.
83
84           Default value: '*'
85
86       readOnly BOOLEAN
87           If 1, the text cannot be edited by the user.
88
89           Default value: 0
90
91       selection START, END
92           Two integers, specifying the beginning and the end of the selected
93           text, in clusters. A case with no selection is when START equals
94           END.
95
96       selStart INTEGER
97           Selects the start of text selection.
98
99       selEnd INTEGER
100           Selects the end of text selection.
101
102       textDirection BOOLEAN
103           If set, indicates RTL text input.
104
105       textLigation BOOLEAN
106           If set, text may be rendered at better quality with ligation and
107           kerning, however that comes with a price that some ligatures may be
108           indivisible and form clusters (f.ex. ff or ffi ligatures). Cursor
109           cannot go inside of such clusters, and thus one can only select
110           them, delete as whole, or press Del/Backspace on the cluster's
111           edge.
112
113           Toggle during runtime with Ctrl+Shift+L.
114
115       wordDelimiters STRING
116           Contains string of character that are used for locating a word
117           break.  Default STRING value consists of punctuation marks, space
118           and tab characters, and "\xff" character.
119
120       writeOnly BOOLEAN
121           If 1, the input is not shown but mapped to passwordChar characters.
122           Useful for a password entry.
123
124           Default value: 0
125
126   Methods
127       copy
128           Copies the selected text, if any, to the clipboard.
129
130           Default key: Ctrl+Insert
131
132       cut Cuts the selected text into the clipboard.
133
134           Default key: Shift+Delete
135
136       delete
137           Removes the selected text.
138
139           Default key: Delete
140
141       paste
142           Copies text from the clipboard and inserts it in the cursor
143           position.
144
145           Default key: Shift+Insert
146
147       select_all
148           Selects all text
149
150   Bi-directional input and output
151       When working on bidirectional texts, or text represented by complex
152       script shaping, methods "firstChar", "charOffset", "selection" etc
153       cannot be used to calculate text offsets f.ex. via "substr". Note that
154       these values are in clusters, not in characters (see
155       Prima::Drawable::Glyphs for the description>. Also, selection ranges of
156       bidi text become not straighforward.  Use the following methods
157       whenever text manipulations are needed:
158
159       char_at OFFSET
160           Returns character at OFFSET
161
162       selection_strpos
163           Returns range of characters covered by the selection.
164

AUTHOR

166       Dmitry Karasik, <dmitry@karasik.eu.org>.
167

SEE ALSO

169       Prima, Prima::Widget, examples/edit.pl.
170
171
172
173perl v5.36.0                      2022-07-22               Prima::InputLine(3)
Impressum