mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 14:09:17 +02:00
* several small changes
This commit is contained in:
parent
189e270fe9
commit
644a6d4b11
@ -45,6 +45,7 @@ type
|
|||||||
TLine = object(TCustomLine)
|
TLine = object(TCustomLine)
|
||||||
public { internal use only! }
|
public { internal use only! }
|
||||||
Text : PString;
|
Text : PString;
|
||||||
|
DefaultEditorInfo : PEditorLineInfo;
|
||||||
EditorInfos : PEditorLineInfoCollection;
|
EditorInfos : PEditorLineInfoCollection;
|
||||||
Flags : longint;
|
Flags : longint;
|
||||||
Owner : PCustomCodeEditorCore;
|
Owner : PCustomCodeEditorCore;
|
||||||
@ -293,12 +294,23 @@ const
|
|||||||
constructor TLine.Init(AOwner: PCustomCodeEditorCore; const AText: string; AFlags: longint);
|
constructor TLine.Init(AOwner: PCustomCodeEditorCore; const AText: string; AFlags: longint);
|
||||||
begin
|
begin
|
||||||
inherited Init(AText,AFlags);
|
inherited Init(AText,AFlags);
|
||||||
New(EditorInfos, Init(10,10));
|
// New(EditorInfos, Init(10,10));
|
||||||
Owner:=AOwner;
|
Owner:=AOwner;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TLine.AddEditorInfo(Index: sw_integer; AEditor: PCustomCodeEditor);
|
procedure TLine.AddEditorInfo(Index: sw_integer; AEditor: PCustomCodeEditor);
|
||||||
begin
|
begin
|
||||||
|
if Index=0 then
|
||||||
|
begin
|
||||||
|
DefaultEditorInfo:=New(PEditorLineInfo, Init(AEditor));
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
if not assigned(EditorInfos) then
|
||||||
|
begin
|
||||||
|
New(EditorInfos, Init(10,10));
|
||||||
|
EditorInfos^.AtInsert(0,DefaultEditorInfo);
|
||||||
|
DefaultEditorInfo:=nil;
|
||||||
|
end;
|
||||||
EditorInfos^.AtInsert(Index,New(PEditorLineInfo, Init(AEditor)));
|
EditorInfos^.AtInsert(Index,New(PEditorLineInfo, Init(AEditor)));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -306,7 +318,8 @@ procedure TLine.RemoveEditorInfo(AEditor: PCustomCodeEditor);
|
|||||||
var E: PEditorLineInfo;
|
var E: PEditorLineInfo;
|
||||||
begin
|
begin
|
||||||
E:=GetEditorInfo(AEditor);
|
E:=GetEditorInfo(AEditor);
|
||||||
EditorInfos^.Free(E);
|
if Assigned(EditorInfos) then
|
||||||
|
EditorInfos^.Free(E);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TLine.GetText: string;
|
function TLine.GetText: string;
|
||||||
@ -325,7 +338,10 @@ begin
|
|||||||
Match:=P^.Editor=Editor;
|
Match:=P^.Editor=Editor;
|
||||||
end;
|
end;
|
||||||
begin
|
begin
|
||||||
GetEditorInfo:=EditorInfos^.FirstThat(@Match);
|
if not assigned(EditorInfos) then
|
||||||
|
GetEditorInfo:=DefaultEditorInfo
|
||||||
|
else
|
||||||
|
GetEditorInfo:=EditorInfos^.FirstThat(@Match);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TLine.GetFlags: longint;
|
function TLine.GetFlags: longint;
|
||||||
@ -342,8 +358,15 @@ end;
|
|||||||
|
|
||||||
destructor TLine.Done;
|
destructor TLine.Done;
|
||||||
begin
|
begin
|
||||||
if Assigned(Text) then DisposeStr(Text); Text:=nil;
|
if Assigned(Text) then
|
||||||
if Assigned(EditorInfos) then Dispose(EditorInfos, Done); EditorInfos:=nil;
|
DisposeStr(Text);
|
||||||
|
Text:=nil;
|
||||||
|
if Assigned(EditorInfos) then
|
||||||
|
Dispose(EditorInfos, Done);
|
||||||
|
EditorInfos:=nil;
|
||||||
|
if Assigned(DefaultEditorInfo) then
|
||||||
|
Dispose(DefaultEditorInfo, Done);
|
||||||
|
DefaultEditorInfo:=nil;
|
||||||
inherited Done;
|
inherited Done;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -904,6 +927,7 @@ end;
|
|||||||
procedure TCodeEditor.SetSyntaxCompleted(SC : boolean);
|
procedure TCodeEditor.SetSyntaxCompleted(SC : boolean);
|
||||||
begin
|
begin
|
||||||
Core^.SetSyntaxCompleted(SC);
|
Core^.SetSyntaxCompleted(SC);
|
||||||
|
UpdateIndicator;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCodeEditor.GetLastSyntaxedLine: sw_integer;
|
function TCodeEditor.GetLastSyntaxedLine: sw_integer;
|
||||||
@ -1966,7 +1990,10 @@ end;
|
|||||||
END.
|
END.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.2 2001-08-05 02:01:48 peter
|
Revision 1.3 2001-09-14 16:33:06 pierre
|
||||||
|
* several small changes
|
||||||
|
|
||||||
|
Revision 1.2 2001/08/05 02:01:48 peter
|
||||||
* FVISION define to compile with fvision units
|
* FVISION define to compile with fvision units
|
||||||
|
|
||||||
Revision 1.1 2001/08/04 11:30:25 peter
|
Revision 1.1 2001/08/04 11:30:25 peter
|
||||||
|
Loading…
Reference in New Issue
Block a user