function Open(const AFileName: WideString; ARedraw: Boolean = True): Boolean; Opens a file and optionally redraws control. Result is True if file was successfully opened or False if file was not found or other open error occured. Pass the empty AFileName string to close the currently open file. Note:
|
function OpenStream(AStream: TStream; ARedraw: Boolean = True): Boolean; Opens a stream and optionally redraws control. Result is True if stream was successfully opened. Pass nil to stop use the currently used stream. Notes:
|
procedure Reload; Reloads current file or stream. |
function FindFirst(const AText: WideString; AOptions: TATStreamSearchOptions): Boolean; Starts text search. AText: text to search (Note: Unicode string must be in the Little-Endian format). AOptions: search options that are set of flags:
Match position and length are saved in SearchResultStart and SearchResultLength properties. You should manually highlight found match using SetSelection method. Notes:
|
function FindNext(AFindPrevious: Boolean = False): Boolean; Continues text search. AFindPrevious: continue search in reverse direction (Note: not supported for RegEx search). Result is the same as for FindFirst method. Note:
|
procedure CopyToClipboard(AsHex: Boolean = False); Copies current selection (AnsiString or WideString depending on current view mode) to Clipboard. AsHex may be True in Text/Binary/Hex modes, in this case the hex-encoded string (bytes in the hex form separated by spaces) will be copied. Notes:
|
procedure SetSelection(const AStart, ALength: Int64; AScroll: Boolean; AFireEvent: Boolean = True; ARedraw: Boolean = True); Sets selection and optionally scrolls control to selection start. AStart: selection start (0-based), ALength: selection length, AScroll: scroll control to selection start afterwards, AFireEvent: fire the OnSelectionChange event afterwards, ARedraw: redraw control afterwards. Note:
|
procedure Scroll(const APos: Int64; AIndentVert, AIndentHorz: integer; ARedraw: Boolean = True); Scrolls control to specified position. Control will be scrolled vertically so that position APos (0-based) is visible by AIndentVert lines lower than top border; if after that the position is still out of screen, control will be scrolled horizontally so that position is visible by AIndentHorz chars righter than left border. ARedraw: allow to redraw control afterwards. |
procedure SelectAll; procedure SelectNone; Selects all text. Deselects text. |
procedure Print(
APrintRange: TPrintRange;
AFromPage: Integer = 1;
AToPage: Integer = MaxInt;
ACopies: Integer = 1;
const ACaption: string = '');
Shows "Print preview" dialog and allows user to print text. APrintRange: print range (type declared in Dialogs.pas):
ACaption: caption of print job. Notes:
|
procedure PrintPreview; Shows "Print preview" dialog for current selection. When text is selected (SelLength <> 0), this method calls Print(prSelection), otherwise it calls Print(prAllPages). Note:
|
function IncreaseFontSize(AIncrement: Boolean): Boolean; Increases (AIncrement = True) or decreases current font size. Result is True if font size was changed or False if minimal or maximal size value is already set. Note:
|
procedure TextEncodingsMenu(AX, AY: Integer); Shows menu of all available encodings for the current mode. Menu is shown at point (AX, AY). Note:
|