The Conroy & Conroy Subroutine Library (2021.3 edition)

TText_Editor_Interface
What: class
Ancestor: TBase_Delphi_Object
File: _TE_Interface
Layer: 0
Platforms: C++, C#, Javascript, Pascal (All), PHP, Python

This abstract base class is used to interface to a text editor. It has the following methods:

Bring_Cursor_Into_View
void Bring_Cursor_Into_View()
procedure Bring_Cursor_Into_View
Brings the current cursor position into view.

Column_Count
int32 Column_Count()
function Column_Count : int32
Returns the width of the viewport.

Cursor_Change
property Parent : integer read Get_Parent write Set_Parent
(Delphi only) Access to the Parent handle.

Get_Line
char* stdcall Get_Line( int32 Row )
function Get_Line( Row : integer ) : PChar
Requests the contents of the specified line.

Get_Parent
int Get_Parent()
function Get_Parent : integer
Returns the handle of the parent control.

Get_Position
void Get_Position( int32 &R, int32 &C )
procedure Get_Position( var R, C : int32 )
Returns current cursor position.

Get_Selected_Text
string Get_Selected_Text()
function Get_Selected_Text : string
Returns the currently selected text.

Key_Down
void Key_Down( uint16 &Key, int32 Shift )
procedure Key_Down( var Key : Word ; Shift : TShiftState )
send a key-down notice to the editor.

Line_Count
int32 Line_Count()
function Line_Count : int32
Returns the count of lines in the editor data.

Load_File
void Load_File( char* Nam )
procedure Load_File( Nam : PChar )
Loads the specified file into the editor.

Locate
void Locate( string S, int32 &R, int32 &C, bool CS )
procedure Locate( S : string ; var R, C : int32 ; CS : boolean )
Searches the editor contents for the specified string, starting at the specified row and column. CS is true to do a case-sensitive search. Returns the row and column of the found text (0,0 if not found)

Position_To
void Position_To( int32 R, int32 C )
procedure Position_To( R, C : int32 )
Change the cursor location, parameters indicate the new cursor position.

Save_File
void Save_File( char* Nam )
procedure Save_File( Nam : PChar )
Saves the current data to the specified file.

Set_Background
void Set_Background( int32 Color )
procedure Set_Background( Color : TColor )
Sets the editor background color.

Set_Font
void Set_Font( char* Name )
procedure Set_Font( Name : PChar )
Sets the font for the editor to use.

Set_Font_Size
void Set_Font_Size( int32 Siz )
procedure Set_Font_Size( Siz : int32 )
Sets the font size for the editor to use.

Set_Foreground
void Set_Foreground( int32 Color )
procedure Set_Foreground( Color : TColor )
Sets the editor foreground color.

Set_Notifier
void Set_Notifier( TText_Editor_Interface_Notifier* V )
procedure Set_Notifier( V : TText_Editor_Interface_Notifier )
Sets instance of notifier. The editor will send status to this object, if provided.

Set_Parent
void Set_Parent( int Handle )
procedure Set_Parent( Handle : integer )
Sets the parent. The parent's handle is passed.

Set_Position
void Set_Position( TText_Editor_Position P )
procedure Set_Position( P : TText_Editor_Position )
Sets the cursor position.

Set_Size
void Set_Size( int32 Height, int32 Width )
procedure Set_Size( Height, Width : integer )
Sets the height and width of the viewport.

SetFocus
void SetFocus()
procedure SetFocus
Notifies editor that it now has focus.