.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Prima::Edit 3" .TH Prima::Edit 3 "2009-02-24" "perl v5.14.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Prima::Edit \- standard text editing widget .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 6 \& use Prima::Edit; \& my $e = Prima::Edit\-> create( \& text => \*(AqHello $world\*(Aq, \& syntaxHilite => 1, \& ); \& $e\-> selection( 1, 1, 1, 2); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" The class provides text editing capabilities, three types of selection, text wrapping, syntax highlighting, auto indenting, undo and redo function, search and replace methods. .PP The module declares \f(CW\*(C`bt::\*(C'\fR package, that contains integer constants for selection block type, used by blockType property. .SH "USAGE" .IX Header "USAGE" The class addresses the text space by (X,Y)\-coordinates, where X is character offset and Y is line number. The addressing can be \&'physical' and 'logical', \- in logical case Y is number of line of text. The difference can be observed if wordWrap property is set to 1, when a single text string can be shown as several sub-strings, called \fIchunks\fR. .PP The text is stored line-wise in \f(CW\*(C`{lines}\*(C'\fR array; to access it use get_line method. To access the text chunk-wise, use get_chunk method. .PP All keyboard events, except the character input and tab key handling, are processed by the accelerator table ( see Prima::Menu ). The default \&\f(CW\*(C`accelItems\*(C'\fR table defines names, keyboard combinations, and the corresponding actions to the class functions. The class does not provide functionality to change these mappings. To do so, consult \*(L"Prima::AccelTable\*(R" in Prima::Menu. .SH "API" .IX Header "API" .SS "Events" .IX Subsection "Events" .IP "ParseSyntax \s-1TEXT\s0, \s-1RESULT_ARRAY_REF\s0" 4 .IX Item "ParseSyntax TEXT, RESULT_ARRAY_REF" Called when syntax highlighting is requires \- \s-1TEXT\s0 is a string to be parsed, and the parsing results to be stored in \s-1RESULT_ARRAY_REF\s0, which is a reference to an array of integer pairs, each representing a single-colored text chunk. The first integer in the pairs is the length of a chunk, the second \- color value ( \f(CW\*(C`cl::XXX\*(C'\fR constants ). .SS "Properties" .IX Subsection "Properties" .IP "autoIndent \s-1BOOLEAN\s0" 4 .IX Item "autoIndent BOOLEAN" Selects if the auto indenting feature is on. .Sp Default value: 1 .IP "blockType \s-1INTEGER\s0" 4 .IX Item "blockType INTEGER" Defines type of selection block. Can be one of the following constants: .RS 4 .IP "bt::CUA" 4 .IX Item "bt::CUA" Normal block, where the first and the last line of the selection can be partial, and the lines between occupy the whole line. \s-1CUA\s0 stands for \&'common user access'. .Sp Default keys: Shift + arrow keys .Sp See also: cursor_shift_key .IP "bt::Vertical" 4 .IX Item "bt::Vertical" Rectangular block, where all selected lines are of same offsets and lengths. .Sp Default key: Alt+B .Sp See also: mark_vertical .IP "bt::Horizontal" 4 .IX Item "bt::Horizontal" Rectangular block, where the selection occupies the whole line. .Sp Default key: Alt+L .Sp See also: mark_horizontal .RE .RS 4 .RE .IP "cursor X, Y" 4 .IX Item "cursor X, Y" Selects physical position of the cursor .IP "cursorX X" 4 .IX Item "cursorX X" Selects physical horizontal position of the cursor .IP "cursorY Y" 4 .IX Item "cursorY Y" Selects physical vertical position of the cursor .IP "cursorWrap \s-1BOOLEAN\s0" 4 .IX Item "cursorWrap BOOLEAN" Selects cursor behavior when moved horizontally outside the line. If 0, the cursor is not moved. If 1, the cursor moved to the adjacent line. .Sp See also: cursor_left, cursor_right, word_left, word_right. .IP "insertMode \s-1BOOLEAN\s0" 4 .IX Item "insertMode BOOLEAN" Governs the typing mode \- if 1, the typed text is inserted, if 0, the text overwrites the old text. When \f(CW\*(C`insertMode\*(C'\fR is 0, the cursor shape is thick and covers the whole character; when 1, it is of default width. .Sp Default toggle key: Insert .IP "hiliteNumbers \s-1COLOR\s0" 4 .IX Item "hiliteNumbers COLOR" Selects the color for number highlighting .IP "hiliteQStrings \s-1COLOR\s0" 4 .IX Item "hiliteQStrings COLOR" Selects the color for highlighting the single-quoted strings .IP "hiliteQQStrings \s-1COLOR\s0" 4 .IX Item "hiliteQQStrings COLOR" Selects the color for highlighting the double-quoted strings .IP "hiliteIDs \s-1ARRAY\s0" 4 .IX Item "hiliteIDs ARRAY" Array of scalar pairs, that define words to be highlighted. The first item in the pair is an array of words; the second item is a color value. .IP "hiliteChars \s-1ARRAY\s0" 4 .IX Item "hiliteChars ARRAY" Array of scalar pairs, that define characters to be highlighted. The first item in the pair is a string of characters; the second item is a color value. .IP "hiliteREs \s-1ARRAY\s0" 4 .IX Item "hiliteREs ARRAY" Array of scalar pairs, that define character patterns to be highlighted. The first item in the pair is a perl regular expression; the second item is a color value. .IP "mark \s-1MARK\s0 [ \s-1BLOCK_TYPE\s0 ]" 4 .IX Item "mark MARK [ BLOCK_TYPE ]" Selects block marking state. If \s-1MARK\s0 is 1, starts the block marking, if 0 \- stops the block marking. When \s-1MARK\s0 is 1, \s-1BLOCK_TYPE\s0 can be used to set the selection type ( \f(CW\*(C`bt::XXX\*(C'\fR constants ). If \s-1BLOCK_TYPE\s0 is unset the value of blockType is used. .IP "markers \s-1ARRAY\s0" 4 .IX Item "markers ARRAY" Array of arrays with integer pairs, X and Y, where each represents a physical coordinates in text. Used as anchor storage for fast navigation. .Sp See also: add_marker, delete_marker .IP "modified \s-1BOOLEAN\s0" 4 .IX Item "modified BOOLEAN" A boolean flag that shows if the text was modified. Can be used externally, to check if the text is to be saved to a file, for example. .IP "offset \s-1INTEGER\s0" 4 .IX Item "offset INTEGER" Horizontal offset of text lines in pixels. .IP "persistentBlock \s-1BOOLEAN\s0" 4 .IX Item "persistentBlock BOOLEAN" Selects whether the selection is cancelled as soon as the cursor is moved ( 0 ) or it persists until the selection is explicitly changed ( 1 ). .Sp Default value: 0 .IP "readOnly \s-1BOOLEAN\s0" 4 .IX Item "readOnly BOOLEAN" If 1, no user input is accepted. .IP "selection X1, Y1, X2, Y2" 4 .IX Item "selection X1, Y1, X2, Y2" Accepts two pair of coordinates, ( X1,Y1) the beginning and ( X2,Y2) the end of new selection, and sets the block according to blockType property. .Sp The selection is null if X1 equals to X2 and Y1 equals to Y2. has_selection method returns 1 if the selection is non-null. .IP "selStart X, Y" 4 .IX Item "selStart X, Y" Manages the selection start. See selection, X1 and Y1. .IP "selEnd X, Y" 4 .IX Item "selEnd X, Y" Manages the selection end. See selection, X2 and Y2. .IP "syntaxHilite \s-1BOOLEAN\s0" 4 .IX Item "syntaxHilite BOOLEAN" Governs the syntax highlighting. Is not implemented for word wrapping mode. .IP "tabIndent \s-1INTEGER\s0" 4 .IX Item "tabIndent INTEGER" Maps tab ( \et ) key to \f(CW\*(C`tabIndent\*(C'\fR amount of space characters. .IP "text \s-1TEXT\s0" 4 .IX Item "text TEXT" Provides access to all the text data. The lines are separated by the new line ( \en ) character. .Sp See also: textRef. .IP "textRef \s-1TEXT_PTR\s0" 4 .IX Item "textRef TEXT_PTR" Provides access to all the text data. The lines are separated by the new line ( \en ) character. \s-1TEXT_PTR\s0 is a pointer to text string. .Sp The property is more efficient than text with the large text, because the copying of the text scalar to the stack stage is eliminated. .Sp See also: text. .IP "topLine \s-1INTEGER\s0" 4 .IX Item "topLine INTEGER" Selects the first line of the text drawn. .IP "undoLimit \s-1INTEGER\s0" 4 .IX Item "undoLimit INTEGER" Sets limit on number of stored atomic undo operations. If 0, undo is disabled. .Sp Default value: 1000 .IP "wantTabs \s-1BOOLEAN\s0" 4 .IX Item "wantTabs BOOLEAN" Selects the way the tab ( \et ) character is recognized in the user input. If 1, it is recognized by the Tab key; however, this disallows the toolkit widget tab-driven navigation. If 0, the tab character can be entered by pressing Ctrl+Tab key combination. .Sp Default value: 0 .IP "wantReturns \s-1BOOLEAN\s0" 4 .IX Item "wantReturns BOOLEAN" Selects the way the new line ( \en ) character is recognized in the user input. If 1, it is recognized by the Enter key; however, this disallows the toolkit default button activation. If 0, the new line character can be entered by pressing Ctrl+Enter key combination. .Sp Default value: 1 .IP "wordDelimiters \s-1STRING\s0" 4 .IX Item "wordDelimiters STRING" Contains string of character that are used for locating a word break. Default \s-1STRING\s0 value consists of punctuation marks, space and tab characters, and \f(CW\*(C`\exff\*(C'\fR character. .Sp See also: word_left, word_right .IP "wordWrap \s-1BOOLEAN\s0" 4 .IX Item "wordWrap BOOLEAN" Selects whether the long lines are wrapped, or can be positioned outside the horizontal widget inferior borders. If 1, syntaxHilite is not used. A line of text can be represented by more than one line of screen text ( chunk ) . To access the text chunk-wise, use get_chunk method. .SS "Methods" .IX Subsection "Methods" .IP "add_marker X, Y" 4 .IX Item "add_marker X, Y" Adds physical coordinated X,Y to markers property. .IP "back_char [ \s-1REPEAT\s0 = 1 ]" 4 .IX Item "back_char [ REPEAT = 1 ]" Removes \s-1REPEAT\s0 times a character left to the cursor. If the cursor is on 0 x\-position, removes the new-line character and concatenates the lines. .Sp Default key: Backspace .IP "begin_undo_group" 4 .IX Item "begin_undo_group" Opens bracket for group of actions, undone as single operation. The bracket is closed by calling \f(CW\*(C`end_undo_group\*(C'\fR. .IP "cancel_block" 4 .IX Item "cancel_block" Removes the selection block .Sp Default key: Alt+U .IP "change_locked" 4 .IX Item "change_locked" Returns 1 if the logical locking is on, 0 if it is off. .Sp See also lock_change. .IP "copy" 4 .IX Item "copy" Copies the selected text, if any, to the clipboard. .Sp Default key: Ctrl+Insert .IP "copy_block" 4 .IX Item "copy_block" Copies the selected text and inserts it into the cursor position, according to the blockType value. .Sp Default key: Alt+C .IP "cursor_cend" 4 .IX Item "cursor_cend" Moves cursor to the bottom line .Sp Default key: Ctrl+End .IP "cursor_chome" 4 .IX Item "cursor_chome" Moves cursor to the top line .Sp Default key: Ctrl+Home .IP "cursor_cpgdn" 4 .IX Item "cursor_cpgdn" Default key: Ctrl+PageDown .Sp Moves cursor to the end of text. .IP "cursor_cpgup" 4 .IX Item "cursor_cpgup" Moves cursor to the beginning of text. .Sp Default key: Ctrl+PageUp .IP "cursor_down [ \s-1REPEAT\s0 = 1 ]" 4 .IX Item "cursor_down [ REPEAT = 1 ]" Moves cursor \s-1REPEAT\s0 times down .Sp Default key: Down .IP "cursor_end" 4 .IX Item "cursor_end" Moves cursor to the end of the line .Sp Default key: End .IP "cursor_home" 4 .IX Item "cursor_home" Moves cursor to the beginning of the line .Sp Default key: Home .IP "cursor_left [ \s-1REPEAT\s0 = 1 ]" 4 .IX Item "cursor_left [ REPEAT = 1 ]" Moves cursor \s-1REPEAT\s0 times left .Sp Default key: Left .IP "cursor_right [ \s-1REPEAT\s0 = 1 ]" 4 .IX Item "cursor_right [ REPEAT = 1 ]" Moves cursor \s-1REPEAT\s0 times right .Sp Default key: Right .IP "cursor_up [ \s-1REPEAT\s0 = 1 ]" 4 .IX Item "cursor_up [ REPEAT = 1 ]" Moves cursor \s-1REPEAT\s0 times up .Sp Default key: Up .IP "cursor_pgdn [ \s-1REPEAT\s0 = 1 ]" 4 .IX Item "cursor_pgdn [ REPEAT = 1 ]" Moves cursor \s-1REPEAT\s0 pages down .Sp Default key: PageDown .IP "cursor_pgup [ \s-1REPEAT\s0 = 1 ]" 4 .IX Item "cursor_pgup [ REPEAT = 1 ]" Moves cursor \s-1REPEAT\s0 pages up .Sp Default key: PageUp .IP "cursor_shift_key [ \s-1ACCEL_TABLE_ITEM\s0 ]" 4 .IX Item "cursor_shift_key [ ACCEL_TABLE_ITEM ]" Performs action of the cursor movement, bound to \s-1ACCEL_TABLE_ITEM\s0 action ( defined in \f(CW\*(C`accelTable\*(C'\fR or \f(CW\*(C`accelItems\*(C'\fR property ), and extends the selection block along the cursor movement. Not called directly. .IP "cut" 4 .IX Item "cut" Cuts the selected text into the clipboard. .Sp Default key: Shift+Delete .IP "delete_block" 4 .IX Item "delete_block" Removes the selected text. .Sp Default key: Alt+D .IP "delete_char [ \s-1REPEAT\s0 = 1 ]" 4 .IX Item "delete_char [ REPEAT = 1 ]" Delete \s-1REPEAT\s0 characters from the cursor position .Sp Default key: Delete .IP "delete_line \s-1LINE_ID\s0, [ \s-1LINES\s0 = 1 ]" 4 .IX Item "delete_line LINE_ID, [ LINES = 1 ]" Removes \s-1LINES\s0 of text at \s-1LINE_ID\s0. .IP "delete_current_chunk" 4 .IX Item "delete_current_chunk" Removes the chunk ( or line, if wordWrap is 0 ) at the cursor. .Sp Default key: Ctrl+Y .IP "delete_chunk \s-1CHUNK_ID\s0, [ \s-1CHUNKS\s0 = 1 ]" 4 .IX Item "delete_chunk CHUNK_ID, [ CHUNKS = 1 ]" Removes \s-1CHUNKS\s0 ( or lines, if wordWrap is 0 ) of text at \s-1CHUNK_ID\s0 .IP "delete_marker \s-1INDEX\s0" 4 .IX Item "delete_marker INDEX" Removes marker \s-1INDEX\s0 in markers list. .IP "delete_to_end" 4 .IX Item "delete_to_end" Removes text to the end of the chunk. .Sp Default key: Ctrl+E .IP "delete_text X, Y, \s-1TEXT_LENGTH\s0" 4 .IX Item "delete_text X, Y, TEXT_LENGTH" Removes \s-1TEXT_LENGTH\s0 characters at X,Y physical coordinates .IP "draw_colorchunk \s-1CANVAS\s0, \s-1TEXT\s0, \s-1LINE_ID\s0, X, Y, \s-1COLOR\s0" 4 .IX Item "draw_colorchunk CANVAS, TEXT, LINE_ID, X, Y, COLOR" Paints the syntax-highlighted chunk of \s-1TEXT\s0, taken from \s-1LINE_ID\s0 line index, at X, Y. \s-1COLOR\s0 is used if the syntax highlighting information contains \f(CW\*(C`cl::Fore\*(C'\fR as color reference. .IP "end_block" 4 .IX Item "end_block" Stops the block selection session. .IP "end_undo_group" 4 .IX Item "end_undo_group" Closes bracket for group of actions, opened by \f(CW\*(C`begin_undo_group\*(C'\fR. .IP "find \s-1SEARCH_STRING\s0, [ X = 0, Y = 0, \s-1REPLACE_LINE\s0 = '', \s-1OPTIONS\s0 ]" 4 .IX Item "find SEARCH_STRING, [ X = 0, Y = 0, REPLACE_LINE = '', OPTIONS ]" Tries to find ( and, if \s-1REPLACE_LINE\s0 is defined, to replace with it ) \&\s-1SEARCH_STRING\s0 from (X,Y) physical coordinates. \s-1OPTIONS\s0 is an integer that consists of the \f(CW\*(C`fdo::\*(C'\fR constants; the same constants are used in Prima::EditDialog, which provides graphic interface to the find and replace facilities of Prima::Edit. .RS 4 .IP "fdo::MatchCase" 4 .IX Item "fdo::MatchCase" If set, the search is case-sensitive. .IP "fdo::WordsOnly" 4 .IX Item "fdo::WordsOnly" If set, \s-1SEARCH_STRING\s0 must constitute the whole word. .IP "fdo::RegularExpression" 4 .IX Item "fdo::RegularExpression" If set, \s-1SEARCH_STRING\s0 is a regular expression. .IP "fdo::BackwardSearch" 4 .IX Item "fdo::BackwardSearch" If set, the search direction is backwards. .IP "fdo::ReplacePrompt" 4 .IX Item "fdo::ReplacePrompt" Not used in the class, however, used in Prima::EditDialog. .RE .RS 4 .RE .IP "get_chunk \s-1CHUNK_ID\s0" 4 .IX Item "get_chunk CHUNK_ID" Returns chunk of text, located at \s-1CHUNK_ID\s0. Returns empty string if chunk is nonexistent. .IP "get_chunk_end \s-1CHUNK_ID\s0" 4 .IX Item "get_chunk_end CHUNK_ID" Returns the index of chunk at \s-1CHUNK_ID\s0, corresponding to the last chunk of same line. .IP "get_chunk_org \s-1CHUNK_ID\s0" 4 .IX Item "get_chunk_org CHUNK_ID" Returns the index of chunk at \s-1CHUNK_ID\s0, corresponding to the first chunk of same line. .IP "get_chunk_width \s-1TEXT\s0, \s-1FROM\s0, \s-1LENGTH\s0, [ \s-1RETURN_TEXT_PTR\s0 ]" 4 .IX Item "get_chunk_width TEXT, FROM, LENGTH, [ RETURN_TEXT_PTR ]" Returns the width in pixels of \f(CW\*(C`substr( TEXT, FROM, LENGTH)\*(C'\fR. If \s-1FROM\s0 is larger than length of \s-1TEXT\s0, \s-1TEXT\s0 is padded with space characters. Tab character in \s-1TEXT\s0 replaced to tabIndent times space character. If \s-1RETURN_TEXT_PTR\s0 pointer is specified, the converted \s-1TEXT\s0 is stored there. .IP "get_line \s-1INDEX\s0" 4 .IX Item "get_line INDEX" Returns line of text, located at \s-1INDEX\s0. Returns empty string if line is nonexistent. .IP "get_line_dimension \s-1INDEX\s0" 4 .IX Item "get_line_dimension INDEX" Returns two integers, representing the line at \s-1INDEX\s0 in wordWrap mode: the first value is the corresponding chunk index, the second is how many chunks represent the line. .Sp See also: make_logical. .IP "get_line_ext \s-1CHUNK_ID\s0" 4 .IX Item "get_line_ext CHUNK_ID" Returns the line, corresponding to the chunk index. .IP "has_selection" 4 .IX Item "has_selection" Returns boolean value, indicating if the selection block is active. .IP "insert_empty_line \s-1LINE_ID\s0, [ \s-1REPEAT\s0 = 1 ]" 4 .IX Item "insert_empty_line LINE_ID, [ REPEAT = 1 ]" Inserts \s-1REPEAT\s0 empty lines at \s-1LINE_ID\s0. .ie n .IP "insert_line \s-1LINE_ID\s0, @TEXT" 4 .el .IP "insert_line \s-1LINE_ID\s0, \f(CW@TEXT\fR" 4 .IX Item "insert_line LINE_ID, @TEXT" Inserts \f(CW@TEXT\fR strings at \s-1LINE_ID\s0 .IP "insert_text \s-1TEXT\s0, [ \s-1HIGHLIGHT\s0 = 0 ]" 4 .IX Item "insert_text TEXT, [ HIGHLIGHT = 0 ]" Inserts \s-1TEXT\s0 at the cursor position. If \s-1HIGHLIGHT\s0 is set to 1, the selection block is cancelled and the newly inserted text is selected. .IP "lock_change \s-1BOOLEAN\s0" 4 .IX Item "lock_change BOOLEAN" Increments ( 1 ) or decrements ( 0 ) lock count. Used to defer change notification in multi-change calls. When internal lock count hits zero, \f(CW\*(C`Change\*(C'\fR notification is called. .IP "make_logical X, Y" 4 .IX Item "make_logical X, Y" Maps logical X,Y coordinates to the physical and returns the integer pair. Returns same values when wordWrap is 0. .IP "make_physical X, Y" 4 .IX Item "make_physical X, Y" Maps physical X,Y coordinates to the logical and returns the integer pair. .Sp Returns same values when wordWrap is 0. .IP "mark_horizontal" 4 .IX Item "mark_horizontal" Starts block marking session with \f(CW\*(C`bt::Horizontal\*(C'\fR block type. .Sp Default key: Alt+L .IP "mark_vertical" 4 .IX Item "mark_vertical" Starts block marking session with \f(CW\*(C`bt::Vertical\*(C'\fR block type. .Sp Default key: Alt+B .IP "overtype_block" 4 .IX Item "overtype_block" Copies the selected text and overwrites the text next to the cursor position, according to the blockType value. .Sp Default key: Alt+O .IP "paste" 4 .IX Item "paste" Copies text from the clipboard and inserts it in the cursor position. .Sp Default key: Shift+Insert .IP "realize_panning" 4 .IX Item "realize_panning" Performs deferred widget panning, activated by setting \f(CW\*(C`{delayPanning}\*(C'\fR to 1. The deferred operations are those performed by offset and topLine. .IP "redo" 4 .IX Item "redo" Re-applies changes, formerly rolled back by \f(CW\*(C`undo\*(C'\fR. .IP "set_line \s-1LINE_ID\s0, \s-1TEXT\s0, [ \s-1OPERATION\s0, \s-1FROM\s0, \s-1LENGTH\s0 ]" 4 .IX Item "set_line LINE_ID, TEXT, [ OPERATION, FROM, LENGTH ]" Changes line at \s-1LINE_ID\s0 to new \s-1TEXT\s0. Hint scalars \s-1OPERATION\s0, \s-1FROM\s0 and \s-1LENGTH\s0 used to maintain selection and marking data. \s-1OPERATION\s0 is an arbitrary string, the ones that are recognized are \f(CW\*(Aqovertype\*(Aq\fR, \f(CW\*(Aqadd\*(Aq\fR, and \f(CW\*(Aqdelete\*(Aq\fR. \&\s-1FROM\s0 and \s-1LENGTH\s0 define the range of the change; \s-1FROM\s0 is a character offset and \&\s-1LENGTH\s0 is a length of changed text. .IP "split_line" 4 .IX Item "split_line" Splits a line in two at the cursor position. .Sp Default key: Enter ( or Ctrl+Enter if wantReturns is 0 ) .IP "select_all" 4 .IX Item "select_all" Selects all text .IP "start_block [ \s-1BLOCK_TYPE\s0 ]" 4 .IX Item "start_block [ BLOCK_TYPE ]" Begins the block selection session. The block type if \s-1BLOCK_TYPE\s0, if it is specified, or blockType property value otherwise. .IP "undo" 4 .IX Item "undo" Rolls back changes into internal array, which size cannot extend \f(CW\*(C`undoLimit\*(C'\fR value. In case \f(CW\*(C`undoLimit\*(C'\fR is 0, no undo actions can be made. .IP "update_block" 4 .IX Item "update_block" Adjusts the selection inside the block session, extending of shrinking it to the current cursor position. .IP "word_left [ \s-1REPEAT\s0 = 1 ]" 4 .IX Item "word_left [ REPEAT = 1 ]" Moves cursor \s-1REPEAT\s0 words to the left. .IP "word_right [ \s-1REPEAT\s0 = 1 ]" 4 .IX Item "word_right [ REPEAT = 1 ]" Moves cursor \s-1REPEAT\s0 words to the right. .SH "AUTHOR" .IX Header "AUTHOR" Dmitry Karasik, . .SH "SEE ALSO" .IX Header "SEE ALSO" Prima, Prima::Widget, Prima::EditDialog, Prima::IntUtils, \fIexamples/editor.pl\fR