TfsSyntaxMemo component - script editor with syntax highlighting
A special advanced TMemo is adapted for FastScript with support of C++ and Pascal syntax highlighting. Available in FastScript for VCL only. It's a "bonus" component and is not supported at present time.
Properties:
SyntaxType: TSyntaxType;
Type of syntax highlighting.
Possible values:
stPascal - for Pascal
stCpp - for C++
stSQL - for SQL
stText - a simple text (without highlighting).
Default value stPascal.
Lines: TStrings;
The edit text.
ShowFooter: Boolean;
Shows the footer with a cursor position, etc.
ShowGutter: Boolean;
Shows the info in the left part of a text with bookmarks, current step position, etc.
BlockColor: TColor;
Background color of the selected text.
BlockFontColor: TColor;
Color of the selected text.
CommentAttr: TFont;
Attributes of the comment font.
KeywordAttr: TFont;
Attributes of keyword font.
StringAttr: TFont;
Attributes of the string values font.
TextAttr: TFont;
Attributes of a simple text font.
Modified: Boolean;
True if the text was modified.
SelText: String;
Contains a selected text.
Methods:
procedure CopyToClipboard;
Copies a selected text to the clipboard.
procedure CutToClipboard;
Moves a selected text to the clipboard.
procedure PasteFromClipboard;
Inserts a text from the clipboard to the cursor position.
procedure SetPos(x, y: Integer);
Sets the cursor position in the text. Line and positions numbering begins from 0. See the GetPos method.
function GetPos: TPoint;
Returns the current cursor position. See SetPos.
procedure ShowMessage(s: String);
Shows a message in the footer.
procedure Undo;
Cancels the last change.
function Find(Text: String): boolean;
Searches a text from a current cursor position.
function IsBookmark(Line : integer): integer;
Return the bookmark number for the line with the Line number. Returns -1 if the bookmark is not set. See AddBookmark method.
procedure AddBookmark(Line, Number : integer);
Adds the bookmark number for the line Line with the number Number. Supports 10 bookmarks with numbers from 0 to 9. See DeleteBookmark, GotoBookmark methods.
procedure DeleteBookmark(Number : integer);
Deletes the bookmark with the number Number. See AddBookmark method.
procedure GotoBookmark(Number : integer);
Sets the cursor position to the line with the bookmark with the number Number. See AddBookmark method.
procedure SetActiveLine(Line : Integer);
Sets the active line highlighting (for use with the debugger). Line is the active line number. The highlighting is disabled if Line is set to -1. See the GetActiveLine method.
function GetActiveLine: Integer;
Returns the active line number. If there is no active lines it returns -1. See SetActiveLine method.
Hot keys.
Key | Action |
---|---|
Cursor arrow | Cursor moving |
PgUp, PgDn, | Page Up / Page Down |
Ctrl+PgUp | Move to the begin of text |
Ctrl+PgDn | Move to the end of text |
Home | Move to the begin of line |
End | Move to the end of line |
Enter | Move to the next line |
Delete | Delete symbol at right or selected text |
Backspace | Delete symbol at left |
Ctrl+Y | Delete current line |
Ctrl+Z | Undo last change |
Shift+Arrows | Select the text block |
Ctrl+A | Select all text |
Ctrl+U | Unindent selected block |
Ctrl+I | Indent selected block |
Ctrl+C, Ctrl+Insert | Copy to clipboard |
Ctrl+V, Shift+Insert | Paste from clipboard |
Ctrl+X, Shift+Delete | Cut to clipboard |
Ctrl+Shift+Number | Set bookmark |
Ctrl+Number | Goto bookmark |
Ctrl+F | Search text |
F3 | Continue search |