*****************************************
*REdit - A RichEdit descendent component*
*****************************************
Features:
- Provides its own methods to load from files of various formats
- RTF content published so that it can be read and modified
- Easy for you to add your own search engine (template provided)
- Variable length of spaces between tab markers or use real tab,
- Supports auto-indent and back-space-unindent
- Customize most of the above while program is running
- Getting and changing the current row and column
- Getting and changing the current topmost row
- Getting the current maximum number of visible rows
- Getting if it is in insert or overwrite mode
- Supports insertion of files at selection
- Supports saving to Unix and Macintosh formats
- Changed behavior:
Holding <Ctrl> while pressing <up>, <down>, <page up> or <page down>
scrolls without moving the caret
- A method to trim all trailing spaces
- Added events:
1. On Position Change
2. On Mode (Insert <-> Overwrite) Change
3. On Horizontal Scroll
4. On Vertical Scroll
- Document Source Code with hints on where you can add extra stuffs
***************************************************
*New Public (not published) methods and properties*
***************************************************
Load from a file given the filename.
Use this method to load files of any form (DOS/Unix/Mac)
Note:
- ONLY use TREdit.LoadFromFile, and NOT Lines.LoadFromFile, to open files
--------------------------------------------------------------------------------
procedure InsertFromFile(const FileName: string);
Inserts a file at at the current selection point given the file name
--------------------------------------------------------------------------------
procedure SaveToDOS(const FileName: string);
procedure SaveToUnix(const FileName: string);
procedure SaveToMac(const FileName: string);
Save the editor content to various formats in the given file name
Note:
- ONLY use TREdit.SaveTo*, and NOT Lines.SaveToFile, to save files
--------------------------------------------------------------------------------
procedure TrimAllTrail;
Trims all trailing spaces in the editor content
--------------------------------------------------------------------------------
function Find(InPattern: string; InStart: integer;
IsCaseSen: boolean; IsRegExp: boolean): integer;
Given the search pattern, the position from which to start searching,
case sensitivity, and if it is a regular expression search,
search the given pattern in the editor content.
Note:
- This part is commented out because I cannot include RegExp.pas
with the component
--------------------------------------------------------------------------------
property CurrentRow: integer;
Get or set the current row where the caret is at
--------------------------------------------------------------------------------
property CurrentCol: integer;
Get or set the current column where the caret is at
--------------------------------------------------------------------------------
property CurrentTop: integer;
Get or set the current topmost visible row
OnVScroll is called if it is assigned
--------------------------------------------------------------------------------
property MaxVisible: integer;
Get the maximum number of visible lines
--------------------------------------------------------------------------------
property IsOverwrite: boolean read FIsOverwrite;
Get the insertion mode - Insert:false, Overwrite:true
**************************
*New Published properties*
**************************
property RTFText: string;
Get or set the RTF content
--------------------------------------------------------------------------------
property IndentSpace: integer;
Get or set the number of spaces between tab markers
A value of 0 corresponds to using the true tab character
--------------------------------------------------------------------------------
property BackSpaceUnIndent: boolean;
Get or set "back space unindent", true if this feature is wanted
--------------------------------------------------------------------------------
property AutoIndent: boolean;
Get or set "auto indentation", true if this feature is wanted
--------------------------------------------------------------------------------
property OnPosChange: TPosChange;
procedure(InRow, InCol: integer)
where InRow is the row and InCol is the column it will supply to your
event handler
Triggered when the caret changes its position
--------------------------------------------------------------------------------
property OnModeChange: TModeChange;
procedure(IsStateOverwrite: boolean)
where IsStateOverwrite is the status of the "overwrite state"
(true -> overwrite, false -> insert) it will supply to your event handler
Triggered when the input mode is changed between Insert and Overwrite
--------------------------------------------------------------------------------
property OnScrollV: TNotifyEvent;
Triggered when there is a vertical scroll
--------------------------------------------------------------------------------
property OnScrollH: TNotifyEvent;