Reference TFormSource
Declared in Codebot.Frame.Source.pas on line 51
TFormSource is the unit of a form or frame
TFormSource = class
public
{ True if the unit is written in Delphi mode, where the address of an event
handler is assigned without @ }
IsDelphiMode: Boolean;
{ The index of the token of the unit name }
UnitNameIndex: Integer;
{ The index of the implementation keyword }
ImplementationIndex: Integer;
{ The index of the token code is inserted before at the end of the unit,
which is the initialization or finalization keyword, or the final end }
UnitEndIndex: Integer;
{ The index of the semicolon which ends the uses clause of the interface, or
-1 if the interface has no uses clause }
InterfaceUsesEnd: Integer;
{ The index of the interface keyword }
InterfaceIndex: Integer;
{ The index of the semicolon which ends the uses clause of the
implementation, or -1 if it has no uses clause }
ImplementationUsesEnd: Integer;
{ The index of the name of the form class in its declaration }
ClassIndex: Integer;
{ The index of the ancestor of the form class }
AncestorIndex: Integer;
{ The index of the end of the form class declaration }
ClassEndIndex: Integer;
{ The units in the uses clauses of the interface and the implementation }
InterfaceUses: TStringList;
ImplementationUses: TStringList;
{ The names declared in the form class, in lowercase }
ClassMembers: TStringList;
{ The names of global variables whose type is the form class }
FormVariables: TStringList;
constructor Create(const Text: string);
destructor Destroy; override;
{ Finds the parts of the unit for the form class FormClass. Fields of the
class named in ComponentNames are removed, along with the variables of the
form class and the form resource directive. Returns False if the unit
could not be understood, with the reason in Error. }
function Analyze(const FormClass: string; ComponentNames: TStrings): Boolean;
{ Replaces every use of the identifier OldName with NewName }
procedure ReplaceIdent(const OldName, NewName: string);
{ Adds an edit of the text of the unit }
procedure AddEdit(Pos, Count: Integer; const Text: string);
{ Inserts Text at the start of the line of the token Index }
procedure InsertBeforeLine(Index: Integer; const Text: string);
{ Inserts Text after the token Index }
procedure InsertAfter(Index: Integer; const Text: string);
{ Replaces the token Index with Text }
procedure ReplaceToken(Index: Integer; const Text: string);
{ Removes the tokens from First to Last, along with their line if nothing
else is on it }
procedure RemoveTokens(First, Last: Integer);
{ Returns the line of the token Index, starting at 1 }
function LineOf(Index: Integer): Integer;
{ Returns the text of the unit with all of the edits made }
function Apply: string;
function TokenCount: Integer;
function Token(Index: Integer): TPasToken;
{ True if the token Index is the identifier or keyword Word }
function IsWord(Index: Integer; const Word: string): Boolean;
{ True if the token Index is the symbol S }
function IsSymbol(Index: Integer; const S: string): Boolean;
property Error: string read FError;
end;