Class are destined to manipulating text data - load/save from file/string, insert, delete, manipulation with marked data and clipboard, formated text and more. TEXTEDIT is a base class for function memoedit and class MEDIT.
TextEditNew(<Lrow>, <Lcol>, <Rrow>, <Rcol>, [<color>]) --> new TEXTEDIT object
<ClassName> | TEXTEDIT |
<Path> | String, path to editing file |
<FileName> | String, file name of editing file |
<ColorSpec> | String, color specification. If parameters <color> not specified, |
this attributes take value from SetColor() | |
"clr1, clr2, clr3, clr4" | |
clr1 - symbols base color | |
clr2 - EOF-string color | |
clr3 - mark symbols color | |
clr4 - mark founded symbols color | |
<nTop> | a TEXTEDIT viewport coordinates, specified by <Lrow> parameters |
<nLeft> | a TEXTEDIT viewport coordinates, specified by <Lcol> parameters |
<nBottom> | a TEXTEDIT viewport coordinates, specified by <Rrow> parameters |
<nRight> | a TEXTEDIT viewport coordinates, specified by <Rcol> parameters |
<Lines> | Numeric, lines in TEXTEDIT |
<Line> | Numeric, current line |
<Pos> | Numeric, cursor position into current line |
<ColWin> | Numeric, cursor position into TEXTEDIT viewport |
<RowWin> | Numeric, cursor position into TEXTEDIT viewport |
<Updated> | Logical, is TRUE if data changed |
<MarginLeft> | Numeric, the left margin value, specified as TE_MARGIN_LEFT |
<MarginRight> | Numeric, the right margin value, specified as TE_MARGIN_RIGHT |
<TabSize> | Numeric, the tabulation size value, specified as TE_TABSIZE |
<Hyphen> | Logical, if TRUE, then hyphen, specified as TE_HYPHEN |
<MaxStrings> | Numeric, the max strings value in TEXTEDIT, specified as TE_MAXSTRINGS |
<TabPack> | Logical, if TRUE, all symbols Tab will be packing by load and save string/file. |
By default specified as set("edit_tabpack") | |
<InFocus> | Logical, if TRUE object in focus. |
<MkBlock> | Logical, if TRUE then block is marked. |
<StrBlock> | Logical, if TRUE then string block is marked. |
<RectBlock> | Logical, if TRUE then rectangle block is marked. |
<KoordBlock> | Array of numeric value, the block coordinates {<nTop>, <nLeft>, <nBottom>, <nRight>} or |
{<nBottom>, <nRight>, <nTop>, <nLeft>} | |
<LenUndo> | Numeric, the length undo buffer. By default is 100. |
<Charset> | String, data charset. |
<EofString> | String, the text of <end of file>. By default is <EOF> |
<lEofString> | Logical, if TRUE, showing string <EofString> as last string |
of viewing data. | |
<HighLightColor> | MAP, the map includes string numer what selected special color. |
<Nstyle> | Logical, is TRUE if every line into TEXTEDIT viewport has string |
number. | |
<EdBuffer> | Array, array of string to edit. It is editor buffer. |
ADDTOCLIPBOARD | Add block to clipboard. |
APPLYKEY | Evalute the code block. |
BACKSPACE | Delete left letter. |
BEGINBLOCK | Start block hightlighting. |
BOTTOM | Goes to the last string of editor buffer. |
CANCELBLOCK | Unmarking block. |
CENTERLINE | Centering line. |
CLEAR | Clear editor buffer. |
COPYBLOCK | Make copy block. |
COPYTOCLIPBOARD | Copy block to clipboard. |
CURWORD | Take word specified by position line and column. |
DELEND | Delete letters to the end of string. |
DELETE | Delete letter. |
DELETEBLOCK | Make remove block. |
DELETELINE | Delete line. |
DELHOME | Delete letters to begin of string. |
DELLEFT | Delete left letter. |
DELRIGHT | Delete letter. |
DOWN | Goes down one line. |
DRAW | Draw one of box characters. |
END | Goes to the last line postion. |
ENDBLOCK | Stop block hightlighting. |
FIND | Finds string into editor buffer. |
FINDNEXT | Continue search forward. |
FINDPREV | Continue search backward. |
FORMATLINE | Formatting line. |
FORMATPART | Formatting part. |
GOTOLINE | Goes to specified line. |
GOTOPOS | Goes to specified column. |
HANDLEKEY | Simple handle key. |
HIGHLIGHTADD | Mark highlight line some colors. |
HIGHLIGHTDEL | Unmark highlight line some color. |
HOME | Goes to the first line postion. |
IDENTITY | Search identity alpha character. |
INSERT | Insert alpha character or substring to the editor buffer. |
INSERTLINE | Insert new line. |
INSMACRO | Make macro and insert result to editor buffer. |
INSTEMPL | Insert substring by template. |
KILLNUMSTYLE | Off the style "NUMERIC" |
LEFT | Goes left one column. |
LOADBLOCK | Make load block from file. |
LOADFILE | Load file. |
LOADSTRING | Load string to editor buffer. |
MATCHSTRUCT | Matching structure. |
MOVEBLOCK | Make move block. |
MOVETOCLIPBOARD | Move block to clipboard. |
NEWLINE | Goes new line. |
NEXTWORD | Take next word of word specified by position line and column. |
OVERSTRIKE | Replace alpha character or substring into editor buffer. |
PAGEDOWN | Goes down one page. |
PAGEUP | Goes up one page. |
PASTEFROMCLIPBOARD | Paste block from clipboard. |
PREVWORD | Take previous word of word specified by position line and column. |
Print. | |
PRINTBLOCK | Print marked block. |
REFRESH | Refresh TEXTEDIT viewport. |
REPLACE | Find with replace string into editor buffer. |
RIGHT | Goes right one column. |
SAVEBLOCK | Make save block to file. |
SAVEFILE | Save to file. |
SAVESTRING | Save editor buffer to string. |
SETCHARSET | Set charset to translate editor data. |
SETFOCUS | Set/kill focus. |
SETKEY | Set a code block associated with code key value. |
SETNEWCOLOR | Set new colors TEXTEDIT. |
SETNUMSTYLE | On/Off the draw style "NUMERIC" |
TEXTEDITNEW | TEXTEDIT object constructor. |
TOP | Goes to the first string of editor buffer. |
UNDO | Make undo operation. |
UP | Goes up one line. |
WORDLEFT | Goes left one word. |
WORDRIGHT | Goes right one word. |
WRITEUNDO | Save undo information. |
#include <inkey.ch> local te, nKey, str clear screen wopen(2, 2, 20, 40) te := textEditNew(0, 0, maxrow(), maxcol(), "11/1,0/2,0/3,0/7") te:EofString := " ******* The happy end ******* " te:lEofString := .t. te:LoadString("This is test string!&\n&\tThis is test string!&\n&\t&\tThis is test string!&\n") while .T. nKey := inkey(0) do case case nKey == K_ESC str := te:SaveString() exit case nKey == K_UP te:up() case nKey == K_DOWN te:down() case nKey == K_LEFT te:left() case nKey == K_RIGHT te:right() otherwise if (nKey>=32 .and. nKey<=256) if ( Set(_SET_INSERT) ) te:insert(chr(nKey)) else te:overStrike(chr(nKey)) endif endif endcase enddo wclose() ? str ?
No dependies of platform.
Add block to clipboard.
AddToClipboard(<aClipbrd>) --> NIL
Returns NIL.
AddToClipboard() is added marked block from editor buffer to the end of array <aClipbrd>. <aClipbrd> - it is not system clipboard. The size of <::Edbuffer> not changed. Mark block not unmarked.
Evalute the code block.
ApplyKey(<nKey>) --> nResult
Returns one of numeric value what definited in edit.ch.
TE_EXIT -1 User request for the TEXTEDIT to lose input focus
TE_CONTINUE 0 Code block associated with <nKey> was evaluated
TE_EXCEPTION 1 Unable to locate <nKey> in the dictionary, key was not processed
ApplyKey() evaluates the code block associeated with key code <nKey> that is contained whithin SetKey() dictionary and returns <nResult>.
Delete left letter.
BackSpace( [<lUndo>] ) --> NIL
Returns NIL.
BackSpace() is deleted one left letter from are current cursor position <::Line> and <::Pos>.
Start block hightlighting.
BeginBlock(<lType>[, <lUndo>]) --> NIL
Returns NIL.
BeginBlock() is canceled old highlight and started new string/rectangle block.
Goes to the last string of editor buffer.
Bottom([<lUndo>]) --> NIL
Returns NIL.
Bottom() is scrolled data to the last string of editor buffer (last element of <::EdBuffer>). The <::Line> attribute set to <::Lines> and <::RowWin> set to <::nBottom>-<::nTop>.
Unmarking block.
CancelBlock([<lUndo>]) --> NIL
Returns NIL.
CancelBlock() is unmarked text highlight.
Centering line.
CenterLine([<lUndo>] ) --> NIL
Returns NIL.
CenterLine() is centered current line <::Line>. The <::Pos> is rested previouse.
Clear editor buffer.
Clear() --> NIL
No arguments
Returns NIL
Clear() is cleared editor buffer and init all counters to zero. Size array <::EdBuffer> trucate to 1 and it element sets to empty string.
Attention! This method not writing undo information.
Make copy block.
CopyBlock([<lMove>[, <lUndo>]]) --> .T. || .F.
Returns TRUE if block copied or moved.
CopyBlock() moved cursor to begin marked block (line and column) and copied or moved (if <lMove> is TRUE) marked block to new positon specified current cursor position line <::Line> and column <::Pos> in editor buffer.
If block not marked method returns FALSE.
When do operation copy, block copied into new position and size editor buffer <::EdBuffer> increased by size block(lines in block).
Move is equaled to copy, but in the previous place the block is removed.
Copy block to clipboard.
CopyToClipboard(<aClipbrd>) --> NIL
Returns NIL.
CopyToClipboard() is copied marked block from editor buffer to array <aClipbrd>. <aClipbrd> - it is not system clipboard. The size of <::Edbuffer> not changed. Mark block not unmarked.
Take word specified by position line and column.
CurWord([<nPos>], [nLine>],[ <lUndo>]) --> sCurrentWord
Returns curren word in specified position column and line.
CurWord() is searched word by position <nLine> and <nPos> and return it if found. Oher return empty string.
Word it is sequential of symbols without space and comma <,> and point <.>
Delete letters to the end of string.
DelEnd( [<lUndo>] ) --> NIL
Returns NIL.
DelEnd() is deleted all letters begin with column specified <::Pos> to the end of string <::Line>.
Delete letter.
Delete( [<lUndo>] ) --> NIL
Returns NIL.
Delete() is called method DelRight().
Make remove block.
DeleteBlock([<lUndo>]) --> .T. || .F.
Returns TRUE if block removed.
DeleteBlock() moved cursor to begin marked block (line and column) and removed marked block from editor buffer. The size of <::Edbuffer> decreased by size removes block(lines in block).
If block not marked, DeleteBlock() returns FALSE.
Delete line.
DeleteLine( [<lUndo>] ) --> NIL
Returns NIL.
DeleteLine() is removed from editor buffer line specified <::Line> and decreased size of <::Edbuffer> by 1.
Delete letters to begin of string.
DelHome( [<lUndo>] ) --> NIL
Returns NIL.
DelHome() is deleted all letters in line <::Line> with string begin to column <::Pos>. The attribute <::Pos> and <::ColWin> sets to 1.
Delete left letter.
DelLeft( [<lUndo>] ) --> NIL
Returns NIL.
DelLeft() is called method BackSpace().
Delete letter.
DelRight( [<lUndo>] ) --> NIL
Returns NIL.
DelRight() is deleted letter in line <::Line> and column <::Pos>. The attribute <::Pos> and <::ColWin> not changes.
Goes down one line.
Down([<lUndo>]) --> NIL
Returns NIL.
Down() is skipped editor buffer on the new position <::Line>+1. The <::Line> and <::RowWin> attributes increased by 1. If <::RowWin> is more then bottom boundary of viewport, <::RowWin> take value <::nBottom>-<::nTop>+1 and text in viewport scrolled up on 1 line.
Draw one of box characters.
Draw(<lDrawMode>, <nKey>[, <lUndo>] ) --> .T. || .F.
Returns TRUE if symbol is drew.
Draw() is drew box symbols in current position <::Line> and <::Pos>.
Goes to the last line postion.
End([<lUndo>]) --> NIL
Returns NIL.
End() is scrolled data to the end current line <::Line>. The <::Pos> attribute sets to len(<::Edbuffer[::Line]>)+1.
Stop block hightlighting.
EndBlock(<lType>[, <lUndo>]) --> NIL
Returns NIL.
EndBlock() is complited text highlighting.
Finds string into editor buffer.
Find(<oFind>[, <lUndo>]) --> .T. || .F.
Returns TRUE if searches string is found.
Find() is make the search string or regular expression in editor buffer. The <oFind> contain searching parameters(expression, direct, case-sensitive and the like). If expression found cursor moved to the founded word. This word will be marked special color (<clr4> from <::ColorSpec>).
If find is success, method returns TRUE. In other returns FALSE.
Continue search forward.
FindNext(<oFind>[, <lUndo>]) --> .T. || .F.
Returns TRUE if searches string is found.
FindNext() is continued search started in <::Find()> to forward. The <oFind> contain searching parameters(expression, case-sensitive and the like). The attribute <::Direct> of <oFind> sets to 1. If expression found cursor moved to the founded word.
Continue search backward.
FindPrev(<oFind>[, <lUndo>]) --> .T. || .F.
Returns TRUE if searches string is found.
FindNext() is continued search started in <::Find()> to forward. The <oFind> contain searching parameters(expression, case-sensitive and the like). The attribute <::Direct> of <oFind> sets to 2. If expression found cursor moved to the founded word.
Formatting line.
FormatLine([<lAutoMargin>],[ <nMarginLeft>],[ <nMarginRight>],[ <nTabSize>],[ <lHyphen>][, <lUndo>] ) --> NIL
<lAutoMargin> | - Logical, is TRUE(by default) if need make automaticaly left margin. |
<nMarginLeft> | - Numeric, the left margin value (by default <::MarginLeft>) |
<nMarginRight> | - Numeric, the right margin value (by default <::MarginRight>) |
<nTabSize> | - Numeric, the tabulation value (by default <::TabSize>) |
<lHyphen> | - Logical, is TRUE if hyphen (by default <::Hyphen>). |
<lUndo> | - Logical, is TRUE(by default) if operation saved in undo buffer. |
Returns NIL.
FormatLine() is formatted current line <::Line> editor buffer.
Formatting part.
FormatPart([<lAutoMargin>],[ <nMarginLeft>],[ <nMarginRight>],[ <nTabSize>],[ <lHyphen>][, <lUndo>] ) --> NIL
<lAutoMargin> | - Logical, is TRUE(by default) if need make automaticaly left margin. |
<nMarginLeft> | - Numeric, the left margin value (by default <::MarginLeft>) |
<nMarginRight> | - Numeric, the right margin value (by default <::MarginRight>) |
<nTabSize> | - Numeric, the tabulation value (by default <::TabSize>) |
<lHyphen> | - Logical, is TRUE if hyphen (by default <::Hyphen>). |
<lUndo> | - Logical, is TRUE(by default) if operation saved in undo buffer. |
Returns NIL.
FormatPart() is part formatted begin from <::Line> to the line whose position first character in line not equal posiiotn first character formatted part or to the end of editor buffer.
Goes to specified line.
GotoLine(<nLine>[, <lUndo>]) --> .T. || .F.
Returns TRUE if <nLine> >=1 and <nLine> <= <::Lines> else return FALSE.
GotoLine() is moved cursor to the new row position <nLine> if <nLine> between 1 and <::Lines>. editor buffer scrolled to the new line. Attribute <::Line> sets to <nLine>.
In other cursor not moved and method returns FALSE.
Goes to specified column.
GotoPos(<nPos>[, <lUndo>]) --> .T. || .F.
Returns TRUE if <nPos> >1 else return FALSE.
GotoPos() is moved cursor to the new column position <nPos>. editor buffer scrolled to the new position. Attribute <::Pos> sets to <nPos>.
In other cursor not moved and method returns FALSE.
Simple handle key.
HandleKey(<nKey>[, <lUndo>]) --> .T. || .F.
Returns TRUE if key will be processed else returns FALSE.
HandleKey() is taked key code and try processed operation equal this code (Moves up, down, left, right and more).
Mark highlight line some colors.
HighLightAdd(<nLine>, <nColorItem>) --> .T. || .F.
Returns TRUE if line marked and FALSE in other.
HighLightAdd() is highlighted line <nLine> and added information about color highlighting to map <::HighLightColor>.
One line can take a few colors to highlighting.
Unmark highlight line some color.
HighLightDel(<nLine>, <nColorItem>) --> .T. || .F.
Returns NIL.
HighLightDel() is undo highlight line <nLine> with color specified <nColorItem>. and removed information about this color highlighting from map <::HighLightColor>.
Goes to the first line postion.
Home([<lUndo>]) --> NIL
Returns NIL.
Home() is scrolled data to the first character not equal <space> of current line <::Line>.
The second call this method moves cursor to begin line.
Search identity alpha character.
Identity(<sSymb>, [<lDirect>],[ <lUndo>]) --> .T. || .F.
Returns TRUE if search is success.
Identity() is searched identical or pair symbols: (), <>, {}, []; and set cursor to founded symbol if search is success.
Insert alpha character or substring to the editor buffer.
Insert( <sStr>, [<lUndo>] ) --> NIL
Returns NIL.
Insert() is inserted substring <sStr> to the editor buffer begin of <::Pos> and in line <::Line>.
If <::Line> is more then size of editor buffer <::Lines>, then size of <::EdBuffer> increased to <::Line>.
The new cursor position into editor buffer is <::Line> and <::Pos>+len(sStr).
Insert new line.
InsertLine([<lUndo>][, [lAuto]] ) --> NIL
Returns NIL.
InsertLine() is inserted new line into editor buffer after line <::Line>-1. The size editor buffer increased by 1 and lines begin with <::Line>+1 moved down by one.
The current line kept previouse - <::Line>.
If <lAuto>, then <::Pos> sets to first column with not empty alpha character of previouse line <::Line>-1.
In other, <::Pos> sets to value <::MarginLeft>
Make macro and insert result to editor buffer.
InsMacro(<aTempl>[, <lUndo>] ) --> NIL
Returns NIL.
InsMacro() made macro specified some template and replace this template to result expression. In this case template is word in line <::Line> and column <::Pos>.
Insert substring by template.
InsTempl(<aTempl>[, <lUndo>] ) --> NIL
Returns NIL.
InsTempl() is replaced current word (template word) to value from a <aTempl> whose key equal template.
<sStr> can include symbol </> it is line delimiter. In this case will be inserted some string begin with column <::Pos>.
Off the style "NUMERIC"
KillNumStyle() --> NIL
No arguments
Returns NIL.
KillNumStyle() is sets to OFF numeric style.
Goes left one column.
Left([<lUndo>]) --> NIL
Returns NIL.
Left() goes left one column. The <::Pos> and <::ColWin> attributes decreased by 1. If <::ColWin> is less then 1, <::ColWin> take value 1 and text in viewport scrolled one column to right.
Make load block from file.
LoadBlock(<sFileName>[, <lUndo>]) --> .T. || .F.
Returns TRUE if block was load.
LoadBlock() is loaded data from file <sFileName> to block and inserted block to editor buffer from a current line <::Line> and marked block.
The size editor buffer <::EdBuffer> increased by size of block.
Load file.
LoadFile(<sFileName>) --> .T.
Returns TRUE.
LoadFile() is loaded file to editor buffer. Method splitted input string on substring with delimiter - hard carriage. Substrings translated from <::CharSet> to host charset and stored in <::Edbuffer>. Previous data of <::EdBuffer> removes.
If file not exist or not opened (access denied) method returns FALSE. <::EdBuffer> not changed.
Attention! This method not writing undo information.
Load string to editor buffer.
LoadString(<sStr>) --> .T.
Returns TRUE.
LoadString() is loaded string to editor buffer. Method splitted input string on substring with delimiter - hard carriage. Substrings translated from <::CharSet> to host charset and stored in <::Edbuffer>. Previous data of <::EdBuffer> removes.
Attention! This method not writing undo information.
Matching structure.
MatchStruct(<sWord>, [<lDirect>],[ <lUndo>]) --> .T. || .F.
Returns TRUE if search is success.
MatchStruct() is searched item of Clipper-like structures:
DO CASE; CASE; OTHERWISE; END[CASE]
DO[ WHILE]; LOOP; END[DO]
IF; ELSE; [ELSEIF]; END[IF]
...
and set cursor to founded item if search is success.
All items can be lower/upper case. Every structure can be embedded to others.
Make move block.
MoveBlock([<lUndo>]) --> .T. || .F.
Returns TRUE if block moved.
MoveBlock() is called method CopyBlock() with first parameters TRUE.
Move block to clipboard.
MoveToClipboard(<aClipbrd>) --> NIL
Returns NIL.
MoveToClipboard() is moved marked block from editor buffer to array <aClipbrd>. <aClipbrd> - it is not system clipboard.
Cursor moved to begin marked block and block removed from editor buffer. The size of <::Edbuffer> is decreased by size block (block lines).
Goes new line.
NewLine([<lUndo>][, <lAuto>] ) --> NIL
Returns NIL.
NewLine() is moved cursor to new line <::Line>+1. The size editor buffer not changed.
The current line <::Line> increased by 1.
If <lAuto> is TRUE, then <::Pos> sets to column value of start not empty symbol. In other, <::Pos> sets to value <::MarginLeft>.
Take next word of word specified by position line and column.
NextWord([<nPos>], [nLine>],[ <lUndo>]) --> sPrevWord
Returns next word of word specified with column and line.
NextWord() is searched word following for word specified <nLine> and <nPos> and return it if found. Oher return empty string.
Replace alpha character or substring into editor buffer.
OverStrike( <sStr>, [<lUndo>] ) --> NIL
Returns NIL.
OverStrike() is replaced substring with length len(sStr) to <sStr> into line <::Line> and begining with <::Pos> .
The new cursor position into editor buffer is <::Line> and <::Pos>+len(sStr).
Goes down one page.
PageDown([<lUndo>]) --> NIL
Returns NIL.
PageDown() is skipped editor buffer on the new position <::Line>+<::nBottom>-<nTop>. The <::Line> attribute increased by <::nBottom>-<nTop>. Data in viewport scrolled up on <::nBottom>-<nTop> line.
Goes up one page.
PageUp([<lUndo>]) --> NIL
Returns NIL.
PageUp() is skipped editor buffer on the new position <::Line>-<::nBottom>-<nTop>. The <::Line> attribute decreased by <::nBottom>-<nTop>. Data in viewport scrolled down on <::nBottom>-<nTop> line.
Paste block from clipboard.
PasteFromClipboard(<aClipbrd>[, <nItem>][, <lUndo>]) --> .T. || .F.
Returns TRUE if block inserted.
PasteFromClipboard() is pasted block from clipboard to current <::Line> and <::Pos> into editor buffer.
Block not removed from editor buffer. The size of <::Edbuffer> is increased by size block (block lines).
If array <aClipbrd> is empty, then PasteFromClipboard() returns FALSE; in other returns TRUE.
Take previous word of word specified by position line and column.
PrevWord([<nPos>], [nLine>],[ <lUndo>]) --> sPrevWord
Returns previous word of word specified with column and line.
PrevWord() is searched word preceding of word specified <nLine> and <nPos> and return it if found. Oher return empty string.
Print.
Print() --> .T.
No arguments
Returns TRUE.
Print() is printed editor buffer.
Print marked block.
PrintBlock() --> .T. || .F.
No arguments
Returns TRUE if block marked and FALSE in other.
PrintBlock() is printed block if it marked.
Refresh TEXTEDIT viewport.
Refresh() --> NIL
No arguments
Returns NIL.
Refresh() is refreshed TEXTEDIT viewport and positioned cursor on the screen to new position if it need.
Refresh() invoked automaticaly from all methods of TEXTEDIT.
Find with replace string into editor buffer.
Replace(<oFind>[, <lUndo>]) --> .T. || .F.
Returns TRUE if searches string is found.
Replace() is make the search string or regular expression in editor buffer. The <oFind> contain searching parameters(searchin expression, replaced string, direct, case-sensitive and the like). If expression found, it will be replace on string to replace <oFind:Rstring>. This substring will be marked special color (<clr4> from <::ColorSpec>).
If operation is success, method returns TRUE. In other returns FALSE.
Goes right one column.
Right([<lUndo>]) --> NIL
Returns NIL.
Right() goes right one column. The <::Pos> and <::ColWin> attributes increased by 1. If <::ColWin> is more then right boundary viewport, <::ColWin> take value <::nRight>-<nLeft> + 1 and text in viewport scrolled one column to left.
Make save block to file.
SaveBlock(<sFileName>[, <lCreateBak>[, <lUndo>]]) --> .T. || .F.
Returns TRUE if block saved.
SaveBlock() is saved marked string/rectangle block to file <sFileName>. If file <sFileName> not exist, method created it. In other, rewrited.
If block not marked or error emerge by creating file, method returns FALSE.
Save to file.
SaveFile(<sFileName>[, <lCreateBak>]) --> .T.
Returns TRUE in success.
SaveFile() is saved editor buffer to file.
If file <sFileName> not exist, method created it. In other file rewrited from editor buffer. <::Updated> set to FALSE.
If access denied, editor buffer not saved and method returns FALSE.
Attention! This method not writing undo information.
Save editor buffer to string.
SaveString() --> sStr
No arguments
Returns string created from editor buffer.
SaveString() is packed editor buffer to string and returns it. Substrins tranlated to <::Charset> and write to result string with delimiters CR.
Attention! This method not writing undo information.
Set charset to translate editor data.
SetCharset(<sCharset>) --> NIL
Returns NIL.
SetCharset() set a new charset <sCharset> and translated data of editor buffer to host charset.
Set/kill focus.
SetFocus([<lFocus>]) --> lNewFocus
Returns new focused value TRUE or FALSE.
SetFocus() sets or kills focus. If <lFocus> not specifyed, then <::InFocus> take new value !<::InFocus>
Set a code block associated with code key value.
SetKey(<nKey>[, <bData>]) --> bPreviouse
Returns the previouse block code if exist or returns current one <bData>.
SetKey() is sets a new code block associated with code <nKey>. When replacing an existing code block definition, it returns previous code block, in other returns current one. Its associated key code will be evaluated ApplyKey() methods.
If <bData> is NIL, SetKey() returns old block code and remove keypress/code block definition.
A default key code is cursor moves(K_UP, K_DOWN, K_LEFT, K_RIGHT, K_PGUP, K_PGDN, K_HOME, K_END ....) associates with corresponded methods Left(), Right(), Up(), Down() and more.
Set new colors TEXTEDIT.
SetNewColor(<sNewColor>) --> NIL
Returns NIL.
SetNewColor() is sets new color specification to TEXTEDIT. The method Refresh() used 4 colors item to draw editor buffer:
<sNewColor> := "<clr1>, <clr2>, <clr3>, <clr4>[, ...<clrN>]" <clr1> - symbols base color <clr2> - EOF-string color <clr3> - mark symbols color <clr4> - mark founded symbols color ... <clrN> - users color
On/Off the draw style "NUMERIC"
SetNumStyle([<lNum>]) --> NIL
Returns NIL.
SetNumStyle() is sets to ON/OFF numeric style. If ON, then every line of editor buffer draw into viewport with same number.
TEXTEDIT object constructor.
TextEditNew(<Lrow>, <Lcol>, <Rrow>, <Rcol>, [<color>]) --> new TEXTEDIT object
Method returns new TEXTEDIT object.
TextEditNew() is constructs and returns new TEXTEDIT object. That class can be used to edit, view, control some data - string or file.
Goes to the first string of editor buffer.
Top([<lUndo>]) --> NIL
Returns NIL.
Top() is scrolled data to the first string of editor buffer. The <::Line> and <::RowWin> attributes set to 1.
Make undo operation.
Undo() --> NIL
No arguments
Returns NIL.
Undo() made last operation what be saved into undo buffer. The size of undo buffer specified attribute <::LenUndo>.
Goes up one line.
Up([<lUndo>]) --> NIL
Returns NIL.
Up() is skipped editor buffer on the new position <::Line>-1. The <::Line> and <::RowWin> attributes decreased by 1. If <::RowWin> is less then 1, <::RowWin> take value 1 and text in viewport scrolled down on 1 line.
Goes left one word.
WordLeft([<lUndo>]) --> NIL
Returns NIL.
WordLeft() moves cursor to begin left word from current word. The <::Pos> and <::ColWin> attributes takes new value corresponded first character new word.
Goes right one word.
WordRight([<lUndo>]) --> NIL
Returns NIL.
WordRight() moves cursor to begin right word from current word. The <::Pos> and <::ColWin> attributes takes new value corresponded first character new word.
Save undo information.
WriteUndo(<nCMD>, <vData>) --> NIL
Returns NIL.
WriteUndo() is saved some data into undo buffer for undo operation.
WriteUndo() invoked automaticaly from methods TEXTEDIT and not required direct activation.