SynEdit: Remove "published" from TextAttribute. Add to child-classes

This commit is contained in:
Martin 2025-08-03 16:25:47 +02:00
parent 30eba66380
commit aa4b55e655
42 changed files with 243 additions and 198 deletions

View File

@ -36,7 +36,7 @@ type
Offset: Integer; // default 0. MultiWidth (e.g. Tab), if token starts in the middle of char Offset: Integer; // default 0. MultiWidth (e.g. Tab), if token starts in the middle of char
function HasValue: boolean; inline; function HasValue: boolean; inline;
function Init(APhys, ALog: Integer; AnOffs: Integer = 0): boolean; inline; procedure Init(APhys, ALog: Integer; AnOffs: Integer = 0); inline;
end; end;
@ -244,7 +244,7 @@ type
property Caption: PString read FCaption; // will never be nil property Caption: PString read FCaption; // will never be nil
property StoredName: string read FStoredName write FStoredName; // name for storage (e.g. xml) property StoredName: string read FStoredName write FStoredName; // name for storage (e.g. xml)
published public
property Foreground stored GetColorStored; property Foreground stored GetColorStored;
property Background stored GetColorStored; property Background stored GetColorStored;
property FrameColor stored GetColorStored; property FrameColor stored GetColorStored;
@ -292,7 +292,7 @@ type
function IsEnabled: boolean; override; function IsEnabled: boolean; override;
procedure InternalSaveDefaultValues; override; procedure InternalSaveDefaultValues; override;
published public
property BackAlpha stored GetAlphaStored; property BackAlpha stored GetAlphaStored;
property ForeAlpha stored GetAlphaStored; property ForeAlpha stored GetAlphaStored;
property FrameAlpha stored GetAlphaStored; property FrameAlpha stored GetAlphaStored;
@ -360,7 +360,7 @@ begin
Result := (Physical > 0) or (Logical > 0); Result := (Physical > 0) or (Logical > 0);
end; end;
function TLazEditDisplayTokenBound.Init(APhys, ALog: Integer; AnOffs: Integer): boolean; procedure TLazEditDisplayTokenBound.Init(APhys, ALog: Integer; AnOffs: Integer);
begin begin
Physical := APhys; Physical := APhys;
Logical := ALog; Logical := ALog;

View File

@ -1039,10 +1039,10 @@ type
const AChar: TUTF8Char; Data: pointer); virtual; const AChar: TUTF8Char; Data: pointer); virtual;
function GetHighlighterAttriAtRowCol(XY: TPoint; out Token: string; function GetHighlighterAttriAtRowCol(XY: TPoint; out Token: string;
out Attri: TSynHighlighterAttributes): boolean; out Attri: TLazEditTextAttribute): boolean;
function GetHighlighterAttriAtRowColEx(XY: TPoint; out Token: string; function GetHighlighterAttriAtRowColEx(XY: TPoint; out Token: string;
out TokenType, Start: Integer; out TokenType, Start: Integer;
out Attri: TSynHighlighterAttributes; out Attri: TLazEditTextAttribute;
ContinueIfPossible: boolean = False): boolean; ContinueIfPossible: boolean = False): boolean;
function GetHighlighterAttriAtRowColEx(XY: TPoint; out TokenType: Integer; ContinueIfPossible: boolean = False): boolean; function GetHighlighterAttriAtRowColEx(XY: TPoint; out TokenType: Integer; ContinueIfPossible: boolean = False): boolean;
procedure CaretAtIdentOrString(XY: TPoint; out AtIdent, NearString: Boolean); procedure CaretAtIdentOrString(XY: TPoint; out AtIdent, NearString: Boolean);
@ -10032,7 +10032,7 @@ var
// for ContextMatch // for ContextMatch
BracketKind, TmpStart: Integer; BracketKind, TmpStart: Integer;
SearchingForward: Boolean; SearchingForward: Boolean;
TmpAttr : TSynHighlighterAttributes; TmpAttr : TLazEditTextAttribute;
// for IsContextBracket // for IsContextBracket
MaxKnownTokenPos, LastUsedTokenIdx, TokenListCnt: Integer; MaxKnownTokenPos, LastUsedTokenIdx, TokenListCnt: Integer;
TokenPosList: Array of TokenPos; TokenPosList: Array of TokenPos;
@ -10308,7 +10308,7 @@ end;
//L505 begin //L505 begin
function TCustomSynEdit.GetHighlighterAttriAtRowCol(XY: TPoint; function TCustomSynEdit.GetHighlighterAttriAtRowCol(XY: TPoint;
out Token: string; out Attri: TSynHighlighterAttributes): boolean; out Token: string; out Attri: TLazEditTextAttribute): boolean;
var var
TmpType, TmpStart: Integer; TmpType, TmpStart: Integer;
begin begin
@ -10316,7 +10316,7 @@ begin
end; end;
function TCustomSynEdit.GetHighlighterAttriAtRowColEx(XY: TPoint; out Token: string; out function TCustomSynEdit.GetHighlighterAttriAtRowColEx(XY: TPoint; out Token: string; out
TokenType, Start: Integer; out Attri: TSynHighlighterAttributes; ContinueIfPossible: boolean TokenType, Start: Integer; out Attri: TLazEditTextAttribute; ContinueIfPossible: boolean
): boolean; ): boolean;
var var
PosX, PosY: integer; PosX, PosY: integer;
@ -10393,7 +10393,7 @@ procedure TCustomSynEdit.CaretAtIdentOrString(XY: TPoint; out AtIdent, NearStrin
var var
PosX, PosY, Start: integer; PosX, PosY, Start: integer;
Line, Token: string; Line, Token: string;
Attri, PrevAttri: TSynHighlighterAttributes; Attri, PrevAttri: TLazEditTextAttribute;
begin begin
PosY := XY.Y -1; PosY := XY.Y -1;
PrevAttri := nil; PrevAttri := nil;

View File

@ -71,8 +71,58 @@ type
end; end;
TLazSynCustomTextAttributes = TLazEditTextAttribute deprecated 'use TLazEditTextAttribute // to be removed in 5.99'; TLazSynCustomTextAttributes = TLazEditTextAttribute deprecated 'use TLazEditTextAttribute // to be removed in 5.99';
TSynHighlighterAttributes = TLazEditTextAttribute; TSynHighlighterAttributes = class(TLazEditTextAttribute)
TSynHighlighterAttributesModifier = TLazEditTextAttributeModifier; published
property Foreground;
property Background;
property FrameColor;
property ForePriority;
property BackPriority;
property FramePriority;
property FrameStyle;
property FrameEdges;
property Style;
property BoldPriority;
property ItalicPriority;
property UnderlinePriority;
property StrikeOutPriority;
property Features;
property OnChange;
end;
TSynHighlighterAttributesModifier = class(TLazEditTextAttributeModifier)
published
property Foreground;
property Background;
property FrameColor;
property ForePriority;
property BackPriority;
property FramePriority;
property FrameStyle;
property FrameEdges;
property Style;
property BoldPriority;
property ItalicPriority;
property UnderlinePriority;
property StrikeOutPriority;
property Features;
property OnChange;
published
property BackAlpha;
property ForeAlpha;
property FrameAlpha;
property StyleMask;
end;
{ TSynHighlighterAttributesHelper } { TSynHighlighterAttributesHelper }
@ -200,11 +250,11 @@ type
fUpdateChange: boolean; //mh 2001-09-13 fUpdateChange: boolean; //mh 2001-09-13
FIsInNextToEOL: Boolean; FIsInNextToEOL: Boolean;
function GetInstanceLanguageName: string; virtual; function GetInstanceLanguageName: string; virtual;
procedure AddAttribute(AAttrib: TSynHighlighterAttributes); override; procedure AddAttribute(AAttrib: TLazEditTextAttribute); override;
procedure RemoveAttribute(AAttrib: TLazEditTextAttribute); override; procedure RemoveAttribute(AAttrib: TLazEditTextAttribute); override;
procedure FreeHighlighterAttributes; //mh 2001-09-13 procedure FreeHighlighterAttributes; //mh 2001-09-13
function GetAttribCount: integer; virtual; function GetAttribCount: integer; virtual;
function GetAttribute(idx: integer): TSynHighlighterAttributes; virtual; function GetAttribute(idx: integer): TLazEditTextAttribute; virtual;
function GetDefaultAttribute(Index: integer): TSynHighlighterAttributes; function GetDefaultAttribute(Index: integer): TSynHighlighterAttributes;
virtual; abstract; virtual; abstract;
function GetDefaultFilter: string; virtual; function GetDefaultFilter: string; virtual;
@ -242,9 +292,9 @@ type
constructor Create(AOwner: TComponent); override; constructor Create(AOwner: TComponent); override;
destructor Destroy; override; destructor Destroy; override;
function AddSpecialAttribute(const aCaption: string; function AddSpecialAttribute(const aCaption: string;
const aStoredName: String = ''): TSynHighlighterAttributes; const aStoredName: String = ''): TLazEditTextAttribute;
function AddSpecialAttribute(const aCaption: PString; function AddSpecialAttribute(const aCaption: PString;
const aStoredName: String = ''): TSynHighlighterAttributes; const aStoredName: String = ''): TLazEditTextAttribute;
procedure Assign(Source: TPersistent); override; procedure Assign(Source: TPersistent); override;
procedure BeginUpdate; procedure BeginUpdate;
procedure EndUpdate; procedure EndUpdate;
@ -260,9 +310,9 @@ type
* GetTokenAttributeEx / GetEndOfLineAttributeEx * GetTokenAttributeEx / GetEndOfLineAttributeEx
The final attribute with merged modifiers (if HL has modifiers) The final attribute with merged modifiers (if HL has modifiers)
*) *)
function GetEndOfLineAttribute: TSynHighlighterAttributes; virtual; // valid after line was scanned to EOL function GetEndOfLineAttribute: TLazEditTextAttribute; virtual; // valid after line was scanned to EOL
function GetEndOfLineAttributeEx: TLazCustomEditTextAttribute; virtual; // valid after line was scanned to EOL function GetEndOfLineAttributeEx: TLazCustomEditTextAttribute; virtual; // valid after line was scanned to EOL
function GetTokenAttribute: TSynHighlighterAttributes; virtual; abstract; function GetTokenAttribute: TLazEditTextAttribute; virtual; abstract;
function GetTokenAttributeEx: TLazCustomEditTextAttribute; virtual; function GetTokenAttributeEx: TLazCustomEditTextAttribute; virtual;
function GetTokenKind: integer; virtual; abstract; function GetTokenKind: integer; virtual; abstract;
function GetTokenPos: Integer; virtual; abstract; // 0-based function GetTokenPos: Integer; virtual; abstract; // 0-based
@ -310,7 +360,7 @@ type
property LanguageName: string read GetInstanceLanguageName; property LanguageName: string read GetInstanceLanguageName;
public public
property AttrCount: integer read GetAttribCount; property AttrCount: integer read GetAttribCount;
property Attribute[idx: integer]: TSynHighlighterAttributes read GetAttribute; property Attribute[idx: integer]: TLazEditTextAttribute read GetAttribute;
property Capabilities: TSynHighlighterCapabilities read FCapabilities; property Capabilities: TSynHighlighterCapabilities read FCapabilities;
property SampleSource: string read GetSampleSource write SetSampleSource; property SampleSource: string read GetSampleSource write SetSampleSource;
// The below should be depricated and moved to those HL that actually implement them. // The below should be depricated and moved to those HL that actually implement them.
@ -797,7 +847,7 @@ var
begin begin
if fAttributes <> nil then begin if fAttributes <> nil then begin
for i := fAttributes.Count - 1 downto 0 do for i := fAttributes.Count - 1 downto 0 do
TSynHighlighterAttributes(fAttributes[i]).Free; TLazEditTextAttribute(fAttributes[i]).Free;
fAttributes.Clear; fAttributes.Clear;
end; end;
end; end;
@ -806,7 +856,7 @@ procedure TSynCustomHighlighter.Assign(Source: TPersistent);
var var
Src: TSynCustomHighlighter; Src: TSynCustomHighlighter;
i, j: integer; i, j: integer;
SrcAttri: TSynHighlighterAttributes; SrcAttri: TLazEditTextAttribute;
StoredName: String; StoredName: String;
begin begin
if Source is TSynCustomHighlighter then begin if Source is TSynCustomHighlighter then begin
@ -918,7 +968,7 @@ begin
end; end;
end; end;
procedure TSynCustomHighlighter.AddAttribute(AAttrib: TSynHighlighterAttributes); procedure TSynCustomHighlighter.AddAttribute(AAttrib: TLazEditTextAttribute);
begin begin
fAttributes.Add(AAttrib); fAttributes.Add(AAttrib);
end; end;
@ -929,14 +979,14 @@ begin
end; end;
function TSynCustomHighlighter.AddSpecialAttribute(const aCaption: string; function TSynCustomHighlighter.AddSpecialAttribute(const aCaption: string;
const aStoredName: String): TSynHighlighterAttributes; const aStoredName: String): TLazEditTextAttribute;
begin begin
result := TSynHighlighterAttributes.Create(aCaption,aStoredName); result := TSynHighlighterAttributes.Create(aCaption,aStoredName);
AddAttribute(result); AddAttribute(result);
end; end;
function TSynCustomHighlighter.AddSpecialAttribute(const aCaption: PString; function TSynCustomHighlighter.AddSpecialAttribute(const aCaption: PString;
const aStoredName: String): TSynHighlighterAttributes; const aStoredName: String): TLazEditTextAttribute;
begin begin
Result := TSynHighlighterAttributes.Create(aCaption,aStoredName); Result := TSynHighlighterAttributes.Create(aCaption,aStoredName);
AddAttribute(result); AddAttribute(result);
@ -958,11 +1008,11 @@ begin
Result := fAttributes.Count; Result := fAttributes.Count;
end; end;
function TSynCustomHighlighter.GetAttribute(idx: integer): TSynHighlighterAttributes; function TSynCustomHighlighter.GetAttribute(idx: integer): TLazEditTextAttribute;
begin begin
Result := nil; Result := nil;
if (idx >= 0) and (idx < fAttributes.Count) then if (idx >= 0) and (idx < fAttributes.Count) then
Result := TSynHighlighterAttributes(fAttributes[idx]); Result := TLazEditTextAttribute(fAttributes[idx]);
end; end;
class function TSynCustomHighlighter.GetCapabilities: TSynHighlighterCapabilities; class function TSynCustomHighlighter.GetCapabilities: TSynHighlighterCapabilities;
@ -980,7 +1030,7 @@ begin
Result := ['_', 'A'..'Z', 'a'..'z', '0'..'9']; Result := ['_', 'A'..'Z', 'a'..'z', '0'..'9'];
end; end;
function TSynCustomHighlighter.GetEndOfLineAttribute: TSynHighlighterAttributes; function TSynCustomHighlighter.GetEndOfLineAttribute: TLazEditTextAttribute;
begin begin
Result := nil; Result := nil;
end; end;
@ -1099,10 +1149,10 @@ procedure TSynCustomHighlighter.SetAttributesOnChange(AEvent: TNotifyEvent);
after all Attributes where created *) after all Attributes where created *)
var var
i: integer; i: integer;
Attri: TSynHighlighterAttributes; Attri: TLazEditTextAttribute;
begin begin
for i := fAttributes.Count - 1 downto 0 do begin for i := fAttributes.Count - 1 downto 0 do begin
Attri := TSynHighlighterAttributes(fAttributes[i]); Attri := TLazEditTextAttribute(fAttributes[i]);
if Attri <> nil then begin if Attri <> nil then begin
Attri.OnChange := AEvent; Attri.OnChange := AEvent;
Attri.InternalSaveDefaultValues; Attri.InternalSaveDefaultValues;

View File

@ -31,7 +31,7 @@ uses
// SynEdit // SynEdit
SynEditMiscClasses, SynHighlighterPas, SynEditMarkupHighAll, SynEditMiscClasses, SynHighlighterPas, SynEditMarkupHighAll,
SynEditHighlighterFoldBase, SynEditFoldedView, LazSynEditText, SynEditMiscProcs, SynEditHighlighterFoldBase, SynEditFoldedView, LazSynEditText, SynEditMiscProcs,
SynEditMarkup, SynEditPointClasses, SynEditHighlighter; SynEditMarkup, SynEditPointClasses, SynEditHighlighter, LazEditTextAttributes;
type type
@ -328,7 +328,7 @@ type
//TODO, move to highlighter //TODO, move to highlighter
function GetHighlighterAttriAtRowColEx(XY: TPoint; out Token: string; function GetHighlighterAttriAtRowColEx(XY: TPoint; out Token: string;
out TokenType, Start: Integer; out TokenType, Start: Integer;
out Attri: TSynHighlighterAttributes): boolean; //L505 out Attri: TLazEditTextAttribute): boolean; //L505
procedure MaybeRequestNodeStates(var ANode: TSynMarkupHighIfDefLinesNodeInfo); procedure MaybeRequestNodeStates(var ANode: TSynMarkupHighIfDefLinesNodeInfo);
@ -2361,7 +2361,7 @@ begin
end; end;
function TSynMarkupHighIfDefLinesTree.GetHighlighterAttriAtRowColEx(XY: TPoint; out function TSynMarkupHighIfDefLinesTree.GetHighlighterAttriAtRowColEx(XY: TPoint; out
Token: string; out TokenType, Start: Integer; out Attri: TSynHighlighterAttributes): boolean; Token: string; out TokenType, Start: Integer; out Attri: TLazEditTextAttribute): boolean;
var var
PosX, PosY: integer; PosX, PosY: integer;
Line: string; Line: string;
@ -2499,7 +2499,7 @@ var
var var
len, i, c, tk, x: Integer; len, i, c, tk, x: Integer;
dummy: String; dummy: String;
attr: TSynHighlighterAttributes; attr: TLazEditTextAttribute;
r: TSynCustomHighlighterRange; r: TSynCustomHighlighterRange;
f: TRangeStates; f: TRangeStates;
begin begin

View File

@ -58,7 +58,7 @@ interface
uses uses
SysUtils, Classes, LazUTF8, LazFileUtils, Controls, Graphics, Registry, SysUtils, Classes, LazUTF8, LazFileUtils, Controls, Graphics, Registry,
SynEditTypes, SynEditHighlighter, SynEditStrConst; SynEditTypes, SynEditHighlighter, SynEditStrConst, LazEditTextAttributes;
type type
TtkTokenKind = (tkComment, tkIdentifier, tkKey, tkNull, tkNumber, TtkTokenKind = (tkComment, tkIdentifier, tkKey, tkNull, tkNumber,
@ -177,7 +177,7 @@ type
function GetTokenID: TtkTokenKind; function GetTokenID: TtkTokenKind;
function GetToken: String; override; function GetToken: String; override;
procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override; procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override;
function GetTokenAttribute: TSynHighlighterAttributes; override; function GetTokenAttribute: TLazEditTextAttribute; override;
function GetTokenKind: integer; override; function GetTokenKind: integer; override;
function GetTokenPos: Integer; override; function GetTokenPos: Integer; override;
function IsKeyword(const AKeyword: string): boolean; override; //mh 2000-11-08 function IsKeyword(const AKeyword: string): boolean; override; //mh 2000-11-08
@ -819,7 +819,7 @@ begin
Result := fTokenId; Result := fTokenId;
end; end;
function TSynAnySyn.GetTokenAttribute: TSynHighlighterAttributes; function TSynAnySyn.GetTokenAttribute: TLazEditTextAttribute;
begin begin
case fTokenID of case fTokenID of
tkComment: Result := fCommentAttri; tkComment: Result := fCommentAttri;
@ -851,7 +851,7 @@ begin
Result := fTokenPos; Result := fTokenPos;
end; end;
procedure TSynAnySyn.ReSetRange; procedure TSynAnySyn.ResetRange;
begin begin
fRange := rsUnknown; fRange := rsUnknown;
end; end;

View File

@ -51,7 +51,7 @@ interface
uses uses
Classes, Classes,
Graphics, Graphics,
SynEditTypes, SynEditHighlighter, SynEditStrConst; SynEditTypes, SynEditHighlighter, SynEditStrConst, LazEditTextAttributes;
type type
TtkTokenKind = (tkComment, tkIdentifier, tkKey, tkNull, tkNumber, tkSpace, TtkTokenKind = (tkComment, tkIdentifier, tkKey, tkNull, tkNumber, tkSpace,
@ -135,7 +135,7 @@ type
procedure SetLine(const NewValue: String; LineNumber: Integer); override; procedure SetLine(const NewValue: String; LineNumber: Integer); override;
function GetToken: String; override; function GetToken: String; override;
procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override; procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override;
function GetTokenAttribute: TSynHighlighterAttributes; override; function GetTokenAttribute: TLazEditTextAttribute; override;
function GetTokenKind: integer; override; function GetTokenKind: integer; override;
function GetTokenPos: Integer; override; function GetTokenPos: Integer; override;
procedure Next; override; procedure Next; override;
@ -557,7 +557,7 @@ begin
TokenStart := FLine + fTokenPos; TokenStart := FLine + fTokenPos;
end; end;
function TSynBatSyn.GetTokenAttribute: TSynHighlighterAttributes; function TSynBatSyn.GetTokenAttribute: TLazEditTextAttribute;
begin begin
case fTokenID of case fTokenID of
tkComment: Result := fCommentAttri; tkComment: Result := fCommentAttri;

View File

@ -53,7 +53,7 @@ uses
SysUtils, SysUtils,
LCLIntf, LCLIntf,
Classes, Registry, Controls, Graphics, Classes, Registry, Controls, Graphics,
SynEditTypes, SynEditHighlighter, SynEditStrConst; SynEditTypes, SynEditHighlighter, SynEditStrConst, LazEditTextAttributes;
type type
TtkTokenKind = (tkAsm, tkComment, tkDirective, tkIdentifier, tkKey, tkNull, TtkTokenKind = (tkAsm, tkComment, tkDirective, tkIdentifier, tkKey, tkNull,
@ -236,7 +236,7 @@ type
procedure SetLine(const NewValue: String; LineNumber:Integer); override; procedure SetLine(const NewValue: String; LineNumber:Integer); override;
function GetToken: String; override; function GetToken: String; override;
procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override; procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override;
function GetTokenAttribute: TSynHighlighterAttributes; override; function GetTokenAttribute: TLazEditTextAttribute; override;
function GetTokenKind: integer; override; function GetTokenKind: integer; override;
function GetTokenPos: Integer; override; function GetTokenPos: Integer; override;
procedure Next; override; procedure Next; override;
@ -1508,7 +1508,7 @@ begin
Result := FExtTokenID; Result := FExtTokenID;
end; end;
function TSynCppSyn.GetTokenAttribute: TSynHighlighterAttributes; function TSynCppSyn.GetTokenAttribute: TLazEditTextAttribute;
begin begin
case fTokenID of case fTokenID of
tkAsm: Result := fAsmAttri; tkAsm: Result := fAsmAttri;
@ -1535,7 +1535,7 @@ begin
Result := fTokenPos; Result := fTokenPos;
end; end;
procedure TSynCppSyn.ReSetRange; procedure TSynCppSyn.ResetRange;
begin begin
fRange:= rsUnknown; fRange:= rsUnknown;
end; end;

View File

@ -53,7 +53,7 @@ uses
SysUtils, Classes, SysUtils, Classes,
LCLIntf, LCLType, LCLIntf, LCLType,
Controls, Graphics, Controls, Graphics,
SynEditTypes, SynEditHighlighter, SynEditStrConst; SynEditTypes, SynEditHighlighter, SynEditStrConst, LazEditTextAttributes;
type type
TtkTokenKind = (tkComment, tkIdentifier, tkKey, tkNull, tkNumber, tkSpace, TtkTokenKind = (tkComment, tkIdentifier, tkKey, tkNull, tkNumber, tkSpace,
@ -283,7 +283,7 @@ type
procedure SetLine(const NewValue: String; LineNumber: Integer); override; procedure SetLine(const NewValue: String; LineNumber: Integer); override;
function GetToken: string; override; function GetToken: string; override;
procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override; procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override;
function GetTokenAttribute: TSynHighlighterAttributes; override; function GetTokenAttribute: TLazEditTextAttribute; override;
function GetTokenKind: integer; override; function GetTokenKind: integer; override;
function GetTokenPos: Integer; override; function GetTokenPos: Integer; override;
procedure Next; override; procedure Next; override;
@ -2103,7 +2103,7 @@ begin
Result := FTokenId; Result := FTokenId;
end; end;
function TSynCssSyn.GetTokenAttribute: TSynHighlighterAttributes; function TSynCssSyn.GetTokenAttribute: TLazEditTextAttribute;
begin begin
case GetTokenID of case GetTokenID of
tkComment : Result := FCommentAttri; tkComment : Result := FCommentAttri;

View File

@ -35,7 +35,7 @@ interface
uses uses
Classes, Graphics, math, SynEditStrConst, Classes, Graphics, math, SynEditStrConst,
SynEditHighlighter, SynEditHighlighterFoldBase; SynEditHighlighter, SynEditHighlighterFoldBase, LazEditTextAttributes;
type type
TtkTokenKind = (tkNull, tkUnknown, tkSpace, TtkTokenKind = (tkNull, tkUnknown, tkSpace,
@ -130,7 +130,7 @@ type
function GetToken: String; override; function GetToken: String; override;
procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override; procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override;
function GetTokenAttribute: TSynHighlighterAttributes; override; function GetTokenAttribute: TLazEditTextAttribute; override;
function GetTokenKind: integer; override; function GetTokenKind: integer; override;
function GetTokenPos: Integer; override; function GetTokenPos: Integer; override;
function GetTokenID: TtkTokenKind; function GetTokenID: TtkTokenKind;
@ -556,7 +556,7 @@ begin
TokenStart:=FLine + fTokenPos; TokenStart:=FLine + fTokenPos;
end; end;
function TSynDiffSyn.GetTokenAttribute: TSynHighlighterAttributes; function TSynDiffSyn.GetTokenAttribute: TLazEditTextAttribute;
begin begin
case fTokenID of case fTokenID of
tkNull: Result := FUnknownAttri; tkNull: Result := FUnknownAttri;

View File

@ -49,7 +49,7 @@ interface
uses uses
SysUtils, Classes, Math, Graphics, SynEditTypes, SynEditHighlighter, SysUtils, Classes, Math, Graphics, SynEditTypes, SynEditHighlighter,
SynEditHighlighterXMLBase, SynEditHighlighterFoldBase, SynEditStrConst; SynEditHighlighterXMLBase, SynEditHighlighterFoldBase, SynEditStrConst, LazEditTextAttributes;
const const
MAX_ESCAPEAMPS = 159; MAX_ESCAPEAMPS = 159;
@ -478,7 +478,7 @@ type
procedure SetLine(const NewValue: string; LineNumber:Integer); override; procedure SetLine(const NewValue: string; LineNumber:Integer); override;
function GetToken: string; override; function GetToken: string; override;
procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override; procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override;
function GetTokenAttribute: TSynHighlighterAttributes; override; function GetTokenAttribute: TLazEditTextAttribute; override;
function GetTokenKind: integer; override; function GetTokenKind: integer; override;
function GetTokenPos: Integer; override; function GetTokenPos: Integer; override;
procedure Next; override; procedure Next; override;
@ -2708,7 +2708,7 @@ begin
Result := fTokenId; Result := fTokenId;
end; end;
function TSynHTMLSyn.GetTokenAttribute: TSynHighlighterAttributes; function TSynHTMLSyn.GetTokenAttribute: TLazEditTextAttribute;
begin begin
case fTokenID of case fTokenID of
tkAmpersand: Result := fAndAttri; tkAmpersand: Result := fAndAttri;

View File

@ -51,7 +51,7 @@ interface
uses uses
Classes, Classes,
Graphics, Graphics,
SynEditTypes, SynEditHighlighter, SynEditStrConst; SynEditTypes, SynEditHighlighter, SynEditStrConst, LazEditTextAttributes;
type type
TtkTokenKind = (tkComment, tkText, tkSection, tkKey, tkNull, tkNumber, TtkTokenKind = (tkComment, tkText, tkSection, tkKey, tkNull, tkNumber,
@ -104,14 +104,14 @@ type
class function GetLanguageName: string; override; class function GetLanguageName: string; override;
public public
constructor Create(AOwner: TComponent); override; constructor Create(AOwner: TComponent); override;
function GetDefaultAttribute(Index: integer): TSynHighlighterAttributes; function GetDefaultAttribute(Index: integer): TSynHighlighterAttributes;
override; override;
function GetEol: Boolean; override; function GetEol: Boolean; override;
function GetTokenID: TtkTokenKind; function GetTokenID: TtkTokenKind;
procedure SetLine(const NewValue: String; LineNumber:Integer); override; procedure SetLine(const NewValue: String; LineNumber:Integer); override;
function GetToken: String; override; function GetToken: String; override;
procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override; procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override;
function GetTokenAttribute: TSynHighlighterAttributes; override; function GetTokenAttribute: TLazEditTextAttribute; override;
function GetTokenKind: integer; override; function GetTokenKind: integer; override;
function GetTokenPos: Integer; override; function GetTokenPos: Integer; override;
procedure Next; override; procedure Next; override;
@ -406,7 +406,7 @@ begin
Result := fTokenId; Result := fTokenId;
end; end;
function TSynIniSyn.GetTokenAttribute: TSynHighlighterAttributes; function TSynIniSyn.GetTokenAttribute: TLazEditTextAttribute;
begin begin
case fTokenID of case fTokenID of
tkComment: Result := fCommentAttri; tkComment: Result := fCommentAttri;

View File

@ -50,7 +50,7 @@ interface
uses uses
SysUtils, Classes, SysUtils, Classes,
LCLIntf, LCLType, Graphics, LCLIntf, LCLType, Graphics,
SynEditTypes, SynEditHighlighter, SynEditStrConst; SynEditTypes, SynEditHighlighter, SynEditStrConst, LazEditTextAttributes;
type type
TtkTokenKind = (tkComment, tkDocument, tkIdentifier, tkInvalid, tkKey, TtkTokenKind = (tkComment, tkDocument, tkIdentifier, tkInvalid, tkKey,
@ -195,7 +195,7 @@ type
class function GetLanguageName: string; override; class function GetLanguageName: string; override;
public public
constructor Create(AOwner: TComponent); override; constructor Create(AOwner: TComponent); override;
function GetDefaultAttribute(Index: integer): TSynHighlighterAttributes; function GetDefaultAttribute(Index: integer): TSynHighlighterAttributes;
override; override;
function GetEol: Boolean; override; function GetEol: Boolean; override;
function GetRange: Pointer; override; function GetRange: Pointer; override;
@ -204,7 +204,7 @@ type
LineNumber:Integer); override; LineNumber:Integer); override;
function GetToken: String; override; function GetToken: String; override;
procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override; procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override;
function GetTokenAttribute: TSynHighlighterAttributes; override; function GetTokenAttribute: TLazEditTextAttribute; override;
function GetTokenKind: integer; override; function GetTokenKind: integer; override;
function GetTokenPos: Integer; override; function GetTokenPos: Integer; override;
procedure Next; override; procedure Next; override;
@ -1301,7 +1301,7 @@ begin
Result := Pointer(PtrInt(fRange)); Result := Pointer(PtrInt(fRange));
end; end;
procedure TSynJavaSyn.ReSetRange; procedure TSynJavaSyn.ResetRange;
begin begin
fRange := rsUnknown; fRange := rsUnknown;
end; end;
@ -1339,7 +1339,7 @@ begin
Result := xtkNonSymbol; Result := xtkNonSymbol;
end; end;
function TSynJavaSyn.GetTokenAttribute: TSynHighlighterAttributes; function TSynJavaSyn.GetTokenAttribute: TLazEditTextAttribute;
begin begin
case fTokenID of case fTokenID of
tkAnnotation: Result := fAnnotationAttri; tkAnnotation: Result := fAnnotationAttri;

View File

@ -55,7 +55,7 @@ uses
Graphics, Graphics,
SynEditTypes, SynEditTypes,
SynEditHighlighter, SynEditHighlighterFoldBase, SynEditHighlighter, SynEditHighlighterFoldBase,
SysUtils, Classes, SynEditStrConst; SysUtils, Classes, SynEditStrConst, LazEditTextAttributes;
type type
TtkTokenKind = (tkComment, tkIdentifier, tkKey, tkNull, tkNumber, tkSpace, TtkTokenKind = (tkComment, tkIdentifier, tkKey, tkNull, tkNumber, tkSpace,
@ -287,7 +287,7 @@ type
procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override; procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override;
procedure SetLine(const NewValue: String; LineNumber: Integer); override; procedure SetLine(const NewValue: String; LineNumber: Integer); override;
function GetToken: String; override; function GetToken: String; override;
function GetTokenAttribute: TSynHighlighterAttributes; override; function GetTokenAttribute: TLazEditTextAttribute; override;
function GetTokenKind: integer; override; function GetTokenKind: integer; override;
function GetTokenPos: Integer; override; function GetTokenPos: Integer; override;
procedure Next; override; procedure Next; override;
@ -1845,7 +1845,7 @@ begin
TokenStart:=FLine + fTokenPos; TokenStart:=FLine + fTokenPos;
end; end;
function TSynJScriptSyn.GetTokenAttribute: TSynHighlighterAttributes; function TSynJScriptSyn.GetTokenAttribute: TLazEditTextAttribute;
begin begin
case GetTokenID of case GetTokenID of
tkComment: Result := fCommentAttri; tkComment: Result := fCommentAttri;

View File

@ -49,8 +49,8 @@ unit SynHighlighterLFM;
interface interface
uses uses
SysUtils, Classes, FileUtil, Graphics, SysUtils, Classes, FileUtil, Graphics, SynEditTypes, SynEditHighlighter,
SynEditTypes, SynEditHighlighter, SynEditHighlighterFoldBase, SynEditStrConst; SynEditHighlighterFoldBase, SynEditStrConst, LazEditTextAttributes;
type type
TtkTokenKind = (tkComment, tkIdentifier, tkKey, tkNull, tkNumber, tkSpace, TtkTokenKind = (tkComment, tkIdentifier, tkKey, tkNull, tkNumber, tkSpace,
@ -140,7 +140,7 @@ type
LineNumber: Integer); override; LineNumber: Integer); override;
function GetToken: String; override; function GetToken: String; override;
procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override; procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override;
function GetTokenAttribute: TSynHighlighterAttributes; override; function GetTokenAttribute: TLazEditTextAttribute; override;
function GetTokenKind: integer; override; function GetTokenKind: integer; override;
function GetTokenPos: Integer; override; function GetTokenPos: Integer; override;
procedure Next; override; procedure Next; override;
@ -564,7 +564,7 @@ begin
TokenStart:=FLine + fTokenPos; TokenStart:=FLine + fTokenPos;
end; end;
function TSynLFMSyn.GetTokenAttribute: TSynHighlighterAttributes; function TSynLFMSyn.GetTokenAttribute: TLazEditTextAttribute;
begin begin
case fTokenID of case fTokenID of
tkComment: Result := fCommentAttri; tkComment: Result := fCommentAttri;

View File

@ -288,7 +288,7 @@ type
FCurLineIndex, FLineLen: Integer; FCurLineIndex, FLineLen: Integer;
FTokenPos: integer; FTokenPos: integer;
FTokenKind: integer; FTokenKind: integer;
FTokenAttr: TSynHighlighterAttributes; FTokenAttr: TLazEditTextAttribute;
FTokenAttrEx: TLazCustomEditTextAttribute; FTokenAttrEx: TLazCustomEditTextAttribute;
FRun: Integer; FRun: Integer;
FRunSectionInfo: Array of TRunSectionInfo; FRunSectionInfo: Array of TRunSectionInfo;
@ -296,7 +296,7 @@ type
function GetIdentChars: TSynIdentChars; override; function GetIdentChars: TSynIdentChars; override;
function GetDefaultAttribute(Index: integer): TSynHighlighterAttributes; override; function GetDefaultAttribute(Index: integer): TSynHighlighterAttributes; override;
function GetAttribCount: integer; override; function GetAttribCount: integer; override;
function GetAttribute(idx: integer): TSynHighlighterAttributes; override; function GetAttribute(idx: integer): TLazEditTextAttribute; override;
function GetSampleSource: string; override; function GetSampleSource: string; override;
procedure SetSampleSource(Value: string); override; procedure SetSampleSource(Value: string); override;
@ -322,7 +322,7 @@ type
function GetEol: Boolean; override; function GetEol: Boolean; override;
function GetToken: string; override; function GetToken: string; override;
procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override; procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override;
function GetTokenAttribute: TSynHighlighterAttributes; override; function GetTokenAttribute: TLazEditTextAttribute; override;
function GetTokenAttributeEx: TLazCustomEditTextAttribute; override; function GetTokenAttributeEx: TLazCustomEditTextAttribute; override;
function GetTokenKind: integer; override; function GetTokenKind: integer; override;
function GetTokenPos: Integer; override; // 0-based function GetTokenPos: Integer; override; // 0-based
@ -1267,8 +1267,7 @@ begin
Inc(Result, DefaultHighlighter.AttrCount); Inc(Result, DefaultHighlighter.AttrCount);
end; end;
function TSynMultiSyn.GetAttribute( function TSynMultiSyn.GetAttribute(idx: integer): TLazEditTextAttribute;
idx: integer): TSynHighlighterAttributes;
var var
i, j: Integer; i, j: Integer;
begin begin
@ -1353,7 +1352,7 @@ begin
end; end;
end; end;
function TSynMultiSyn.GetTokenAttribute: TSynHighlighterAttributes; function TSynMultiSyn.GetTokenAttribute: TLazEditTextAttribute;
begin begin
Result := FTokenAttr; Result := FTokenAttr;
end; end;

View File

@ -969,7 +969,7 @@ type
function GetRange: Pointer; override; function GetRange: Pointer; override;
function GetToken: string; override; function GetToken: string; override;
procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override; procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override;
function GetTokenAttribute: TSynHighlighterAttributes; override; function GetTokenAttribute: TLazEditTextAttribute; override;
function GetTokenAttributeEx: TLazCustomEditTextAttribute; override; function GetTokenAttributeEx: TLazCustomEditTextAttribute; override;
function GetTokenID: TtkTokenKind; function GetTokenID: TtkTokenKind;
function GetTokenKind: integer; override; function GetTokenKind: integer; override;
@ -5533,8 +5533,7 @@ begin
FIsInNextToEOL := True; FIsInNextToEOL := True;
end; end;
function TSynPasSyn.GetDefaultAttribute(Index: integer): function TSynPasSyn.GetDefaultAttribute(Index: integer): TSynHighlighterAttributes;
TSynHighlighterAttributes;
begin begin
case Index of case Index of
SYN_ATTR_COMMENT: Result := fCommentAttri; SYN_ATTR_COMMENT: Result := fCommentAttri;
@ -5581,7 +5580,7 @@ begin
end; end;
function TSynPasSyn.GetTokenAttribute: TSynHighlighterAttributes; function TSynPasSyn.GetTokenAttribute: TLazEditTextAttribute;
var var
x1, x2: Integer; x1, x2: Integer;
begin begin
@ -5621,7 +5620,7 @@ var
tid: TtkTokenKind; tid: TtkTokenKind;
i, x1, x2: Integer; i, x1, x2: Integer;
LeftCol, RightCol: TLazSynDisplayTokenBound; LeftCol, RightCol: TLazSynDisplayTokenBound;
attr: TSynHighlighterAttributesModifier; attr: TLazEditTextAttributeModifier;
procedure InitMergeRes(AMergeRes: TSynSelectedColorMergeResult; AnAttr: TLazCustomEditTextAttribute); procedure InitMergeRes(AMergeRes: TSynSelectedColorMergeResult; AnAttr: TLazCustomEditTextAttribute);
begin begin

View File

@ -54,7 +54,7 @@ uses
SysUtils, Classes, SysUtils, Classes,
LCLIntf, LCLType, LCLIntf, LCLType,
Controls, Graphics, Controls, Graphics,
SynEditTypes, SynEditHighlighter, SynEditStrConst; SynEditTypes, SynEditHighlighter, SynEditStrConst, LazEditTextAttributes;
type type
TtkTokenKind = (tkComment, tkIdentifier, tkKey, tkNull, tkNumber, tkOperator, TtkTokenKind = (tkComment, tkIdentifier, tkKey, tkNull, tkNumber, tkOperator,
@ -366,7 +366,7 @@ type
LineNumber:Integer); override; LineNumber:Integer); override;
function GetToken: String; override; function GetToken: String; override;
procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override; procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override;
function GetTokenAttribute: TSynHighlighterAttributes; override; function GetTokenAttribute: TLazEditTextAttribute; override;
function GetTokenKind: integer; override; function GetTokenKind: integer; override;
function GetTokenPos: Integer; override; function GetTokenPos: Integer; override;
procedure Next; override; procedure Next; override;
@ -2553,7 +2553,7 @@ begin
Result := fTokenId; Result := fTokenId;
end; end;
function TSynPerlSyn.GetTokenAttribute: TSynHighlighterAttributes; function TSynPerlSyn.GetTokenAttribute: TLazEditTextAttribute;
begin begin
case fTokenID of case fTokenID of
tkComment: Result := fCommentAttri; tkComment: Result := fCommentAttri;

View File

@ -52,7 +52,7 @@ uses
SysUtils, Classes, SysUtils, Classes,
LCLIntf, LCLType, LCLIntf, LCLType,
Controls, Graphics, Controls, Graphics,
SynEditTypes, SynEditHighlighter, SynEditStrConst; SynEditTypes, SynEditHighlighter, SynEditStrConst, LazEditTextAttributes;
type type
TtkTokenKind = (tkComment, tkIdentifier, tkInvalidSymbol, tkKey, tkNull, TtkTokenKind = (tkComment, tkIdentifier, tkInvalidSymbol, tkKey, tkNull,
@ -195,7 +195,7 @@ type
function GetToken: String; override; function GetToken: String; override;
procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override; procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override;
function GetTokenAttribute: TSynHighlighterAttributes; override; function GetTokenAttribute: TLazEditTextAttribute; override;
function GetTokenKind: integer; override; function GetTokenKind: integer; override;
function GetTokenPos: Integer; override; function GetTokenPos: Integer; override;
procedure Next; override; procedure Next; override;
@ -1355,7 +1355,7 @@ begin
Result := fTokenId; Result := fTokenId;
end; end;
function TSynPHPSyn.GetTokenAttribute: TSynHighlighterAttributes; function TSynPHPSyn.GetTokenAttribute: TLazEditTextAttribute;
begin begin
case GetTokenID of case GetTokenID of
tkComment: Result := fCommentAttri; tkComment: Result := fCommentAttri;

View File

@ -35,7 +35,7 @@ interface
uses uses
Classes, SysUtils, Classes, SysUtils,
Graphics, Graphics,
SynEditTypes, SynEditHighlighter, SynEditStrConst; SynEditTypes, SynEditHighlighter, SynEditStrConst, LazEditTextAttributes;
type type
TtkTokenKind = (tkComment, tkText, tkKey, tkNull, tkSpace, tkString, TtkTokenKind = (tkComment, tkText, tkKey, tkNull, tkSpace, tkString,
@ -89,7 +89,7 @@ type
procedure SetLine(const NewValue: String; LineNumber:Integer); override; procedure SetLine(const NewValue: String; LineNumber:Integer); override;
function GetToken: String; override; function GetToken: String; override;
procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override; procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override;
function GetTokenAttribute: TSynHighlighterAttributes; override; function GetTokenAttribute: TLazEditTextAttribute; override;
function GetTokenKind: integer; override; function GetTokenKind: integer; override;
function GetTokenPos: Integer; override; function GetTokenPos: Integer; override;
procedure Next; override; procedure Next; override;
@ -339,7 +339,7 @@ begin
Result := fTokenId; Result := fTokenId;
end; end;
function TSynPoSyn.GetTokenAttribute: TSynHighlighterAttributes; function TSynPoSyn.GetTokenAttribute: TLazEditTextAttribute;
begin begin
case fTokenID of case fTokenID of
tkComment: Result := fCommentAttri; tkComment: Result := fCommentAttri;

View File

@ -30,7 +30,7 @@ interface
uses uses
Classes, SysUtils, Graphics, SynEditStrConst, SynEditTypes, Classes, SysUtils, Graphics, SynEditStrConst, SynEditTypes,
SynEditHighlighter; SynEditHighlighter, LazEditTextAttributes;
const const
tkNone = 0; tkNone = 0;
@ -84,7 +84,7 @@ type
function GetRange: Pointer; override; function GetRange: Pointer; override;
function GetToken: string; override; function GetToken: string; override;
procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override; procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override;
function GetTokenAttribute: TSynHighlighterAttributes; override; function GetTokenAttribute: TLazEditTextAttribute; override;
function GetTokenKind: integer; override; function GetTokenKind: integer; override;
function GetTokenPos: Integer; override; function GetTokenPos: Integer; override;
procedure Next; override; procedure Next; override;
@ -109,8 +109,8 @@ type
); );
function CreateTokenID(const aName: string; Foreground, BackGround: TColor; function CreateTokenID(const aName: string; Foreground, BackGround: TColor;
Style: TFontStyles): TtkTokenKind; Style: TFontStyles): TtkTokenKind;
function GetCopiedTokenID(Attr: TSynHighlighterAttributes): TtkTokenKind; function GetCopiedTokenID(Attr: TLazEditTextAttribute): TtkTokenKind;
function GetCopiedAttribute(TokenID: TtkTokenKind): TSynHighlighterAttributes; function GetCopiedAttribute(TokenID: TtkTokenKind): TLazEditTextAttribute;
property Tokens[TheLineNumber: integer]: PPositionTokens read GetTokens; property Tokens[TheLineNumber: integer]: PPositionTokens read GetTokens;
published published
property TextAttri: TSynHighlighterAttributes read fTextAttri write fTextAttri; property TextAttri: TSynHighlighterAttributes read fTextAttri write fTextAttri;
@ -203,7 +203,7 @@ begin
end; end;
end; end;
function TSynPositionHighlighter.GetTokenAttribute: TSynHighlighterAttributes; function TSynPositionHighlighter.GetTokenAttribute: TLazEditTextAttribute;
var var
t: TtkTokenKind; t: TtkTokenKind;
begin begin
@ -368,7 +368,7 @@ var
RelLine: integer; RelLine: integer;
nTokenLen: integer; nTokenLen: integer;
sToken: PChar; sToken: PChar;
Attr: TSynHighlighterAttributes; Attr: TLazEditTextAttribute;
TokenID: integer; TokenID: integer;
begin begin
if (Lines=nil) or (Lines.Count=0) or (Highlighter=nil) then exit; if (Lines=nil) or (Lines.Count=0) or (Highlighter=nil) then exit;
@ -395,9 +395,9 @@ function TSynPositionHighlighter.CreateTokenID(const aName: string;
Foreground, BackGround: TColor; Foreground, BackGround: TColor;
Style: TFontStyles): TtkTokenKind; Style: TFontStyles): TtkTokenKind;
var var
Attr: TSynHighlighterAttributes; Attr: TLazEditTextAttribute;
begin begin
Attr:=TSynHighlighterAttributes.Create(aName); Attr:=TLazEditTextAttribute.Create(aName);
Attr.Foreground:=Foreground; Attr.Foreground:=Foreground;
Attr.Background:=BackGround; Attr.Background:=BackGround;
Attr.Style:=Style; Attr.Style:=Style;
@ -405,15 +405,14 @@ begin
Attr.Free; Attr.Free;
end; end;
function TSynPositionHighlighter.GetCopiedTokenID( function TSynPositionHighlighter.GetCopiedTokenID(Attr: TLazEditTextAttribute): TtkTokenKind;
Attr: TSynHighlighterAttributes): TtkTokenKind;
var var
i: Integer; i: Integer;
CurAttr: TSynHighlighterAttributes; CurAttr: TLazEditTextAttribute;
begin begin
i:=fCopiedAttributes.Count-1; i:=fCopiedAttributes.Count-1;
while i>=0 do begin while i>=0 do begin
CurAttr:=TSynHighlighterAttributes(fCopiedAttributes[i]); CurAttr:=TLazEditTextAttribute(fCopiedAttributes[i]);
if (Attr.ForeGround=CurAttr.ForeGround) if (Attr.ForeGround=CurAttr.ForeGround)
and (Attr.BackGround=CurAttr.BackGround) and (Attr.BackGround=CurAttr.BackGround)
and (Attr.Style=CurAttr.Style) then begin and (Attr.Style=CurAttr.Style) then begin
@ -424,17 +423,16 @@ begin
dec(i); dec(i);
end; end;
// create new attribute // create new attribute
CurAttr:=TSynHighlighterAttributes.Create(nil); CurAttr:=TLazEditTextAttribute.Create(nil);
CurAttr.Assign(Attr); CurAttr.Assign(Attr);
fCopiedAttributes.Add(CurAttr); fCopiedAttributes.Add(CurAttr);
Result:= -fCopiedAttributes.Count; Result:= -fCopiedAttributes.Count;
end; end;
function TSynPositionHighlighter.GetCopiedAttribute(TokenID: TtkTokenKind function TSynPositionHighlighter.GetCopiedAttribute(TokenID: TtkTokenKind): TLazEditTextAttribute;
): TSynHighlighterAttributes;
begin begin
if (TokenID<0) and (fCopiedAttributes.Count>=-TokenID) then if (TokenID<0) and (fCopiedAttributes.Count>=-TokenID) then
Result:=TSynHighlighterAttributes(fCopiedAttributes[-TokenID-1]) Result:=TLazEditTextAttribute(fCopiedAttributes[-TokenID-1])
else else
Result:=nil; Result:=nil;
end; end;

View File

@ -51,7 +51,7 @@ interface
uses uses
IniFiles, //THashedStringList IniFiles, //THashedStringList
LCLIntf, LCLType, LCLIntf, LCLType,
SynEditHighlighter, SynEditTypes, SynEditStrConst, SynEditHighlighter, SynEditTypes, SynEditStrConst, LazEditTextAttributes,
Graphics, SysUtils, Classes; Graphics, SysUtils, Classes;
const const
@ -139,7 +139,7 @@ type
LineNumber: Integer); override; LineNumber: Integer); override;
function GetKeywordIdentifiers: TStringList; virtual; function GetKeywordIdentifiers: TStringList; virtual;
function GetToken: string; override; function GetToken: string; override;
function GetTokenAttribute: TSynHighlighterAttributes; override; function GetTokenAttribute: TLazEditTextAttribute; override;
function GetTokenKind: integer; override; function GetTokenKind: integer; override;
function GetTokenPos: Integer; override; function GetTokenPos: Integer; override;
procedure Next; override; procedure Next; override;
@ -1177,7 +1177,7 @@ begin
Result := fTokenId; Result := fTokenId;
end; end;
function TSynPythonSyn.GetTokenAttribute: TSynHighlighterAttributes; function TSynPythonSyn.GetTokenAttribute: TLazEditTextAttribute;
begin begin
case fTokenID of case fTokenID of
tkComment: Result := fCommentAttri; tkComment: Result := fCommentAttri;

View File

@ -56,7 +56,7 @@ uses
LCLIntf, LCLType, LCLIntf, LCLType,
Controls, Graphics, Controls, Graphics,
SynEditTypes, SynEditHighlighter, SynEditStrConst, SynEditTypes, SynEditHighlighter, SynEditStrConst,
SynHighlighterHashEntries; SynHighlighterHashEntries, LazEditTextAttributes;
type type
TtkTokenKind = (tkComment, tkDatatype, tkDefaultPackage, tkException, // DJLP 2000-08-11 TtkTokenKind = (tkComment, tkDatatype, tkDefaultPackage, tkException, // DJLP 2000-08-11
@ -157,7 +157,7 @@ type
function GetToken: string; override; function GetToken: string; override;
procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override; procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override;
function GetTokenAttribute: TSynHighlighterAttributes; override; function GetTokenAttribute: TLazEditTextAttribute; override;
function GetTokenID: TtkTokenKind; function GetTokenID: TtkTokenKind;
function GetTokenKind: integer; override; function GetTokenKind: integer; override;
function GetTokenPos: Integer; override; function GetTokenPos: Integer; override;
@ -1872,7 +1872,7 @@ begin
Result := fTokenId; Result := fTokenId;
end; end;
function TSynSQLSyn.GetTokenAttribute: TSynHighlighterAttributes; function TSynSQLSyn.GetTokenAttribute: TLazEditTextAttribute;
begin begin
case GetTokenID of case GetTokenID of
tkComment: Result := fCommentAttri; tkComment: Result := fCommentAttri;

View File

@ -44,7 +44,7 @@ uses
SysUtils, Classes, SysUtils, Classes,
LCLIntf, LCLType, LazUTF8, LCLIntf, LCLType, LazUTF8,
Controls, Graphics, Controls, Graphics,
SynEditTypes, SynEditHighlighter, SynEditStrConst; SynEditTypes, SynEditHighlighter, SynEditStrConst, LazEditTextAttributes;
type type
TtkTokenKind = (tkBrace, tkBracket, tkNull, tkSpace, tkText, tkComment, TtkTokenKind = (tkBrace, tkBracket, tkNull, tkSpace, tkText, tkComment,
@ -103,7 +103,7 @@ type
function GetToken: String; override; function GetToken: String; override;
procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override; procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override;
function GetTokenAttribute: TSynHighlighterAttributes; override; function GetTokenAttribute: TLazEditTextAttribute; override;
function GetTokenKind: integer; override; function GetTokenKind: integer; override;
function GetTokenPos: Integer; override; function GetTokenPos: Integer; override;
procedure Next; override; procedure Next; override;
@ -259,7 +259,7 @@ begin
Exit; Exit;
end; { CommentProc } end; { CommentProc }
procedure TSynTeXSyn.MathModeProc; procedure TSynTeXSyn.MathmodeProc;
begin begin
fTokenID:=tkMathMode; fTokenID:=tkMathMode;
Inc(Run); Inc(Run);
@ -326,7 +326,7 @@ begin
Result := fTokenId; Result := fTokenId;
end; { GetTokenID } end; { GetTokenID }
function TSynTeXSyn.GetTokenAttribute: TSynHighlighterAttributes; function TSynTeXSyn.GetTokenAttribute: TLazEditTextAttribute;
begin begin
case fTokenID of case fTokenID of
tkComment : Result := fCommentAttri; tkComment : Result := fCommentAttri;

View File

@ -60,7 +60,7 @@ uses
SynEditHighlighter, SynEditHighlighter,
SysUtils, SysUtils,
Classes, Classes,
SynEditStrConst; SynEditStrConst, LazEditTextAttributes;
type type
TtkTokenKind = (tkComment, tkIdentifier, tkKey, tkNull, tkNumber, tkSecondKey, TtkTokenKind = (tkComment, tkIdentifier, tkKey, tkNull, tkNumber, tkSecondKey,
@ -137,7 +137,7 @@ type
function IsSecondKeyWord(aToken: string): Boolean; function IsSecondKeyWord(aToken: string): Boolean;
function GetToken: string; override; function GetToken: string; override;
procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override; /////TL: Added 2003-06-11 procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override; /////TL: Added 2003-06-11
function GetTokenAttribute: TSynHighlighterAttributes; override; function GetTokenAttribute: TLazEditTextAttribute; override;
function GetTokenKind: integer; override; function GetTokenKind: integer; override;
function GetTokenPos: Integer; override; function GetTokenPos: Integer; override;
procedure Next; override; procedure Next; override;
@ -753,7 +753,7 @@ begin
Result := fTokenId; Result := fTokenId;
end; end;
function TSynUNIXShellScriptSyn.GetTokenAttribute: TSynHighlighterAttributes; function TSynUNIXShellScriptSyn.GetTokenAttribute: TLazEditTextAttribute;
begin begin
case fTokenID of case fTokenID of
tkComment: Result := fCommentAttri; tkComment: Result := fCommentAttri;

View File

@ -52,7 +52,7 @@ uses
SysUtils, Classes, SysUtils, Classes,
LCLIntf, LCLType, LCLIntf, LCLType,
Controls, Graphics, Controls, Graphics,
SynEditTypes, SynEditHighlighter, SynEditStrConst; SynEditTypes, SynEditHighlighter, SynEditStrConst, LazEditTextAttributes;
type type
TtkTokenKind = (tkComment, tkIdentifier, tkKey, tkNull, tkNumber, tkSpace, TtkTokenKind = (tkComment, tkIdentifier, tkKey, tkNull, tkNumber, tkSpace,
@ -204,7 +204,7 @@ type
procedure SetLine(const NewValue: String; LineNumber: Integer); override; procedure SetLine(const NewValue: String; LineNumber: Integer); override;
function GetToken: String; override; function GetToken: String; override;
procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override; procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override;
function GetTokenAttribute: TSynHighlighterAttributes; override; function GetTokenAttribute: TLazEditTextAttribute; override;
function GetTokenKind: integer; override; function GetTokenKind: integer; override;
function GetTokenPos: Integer; override; function GetTokenPos: Integer; override;
procedure Next; override; procedure Next; override;
@ -1207,7 +1207,7 @@ begin
Result := fTokenId; Result := fTokenId;
end; end;
function TSynVBSyn.GetTokenAttribute: TSynHighlighterAttributes; function TSynVBSyn.GetTokenAttribute: TLazEditTextAttribute;
begin begin
case GetTokenID of case GetTokenID of
tkComment: Result := fCommentAttri; tkComment: Result := fCommentAttri;

View File

@ -213,7 +213,7 @@ type
procedure SetLine(const NewValue: string; LineNumber:Integer); override; procedure SetLine(const NewValue: string; LineNumber:Integer); override;
function GetToken: string; override; function GetToken: string; override;
procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override; procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override;
function GetTokenAttribute: TSynHighlighterAttributes; override; function GetTokenAttribute: TLazEditTextAttribute; override;
function GetTokenAttributeEx: TLazCustomEditTextAttribute; override; function GetTokenAttributeEx: TLazCustomEditTextAttribute; override;
function GetTokenKind: integer; override; function GetTokenKind: integer; override;
function GetTokenPos: Integer; override; function GetTokenPos: Integer; override;
@ -973,7 +973,7 @@ begin
Result := fTokenId; Result := fTokenId;
end; end;
function TSynXMLSyn.GetTokenAttribute: TSynHighlighterAttributes; function TSynXMLSyn.GetTokenAttribute: TLazEditTextAttribute;
begin begin
case fTokenID of case fTokenID of
tkElement: Result:= fElementAttri; tkElement: Result:= fElementAttri;

View File

@ -11,7 +11,7 @@ uses
LazFileUtils, LazFileUtils,
Laz2_XMLRead, Laz2_DOM, LazStringUtils, Laz2_XMLRead, Laz2_DOM, LazStringUtils,
// LazEdit // LazEdit
TextMateGrammar, TextMateGrammar, LazEditTextAttributes,
// SynEdit // SynEdit
SynEditHighlighter, SynEditHighlighterFoldBase, SynEditTypes, SynEditTextBase; SynEditHighlighter, SynEditHighlighterFoldBase, SynEditTypes, SynEditTextBase;
@ -60,7 +60,7 @@ type
FRangeInfo: TSynTextMateRangeInfo; FRangeInfo: TSynTextMateRangeInfo;
FCurrentTokenPos, FCurrentTokenLen: Integer; FCurrentTokenPos, FCurrentTokenLen: Integer;
FCurrentTokenKind: integer; FCurrentTokenKind: integer;
FCurrentAttrib: TSynHighlighterAttributes; FCurrentAttrib: TLazEditTextAttribute;
function GetParserError: String; function GetParserError: String;
protected protected
@ -82,7 +82,7 @@ type
procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override; procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override;
function GetTokenPos: Integer; override; function GetTokenPos: Integer; override;
function GetTokenKind: integer; override; function GetTokenKind: integer; override;
function GetTokenAttribute: TSynHighlighterAttributes; override; function GetTokenAttribute: TLazEditTextAttribute; override;
// //
function GetDefaultAttribute(Index: integer): TSynHighlighterAttributes; override; function GetDefaultAttribute(Index: integer): TSynHighlighterAttributes; override;
@ -214,7 +214,7 @@ procedure TSynTextMateSyn.DoCheckAttributeInfo(Sender: TTextMatePattern;
begin begin
AnUseId := AnAttribInfo.TokId >= 0; AnUseId := AnAttribInfo.TokId >= 0;
AnUseObject := (AnAttribInfo.TokObject <> nil) and AnUseObject := (AnAttribInfo.TokObject <> nil) and
(TSynHighlighterAttributes(AnAttribInfo.TokObject).IsEnabled); (TLazEditTextAttribute(AnAttribInfo.TokObject).IsEnabled);
end; end;
function TSynTextMateSyn.GetParserError: String; function TSynTextMateSyn.GetParserError: String;
@ -306,7 +306,7 @@ begin
else begin else begin
FTextMateGrammar.First; FTextMateGrammar.First;
FCurrentTokenKind := FTextMateGrammar.CurrentTokenKind; FCurrentTokenKind := FTextMateGrammar.CurrentTokenKind;
FCurrentAttrib := TSynHighlighterAttributes(FTextMateGrammar.CurrentAttrib); FCurrentAttrib := TLazEditTextAttribute(FTextMateGrammar.CurrentAttrib);
FCurrentTokenPos := FTextMateGrammar.CurrentTokenPos; FCurrentTokenPos := FTextMateGrammar.CurrentTokenPos;
FCurrentTokenLen := FTextMateGrammar.CurrentTokenLen; FCurrentTokenLen := FTextMateGrammar.CurrentTokenLen;
end; end;
@ -318,7 +318,7 @@ procedure TSynTextMateSyn.Next;
begin begin
FTextMateGrammar.Next; FTextMateGrammar.Next;
FCurrentTokenKind := FTextMateGrammar.CurrentTokenKind; FCurrentTokenKind := FTextMateGrammar.CurrentTokenKind;
FCurrentAttrib := TSynHighlighterAttributes(FTextMateGrammar.CurrentAttrib); FCurrentAttrib := TLazEditTextAttribute(FTextMateGrammar.CurrentAttrib);
FCurrentTokenPos := FTextMateGrammar.CurrentTokenPos; FCurrentTokenPos := FTextMateGrammar.CurrentTokenPos;
FCurrentTokenLen := FTextMateGrammar.CurrentTokenLen; FCurrentTokenLen := FTextMateGrammar.CurrentTokenLen;
//FCurrentRange := FTextMateGrammar.CurrentPatternIndex; //FCurrentRange := FTextMateGrammar.CurrentPatternIndex;
@ -401,13 +401,12 @@ begin
Result := FCurrentTokenKind; Result := FCurrentTokenKind;
end; end;
function TSynTextMateSyn.GetTokenAttribute: TSynHighlighterAttributes; function TSynTextMateSyn.GetTokenAttribute: TLazEditTextAttribute;
begin begin
Result := FCurrentAttrib; Result := FCurrentAttrib;
end; end;
function TSynTextMateSyn.GetDefaultAttribute(Index: integer function TSynTextMateSyn.GetDefaultAttribute(Index: integer): TSynHighlighterAttributes;
): TSynHighlighterAttributes;
begin begin
Result := FAttriMap.Data[FTextMateGrammar.RootPattern.AttribInfo.TokId]; Result := FAttriMap.Data[FTextMateGrammar.RootPattern.AttribInfo.TokId];
end; end;

View File

@ -25,13 +25,13 @@ type
TExpTokenInfo = record TExpTokenInfo = record
ExpKind: Integer; ExpKind: Integer;
ExpAttr: TSynHighlighterAttributes; ExpAttr: TLazEditTextAttribute;
Flags: set of (etiKind, etiAttr); Flags: set of (etiKind, etiAttr);
end; end;
operator := (a: Integer) : TExpTokenInfo; operator := (a: Integer) : TExpTokenInfo;
operator := (a: TSynHighlighterAttributes) : TExpTokenInfo; operator := (a: TLazEditTextAttribute) : TExpTokenInfo;
operator + (a: Integer; b: TSynHighlighterAttributes) : TExpTokenInfo; operator + (a: Integer; b: TLazEditTextAttribute) : TExpTokenInfo;
type type
@ -68,14 +68,14 @@ begin
result.Flags := [etiKind]; result.Flags := [etiKind];
end; end;
operator := (a: TSynHighlighterAttributes) : TExpTokenInfo; operator := (a: TLazEditTextAttribute) : TExpTokenInfo;
begin begin
result := default(TExpTokenInfo); result := default(TExpTokenInfo);
result.ExpAttr := a; result.ExpAttr := a;
result.Flags := [etiAttr]; result.Flags := [etiAttr];
end; end;
operator + (a: Integer; b: TSynHighlighterAttributes) : TExpTokenInfo; operator + (a: Integer; b: TLazEditTextAttribute) : TExpTokenInfo;
begin begin
result := default(TExpTokenInfo); result := default(TExpTokenInfo);
result.ExpKind := a; result.ExpKind := a;
@ -103,9 +103,9 @@ begin
//DebugLn(['# ', i, ' ', FTheHighLighter.Attribute[i].StoredName]); //DebugLn(['# ', i, ' ', FTheHighLighter.Attribute[i].StoredName]);
FTheHighLighter.Attribute[i].Foreground := 10000 + i; // unique foreground colors FTheHighLighter.Attribute[i].Foreground := 10000 + i; // unique foreground colors
FTheHighLighter.Attribute[i].Foreground := 10000 + i; // unique foreground colors FTheHighLighter.Attribute[i].Foreground := 10000 + i; // unique foreground colors
if FTheHighLighter.Attribute[i] is TSynHighlighterAttributesModifier then begin if FTheHighLighter.Attribute[i] is TLazEditTextAttributeModifier then begin
TSynHighlighterAttributesModifier(FTheHighLighter.Attribute[i]).ForeAlpha := 0; TLazEditTextAttributeModifier(FTheHighLighter.Attribute[i]).ForeAlpha := 0;
TSynHighlighterAttributesModifier(FTheHighLighter.Attribute[i]).ForePriority := 100+i; TLazEditTextAttributeModifier(FTheHighLighter.Attribute[i]).ForePriority := 100+i;
end; end;
end; end;
end; end;

View File

@ -18,8 +18,8 @@ type
FMultiHl: TSynMultiSyn; FMultiHl: TSynMultiSyn;
FXmlHl: TSynXMLSyn; FXmlHl: TSynXMLSyn;
{FEmptyScheme, }FPasScheme: TSynHighlighterMultiScheme; {FEmptyScheme, }FPasScheme: TSynHighlighterMultiScheme;
FAtXmlEl, FAtXmlSym, FAtXmlTxt: TSynHighlighterAttributes; FAtXmlEl, FAtXmlSym, FAtXmlTxt: TLazEditTextAttribute;
FAtPasMark, FAtPasSym, FAtPasId, FAtPasKey, {FAtPasSp, }FAtPasCom: TSynHighlighterAttributes; FAtPasMark, FAtPasSym, FAtPasId, FAtPasKey, {FAtPasSp, }FAtPasCom: TLazEditTextAttribute;
FPasHl: TSynPasSyn; FPasHl: TSynPasSyn;
procedure InitMultiEMpty; procedure InitMultiEMpty;
@ -42,7 +42,7 @@ type
procedure DumpRanges(ARangeList: TSynHighlighterRangeList); procedure DumpRanges(ARangeList: TSynHighlighterRangeList);
procedure DumpAll(Hl: TSynMultiSyn); procedure DumpAll(Hl: TSynMultiSyn);
procedure CheckTokensForLine(Name: String; HL: TSynCustomHighlighter; procedure CheckTokensForLine(Name: String; HL: TSynCustomHighlighter;
LineIdx: Integer; ExpAttr: Array of TSynHighlighterAttributes); LineIdx: Integer; ExpAttr: Array of TLazEditTextAttribute);
published published
procedure TestSectionList; procedure TestSectionList;
procedure TestVirtualLines; procedure TestVirtualLines;
@ -261,7 +261,7 @@ begin // ensure CurrentLines are set
end; end;
procedure TTestHighlightMulti.CheckTokensForLine(Name: String; HL: TSynCustomHighlighter; procedure TTestHighlightMulti.CheckTokensForLine(Name: String; HL: TSynCustomHighlighter;
LineIdx: Integer; ExpAttr: array of TSynHighlighterAttributes); LineIdx: Integer; ExpAttr: array of TLazEditTextAttribute);
var var
c: Integer; c: Integer;
tk: TLazCustomEditTextAttribute; tk: TLazCustomEditTextAttribute;
@ -276,8 +276,8 @@ begin
end; end;
//DebugLn([HL.GetToken,' (',HL.GetTokenID ,') at ', HL.GetTokenPos]); //DebugLn([HL.GetToken,' (',HL.GetTokenID ,') at ', HL.GetTokenPos]);
tk := HL.GetTokenAttributeEx; tk := HL.GetTokenAttributeEx;
if (tk <> nil) and (tk is TSynHighlighterAttributes) if (tk <> nil) and (tk is TLazEditTextAttribute)
then tkName := TSynHighlighterAttributes(tk).StoredName then tkName := TLazEditTextAttribute(tk).StoredName
else tkName := '<nil>'; else tkName := '<nil>';
AssertTrue(Format('%s Attrib Line=%d pos=%d exp=%s got=%s', AssertTrue(Format('%s Attrib Line=%d pos=%d exp=%s got=%s',
[Name, LineIdx, c, ExpAttr[c].StoredName, tkName]), [Name, LineIdx, c, ExpAttr[c].StoredName, tkName]),

View File

@ -7,7 +7,7 @@ interface
uses uses
Classes, SysUtils, testregistry, TestBase, Forms, LazLoggerBase, Classes, SysUtils, testregistry, TestBase, Forms, LazLoggerBase,
TestHighlightFoldBase, SynEdit, SynEditTypes, SynHighlighterPas, TestHighlightFoldBase, SynEdit, SynEditTypes, SynHighlighterPas,
SynEditHighlighterFoldBase, SynEditHighlighter; SynEditHighlighterFoldBase, SynEditHighlighter, LazEditTextAttributes;
type type
@ -110,7 +110,7 @@ begin
result.Flags := [etiKind]; result.Flags := [etiKind];
end; end;
operator + (a: TtkTokenKind; b: TSynHighlighterAttributes) : TExpTokenInfo; operator + (a: TtkTokenKind; b: TLazEditTextAttribute) : TExpTokenInfo;
begin begin
result := default(TExpTokenInfo); result := default(TExpTokenInfo);
result.ExpKind := ord(a); result.ExpKind := ord(a);
@ -1608,7 +1608,7 @@ end;
procedure TTestHighlighterPas.TestContextForProcedure; procedure TTestHighlighterPas.TestContextForProcedure;
var var
AtP, AtI, AtK: TSynHighlighterAttributes; AtP, AtI, AtK: TLazEditTextAttribute;
var var
AFolds: TPascalCodeFoldBlockTypes; AFolds: TPascalCodeFoldBlockTypes;
i: Integer; i: Integer;

View File

@ -23,7 +23,7 @@ implementation
procedure TTestPaintColorMerging.MergeAttrib; procedure TTestPaintColorMerging.MergeAttrib;
procedure SetAttrib(AnAttrib: TSynHighlighterAttributes; procedure SetAttrib(AnAttrib: TLazEditTextAttribute;
AFore, ABack, AFrame: TColor; AFore, ABack, AFrame: TColor;
AStyle: TFontStyles = []; AStyleMask: TFontStyles = []; AStyle: TFontStyles = []; AStyleMask: TFontStyles = [];
AFrameSides: TSynFrameEdges = sfeAround; AFrameStyle: TSynLineStyle = slsSolid; AFrameSides: TSynFrameEdges = sfeAround; AFrameStyle: TSynLineStyle = slsSolid;
@ -33,12 +33,12 @@ procedure TTestPaintColorMerging.MergeAttrib;
AnAttrib.Background := ABack; AnAttrib.Background := ABack;
AnAttrib.FrameColor := AFrame; AnAttrib.FrameColor := AFrame;
AnAttrib.Style := AStyle; AnAttrib.Style := AStyle;
if AnAttrib is TSynHighlighterAttributesModifier then if AnAttrib is TLazEditTextAttributeModifier then
AnAttrib.StyleMask := AStyleMask; AnAttrib.StyleMask := AStyleMask;
AnAttrib.FrameEdges := AFrameSides; AnAttrib.FrameEdges := AFrameSides;
AnAttrib.FrameStyle := AFrameStyle; AnAttrib.FrameStyle := AFrameStyle;
if AnAttrib is TSynSelectedColor then begin if AnAttrib is TLazEditTextAttribute then begin
TSynSelectedColor(AnAttrib).SetFrameBoundsPhys(AStartX, AEndX); TLazEditTextAttribute(AnAttrib).SetFrameBoundsPhys(AStartX, AEndX);
end; end;
end; end;

View File

@ -111,7 +111,7 @@ type
////TL replaced out prefix procedure CreatePanel(out comp: TPanel; Parent: TWinControl; left, top, width, height: integer); ////TL replaced out prefix procedure CreatePanel(out comp: TPanel; Parent: TWinControl; left, top, width, height: integer);
procedure CreatePanel(var comp: TPanel; Parent: TWinControl; left, top, width, height: integer); procedure CreatePanel(var comp: TPanel; Parent: TWinControl; left, top, width, height: integer);
function GetNodeType(Node: TTreeNode): TNodeType; function GetNodeType(Node: TTreeNode): TNodeType;
procedure SetDefaultAttributes(Attr: TSynHighlighterAttributes); procedure SetDefaultAttributes(Attr: TLazEditTextAttribute);
procedure SetDefaultRangeAttr(R: TSynRange); procedure SetDefaultRangeAttr(R: TSynRange);
procedure DoAddKeyword(Sender: TObject); procedure DoAddKeyword(Sender: TObject);
procedure AddingKeyWord(Node: TTreeNode); procedure AddingKeyWord(Node: TTreeNode);
@ -937,7 +937,7 @@ begin
memo.Lines.Add(SampleMemo.SelText); memo.Lines.Add(SampleMemo.SelText);
end; end;
Procedure TSynUniDesigner.SetDefaultAttributes(Attr:TSynHighlighterAttributes); Procedure TSynUniDesigner.SetDefaultAttributes(Attr:TLazEditTextAttribute);
begin begin
Attr.Background:=clWhite; Attr.Background:=clWhite;
Attr.Foreground:=clBlack; Attr.Foreground:=clBlack;

View File

@ -328,7 +328,7 @@ type
public public
constructor Create(AOwner: TComponent); override; constructor Create(AOwner: TComponent); override;
destructor Destroy; override; destructor Destroy; override;
function GetDefaultAttribute(Index: integer): TSynHighlighterAttributes; function GetDefaultAttribute(Index: integer): TLazEditTextAttribute;
override; override;
function GetEOL: Boolean; override; function GetEOL: Boolean; override;
function GetRange: Pointer; override; function GetRange: Pointer; override;
@ -336,7 +336,7 @@ type
////TL Added the following 3 lines... and the implementation procedure ////TL Added the following 3 lines... and the implementation procedure
procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override; ////TL: Added 2003-06-11 procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override; ////TL: Added 2003-06-11
function GetTokenAttribute: TSynHighlighterAttributes; override; function GetTokenAttribute: TLazEditTextAttribute; override;
function GetTokenID: Integer; function GetTokenID: Integer;
function GetTokenKind: integer; override; function GetTokenKind: integer; override;
function GetTokenPos: Integer; override; function GetTokenPos: Integer; override;
@ -1718,7 +1718,7 @@ begin
Result :=1;// CODE_REVIEW fCurrToken.ID; Result :=1;// CODE_REVIEW fCurrToken.ID;
end; end;
function TSynUniSyn.GetTokenAttribute: TSynHighlighterAttributes; function TSynUniSyn.GetTokenAttribute: TLazEditTextAttribute;
begin begin
Result:=fCurrToken.Attr; Result:=fCurrToken.Attr;
end; end;

View File

@ -30,7 +30,7 @@ type
FCurRange: Integer; FCurRange: Integer;
public public
procedure Next; override; procedure Next; override;
function GetTokenAttribute: TSynHighlighterAttributes; override; function GetTokenAttribute: TLazEditTextAttribute; override;
public public
procedure SetRange(Value: Pointer); override; procedure SetRange(Value: Pointer); override;
procedure ResetRange; override; procedure ResetRange; override;
@ -51,7 +51,7 @@ begin
dec(FCurRange); dec(FCurRange);
end; end;
function TSynDemoHlContext.GetTokenAttribute: TSynHighlighterAttributes; function TSynDemoHlContext.GetTokenAttribute: TLazEditTextAttribute;
begin begin
Result := inherited GetTokenAttribute; Result := inherited GetTokenAttribute;
if (Result = SpecialAttri) and (FCurRange > 0) then if (Result = SpecialAttri) and (FCurRange > 0) then

View File

@ -47,7 +47,7 @@ type
procedure Next; override; procedure Next; override;
function GetEol: Boolean; override; function GetEol: Boolean; override;
procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override; procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override;
function GetTokenAttribute: TSynHighlighterAttributes; override; function GetTokenAttribute: TLazEditTextAttribute; override;
public public
function GetToken: String; override; function GetToken: String; override;
function GetTokenPos: Integer; override; function GetTokenPos: Integer; override;
@ -78,7 +78,7 @@ type
FCurRange: Integer; FCurRange: Integer;
public public
procedure Next; override; procedure Next; override;
function GetTokenAttribute: TSynHighlighterAttributes; override; function GetTokenAttribute: TLazEditTextAttribute; override;
public public
(* The below needed to be changed and are in TSynDemoHlFold (* The below needed to be changed and are in TSynDemoHlFold
TSynDemoHlContextFoldBase uses Ranges itself. TSynDemoHlContextFoldBase uses Ranges itself.
@ -242,7 +242,7 @@ begin
TokenLength := FTokenEnd - FTokenPos; TokenLength := FTokenEnd - FTokenPos;
end; end;
function TSynDemoHlFoldBase.GetTokenAttribute: TSynHighlighterAttributes; function TSynDemoHlFoldBase.GetTokenAttribute: TLazEditTextAttribute;
begin begin
// Match the text, specified by FTokenPos and FTokenEnd // Match the text, specified by FTokenPos and FTokenEnd
@ -307,7 +307,7 @@ begin
dec(FCurRange); dec(FCurRange);
end; end;
function TSynDemoHlContextFoldBase.GetTokenAttribute: TSynHighlighterAttributes; function TSynDemoHlContextFoldBase.GetTokenAttribute: TLazEditTextAttribute;
begin begin
Result := inherited GetTokenAttribute; Result := inherited GetTokenAttribute;
if (Result = SpecialAttri) and (FCurRange > 0) then if (Result = SpecialAttri) and (FCurRange > 0) then

View File

@ -78,7 +78,7 @@ type
procedure Next; override; procedure Next; override;
function GetEol: Boolean; override; function GetEol: Boolean; override;
procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override; procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override;
function GetTokenAttribute: TSynHighlighterAttributes; override; function GetTokenAttribute: TLazEditTextAttribute; override;
public public
function GetToken: String; override; function GetToken: String; override;
function GetTokenPos: Integer; override; function GetTokenPos: Integer; override;
@ -192,7 +192,7 @@ begin
TokenLength := FTokenEnd - FTokenPos; TokenLength := FTokenEnd - FTokenPos;
end; end;
function TSynDemoHl.GetTokenAttribute: TSynHighlighterAttributes; function TSynDemoHl.GetTokenAttribute: TLazEditTextAttribute;
begin begin
// Match the text, specified by FTokenPos and FTokenEnd // Match the text, specified by FTokenPos and FTokenEnd

View File

@ -86,7 +86,7 @@ type
// TSynPositionHighlighter - minimum implementation needed. // TSynPositionHighlighter - minimum implementation needed.
TNonSrcIDEHighlighter = class(TSynPositionHighlighter); // Hold colors, not related to SourceEditor TNonSrcIDEHighlighter = class(TSynPositionHighlighter); // Hold colors, not related to SourceEditor
TSynHighlightElement = TSynHighlighterAttributes; TSynHighlightElement = TLazEditTextAttribute deprecated 'use TLazEditTextAttribute // to be removed in 5.99';
TCustomSynClass = class of TSrcIDEHighlighter; TCustomSynClass = class of TSrcIDEHighlighter;
TLazSynPluginTemplateMultiCaret = class(TForm) end; TLazSynPluginTemplateMultiCaret = class(TForm) end;
@ -352,7 +352,7 @@ type
constructor Create(ASchemeLang: TColorSchemeLanguage; attribName: PString; constructor Create(ASchemeLang: TColorSchemeLanguage; attribName: PString;
const aStoredName: String = ''); const aStoredName: String = '');
function IsEnabled: boolean; override; function IsEnabled: boolean; override;
procedure ApplyTo(aDest: TSynHighlighterAttributes; aDefault: TColorSchemeAttribute = nil); procedure ApplyTo(aDest: TLazEditTextAttribute; aDefault: TColorSchemeAttribute = nil);
procedure Assign(Src: TPersistent); override; procedure Assign(Src: TPersistent); override;
function Equals(Other: TColorSchemeAttribute): Boolean; reintroduce; function Equals(Other: TColorSchemeAttribute): Boolean; reintroduce;
function GetStoredValuesForAttrib: TColorSchemeAttribute; // The IDE default colors from the resources function GetStoredValuesForAttrib: TColorSchemeAttribute; // The IDE default colors from the resources
@ -509,7 +509,7 @@ type
function GetEol: Boolean; override; function GetEol: Boolean; override;
function GetToken: string; override; function GetToken: string; override;
procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override; procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override;
function GetTokenAttribute: TSynHighlighterAttributes; override; function GetTokenAttribute: TLazEditTextAttribute; override;
function GetTokenPos: Integer; override; function GetTokenPos: Integer; override;
function GetTokenKind: integer; override; function GetTokenKind: integer; override;
procedure Next; override; procedure Next; override;
@ -7140,7 +7140,7 @@ end;
procedure TColorSchemeAttribute.ApplyTo(aDest: TObject); procedure TColorSchemeAttribute.ApplyTo(aDest: TObject);
begin begin
ApplyTo(aDest as TSynHighlighterAttributes, nil); ApplyTo(aDest as TLazEditTextAttribute, nil);
end; end;
procedure TColorSchemeAttribute.Init; procedure TColorSchemeAttribute.Init;
@ -7208,7 +7208,7 @@ begin
Result := (inherited IsEnabled) or (FMarkupFoldLineColor <> clNone); Result := (inherited IsEnabled) or (FMarkupFoldLineColor <> clNone);
end; end;
procedure TColorSchemeAttribute.ApplyTo(aDest: TSynHighlighterAttributes; procedure TColorSchemeAttribute.ApplyTo(aDest: TLazEditTextAttribute;
aDefault: TColorSchemeAttribute); aDefault: TColorSchemeAttribute);
// aDefault (if supplied) is usually the Schemes agnDefault / DefaultAttribute // aDefault (if supplied) is usually the Schemes agnDefault / DefaultAttribute
var var
@ -7233,10 +7233,10 @@ begin
aDest.StyleMask := [low(TFontStyle)..high(TFontStyle)]; aDest.StyleMask := [low(TFontStyle)..high(TFontStyle)];
end; end;
if aDest is TSynHighlighterAttributesModifier then begin if aDest is TLazEditTextAttributeModifier then begin
TSynHighlighterAttributesModifier(aDest).ForeAlpha := Src.ForeAlpha; TLazEditTextAttributeModifier(aDest).ForeAlpha := Src.ForeAlpha;
TSynHighlighterAttributesModifier(aDest).BackAlpha := Src.BackAlpha; TLazEditTextAttributeModifier(aDest).BackAlpha := Src.BackAlpha;
TSynHighlighterAttributesModifier(aDest).FrameAlpha := Src.FrameAlpha; TLazEditTextAttributeModifier(aDest).FrameAlpha := Src.FrameAlpha;
if aDest is TSynHighlighterLazCustomPasAttribute then begin if aDest is TSynHighlighterLazCustomPasAttribute then begin
TSynHighlighterLazCustomPasAttribute(aDest).CustomWords.Assign(CustomWords); TSynHighlighterLazCustomPasAttribute(aDest).CustomWords.Assign(CustomWords);
TSynHighlighterLazCustomPasAttribute(aDest).CustomWordTokenKind := CustomWordTokenKind; TSynHighlighterLazCustomPasAttribute(aDest).CustomWordTokenKind := CustomWordTokenKind;
@ -7252,7 +7252,7 @@ begin
aDest.UnderlinePriority := Src.UnderlinePriority; aDest.UnderlinePriority := Src.UnderlinePriority;
end; end;
if not (aDest is TSynHighlighterAttributesModifier) then begin if not (aDest is TLazEditTextAttributeModifier) then begin
if aDefault <> nil then begin if aDefault <> nil then begin
if aDefault.IsUsingSchemeGlobals then if aDefault.IsUsingSchemeGlobals then
aDefault := aDefault.GetSchemeGlobal; aDefault := aDefault.GetSchemeGlobal;
@ -7286,7 +7286,7 @@ begin
hafStyle, hafFrameStyle, hafFrameEdges, hafPrior]; hafStyle, hafFrameStyle, hafFrameEdges, hafPrior];
if Src is TSynHighlighterLazCustomPasAttribute then if Src is TSynHighlighterLazCustomPasAttribute then
FAttrFeatures := FAttrFeatures + [hafCustomWords]; FAttrFeatures := FAttrFeatures + [hafCustomWords];
if Src is TSynHighlighterAttributesModifier then if Src is TLazEditTextAttributeModifier then
FAttrFeatures := FAttrFeatures + [hafAlpha, hafStyleMask]; FAttrFeatures := FAttrFeatures + [hafAlpha, hafStyleMask];
if Src is TColorSchemeAttribute then begin if Src is TColorSchemeAttribute then begin
@ -7496,7 +7496,7 @@ constructor TColorSchemeLanguage.CreateFromXml(AGroup: TColorScheme;
const aPath: String; IsSchemeDefault: Boolean; const aPath: String; IsSchemeDefault: Boolean;
aPascalScheme: TColorSchemeLanguage; MappedAttributes: TStringList); aPascalScheme: TColorSchemeLanguage; MappedAttributes: TStringList);
var var
hla: TSynHighlighterAttributes; hla: TLazEditTextAttribute;
csa, pasattr: TColorSchemeAttribute; csa, pasattr: TColorSchemeAttribute;
aha: TAdditionalHilightAttribute; aha: TAdditionalHilightAttribute;
FormatVersion, i: Integer; FormatVersion, i: Integer;
@ -7517,7 +7517,7 @@ begin
if hla is TSynHighlighterLazCustomPasAttribute then if hla is TSynHighlighterLazCustomPasAttribute then
csa.AttrFeatures := [hafBackColor, hafForeColor, hafFrameColor, hafAlpha, hafPrior, hafStyle, hafStyleMask, hafCustomWords] csa.AttrFeatures := [hafBackColor, hafForeColor, hafFrameColor, hafAlpha, hafPrior, hafStyle, hafStyleMask, hafCustomWords]
else else
if hla is TSynHighlighterAttributesModifier then if hla is TLazEditTextAttributeModifier then
csa.AttrFeatures := [hafBackColor, hafForeColor, hafFrameColor, hafAlpha, hafPrior, hafStyle, hafStyleMask] csa.AttrFeatures := [hafBackColor, hafForeColor, hafFrameColor, hafAlpha, hafPrior, hafStyle, hafStyleMask]
else else
csa.AttrFeatures := [hafBackColor, hafForeColor, hafFrameColor, hafStyle]; csa.AttrFeatures := [hafBackColor, hafForeColor, hafFrameColor, hafStyle];
@ -8013,7 +8013,7 @@ procedure TColorSchemeLanguage.ApplyTo(AHLighter: TSynCustomHighlighter);
var var
i: Integer; i: Integer;
Attr: TColorSchemeAttribute; Attr: TColorSchemeAttribute;
hlattrs: TSynHighlighterAttributes; hlattrs: TLazEditTextAttribute;
begin begin
AHLighter.BeginUpdate; AHLighter.BeginUpdate;
try try
@ -8276,8 +8276,8 @@ begin
csa := TColorSchemeAttribute.Create(csl, AName, AStoredName); csa := TColorSchemeAttribute.Create(csl, AName, AStoredName);
csa.Clear; csa.Clear;
if ADefaults <> nil then begin if ADefaults <> nil then begin
csa.AssignSupportedFeaturesFrom(ADefaults as TSynHighlighterAttributes); csa.AssignSupportedFeaturesFrom(ADefaults as TLazEditTextAttribute);
csa.AssignColors(ADefaults as TSynHighlighterAttributes); csa.AssignColors(ADefaults as TLazEditTextAttribute);
end; end;
csa.InternalSaveDefaultValues; csa.InternalSaveDefaultValues;
csa.FDefaultSynFeatures := csa.Features; csa.FDefaultSynFeatures := csa.Features;
@ -8457,7 +8457,7 @@ begin
TokenLength := Length(FLineText); TokenLength := Length(FLineText);
end; end;
function TIDESynTextSyn.GetTokenAttribute: TSynHighlighterAttributes; function TIDESynTextSyn.GetTokenAttribute: TLazEditTextAttribute;
begin begin
Result := nil; Result := nil;
end; end;

View File

@ -37,7 +37,7 @@ uses
SynEditTypes, SynGutterChanges, SynEditMouseCmds, SynEditHighlighter, SynEditStrConst, SynEditTypes, SynGutterChanges, SynEditMouseCmds, SynEditHighlighter, SynEditStrConst,
// IdeIntf // IdeIntf
IDEOptionsIntf, IDEOptEditorIntf, IDEImagesIntf, IDEUtils, IDEOptionsIntf, IDEOptEditorIntf, IDEImagesIntf, IDEUtils,
EditorSyntaxHighlighterDef, EditorSyntaxHighlighterDef, LazEditTextAttributes,
// IdeConfig // IdeConfig
IDEProcs, LazConf, IDEProcs, LazConf,
// IDE // IDE
@ -476,7 +476,7 @@ procedure TEditorColorOptionsFrame.ColorPreviewMouseUp(Sender: TObject;
var var
i: Integer; i: Integer;
Token: String; Token: String;
Attri: TSynHighlightElement; Attri: TLazEditTextAttribute;
MouseXY, XY: TPoint; MouseXY, XY: TPoint;
AddAttr: TAdditionalHilightAttribute; AddAttr: TAdditionalHilightAttribute;
NewNode: TTreeNode; NewNode: TTreeNode;

View File

@ -178,7 +178,7 @@ uses
SourceFileManager, EditorToolbarStatic, IDEInstances, SourceFileManager, EditorToolbarStatic, IDEInstances,
WordCompletion, EnvGuiOptions, EnvDebuggerOptions, IdeDebuggerValueFormatter, ProjectDebugLink, WordCompletion, EnvGuiOptions, EnvDebuggerOptions, IdeDebuggerValueFormatter, ProjectDebugLink,
// main ide // main ide
MainBar, MainIntf, MainBase, SearchPathProcs; MainBar, MainIntf, MainBase, SearchPathProcs, LazEditTextAttributes;
type type
{ TMainIDE } { TMainIDE }
@ -4054,7 +4054,7 @@ var
CurWordAtCursor, TokenTxt: string; CurWordAtCursor, TokenTxt: string;
FindDeclarationCmd: TIDECommand; FindDeclarationCmd: TIDECommand;
i, TokenType, Start: Integer; i, TokenType, Start: Integer;
Attri: TSynHighlighterAttributes; Attri: TLazEditTextAttribute;
xy: TPoint; xy: TPoint;
begin begin
GetCurrentUnit(ASrcEdit, AnUnitInfo); GetCurrentUnit(ASrcEdit, AnUnitInfo);

View File

@ -112,7 +112,7 @@ type
procedure pbAsmMouseUp(Sender: TObject; {%H-}Button: TMouseButton; {%H-}Shift: TShiftState; {%H-}X, procedure pbAsmMouseUp(Sender: TObject; {%H-}Button: TMouseButton; {%H-}Shift: TShiftState; {%H-}X,
{%H-}Y: Integer); {%H-}Y: Integer);
procedure pbAsmMouseWheel(Sender: TObject; Shift: TShiftState; WheelDelta: Integer; {%H-}MousePos: TPoint; var Handled: Boolean); procedure pbAsmMouseWheel(Sender: TObject; Shift: TShiftState; WheelDelta: Integer; {%H-}MousePos: TPoint; var Handled: Boolean);
procedure GetColors(ASrc: TSynHighlighterAttributes; AMod: array of TSynHighlighterAttributesModifier; out AText, ABack, AFrame: TColor; out AStyle: TFontStyles); procedure GetColors(ASrc: TLazEditTextAttribute; AMod: array of TLazEditTextAttributeModifier; out AText, ABack, AFrame: TColor; out AStyle: TFontStyles);
procedure pbAsmPaint(Sender: TObject); procedure pbAsmPaint(Sender: TObject);
procedure popCopyAddrClick(Sender: TObject); procedure popCopyAddrClick(Sender: TObject);
procedure sbHorizontalChange(Sender: TObject); procedure sbHorizontalChange(Sender: TObject);
@ -798,8 +798,8 @@ begin
pbAsm.Invalidate; pbAsm.Invalidate;
end; end;
procedure TAssemblerDlg.GetColors(ASrc: TSynHighlighterAttributes; procedure TAssemblerDlg.GetColors(ASrc: TLazEditTextAttribute;
AMod: array of TSynHighlighterAttributesModifier; out AText, ABack, AMod: array of TLazEditTextAttributeModifier; out AText, ABack,
AFrame: TColor; out AStyle: TFontStyles); AFrame: TColor; out AStyle: TFontStyles);
var var
i: Integer; i: Integer;
@ -829,7 +829,7 @@ var
TextStyle: TTextStyle; TextStyle: TTextStyle;
Fore, Back, Frame: TColor; Fore, Back, Frame: TColor;
St: TFontStyles; St: TFontStyles;
m0, m1, m2, m3: TSynHighlighterAttributesModifier; m0, m1, m2, m3: TLazEditTextAttributeModifier;
begin begin
R := pbAsm.ClientRect; R := pbAsm.ClientRect;
TextStyle := pbAsm.Canvas.TextStyle; TextStyle := pbAsm.Canvas.TextStyle;

View File

@ -84,7 +84,7 @@ uses
EncloseSelectionDlg, EncloseIfDef, InvertAssignTool, SourceEditProcs, EncloseSelectionDlg, EncloseIfDef, InvertAssignTool, SourceEditProcs,
SourceMarks, SearchFrm, MultiPasteDlg, EditorMacroListViewer, SourceMarks, SearchFrm, MultiPasteDlg, EditorMacroListViewer,
EditorToolbarStatic, editortoolbar_options, InputhistoryWithSearchOpt, EditorToolbarStatic, editortoolbar_options, InputhistoryWithSearchOpt,
FPDocHints, MainIntf, GotoFrm; FPDocHints, MainIntf, GotoFrm, LazEditTextAttributes;
type type
TSourceNotebook = class; TSourceNotebook = class;
@ -6646,7 +6646,7 @@ end;
function TSourceEditor.GetCodeAttributeName(LogXY: TPoint): String; function TSourceEditor.GetCodeAttributeName(LogXY: TPoint): String;
var var
Token: string; Token: string;
Attri: TSynHighlighterAttributes; Attri: TLazEditTextAttribute;
begin begin
Result := ''; Result := '';
if EditorComponent.GetHighlighterAttriAtRowCol(LogXY,Token,Attri) if EditorComponent.GetHighlighterAttriAtRowCol(LogXY,Token,Attri)

View File

@ -228,10 +228,10 @@ type
TSynMarkupIdentComplWindow = class // don't inherit from TSynEditMarkup, no regular markup TSynMarkupIdentComplWindow = class // don't inherit from TSynEditMarkup, no regular markup
private private
FColor: array[TIdentWindowAhaColorRange] of TSynHighlighterAttributes; FColor: array[TIdentWindowAhaColorRange] of TLazEditTextAttribute;
FUseRecent: boolean; FUseRecent: boolean;
function GetColor(AnIndex: TIdentWindowAhaColorRange): TSynHighlighterAttributes; function GetColor(AnIndex: TIdentWindowAhaColorRange): TLazEditTextAttribute;
function GetForegroundColor(AnIndex: TAdditionalHilightAttribute): TColor; function GetForegroundColor(AnIndex: TAdditionalHilightAttribute): TColor;
function GetBackgroundColor(AnIndex: TAdditionalHilightAttribute): TColor; function GetBackgroundColor(AnIndex: TAdditionalHilightAttribute): TColor;
public public
@ -240,7 +240,7 @@ type
procedure Clear; procedure Clear;
procedure Merge(AColors: TSynMarkupIdentComplWindow); procedure Merge(AColors: TSynMarkupIdentComplWindow);
public public
property Color [AnIndex: TIdentWindowAhaColorRange]: TSynHighlighterAttributes read GetColor; default; property Color [AnIndex: TIdentWindowAhaColorRange]: TLazEditTextAttribute read GetColor; default;
property TextColor: TColor index ahaIdentComplWindow read GetForegroundColor; property TextColor: TColor index ahaIdentComplWindow read GetForegroundColor;
property BackgroundColor: TColor index ahaIdentComplWindow read GetBackgroundColor; property BackgroundColor: TColor index ahaIdentComplWindow read GetBackgroundColor;
@ -594,7 +594,7 @@ implementation
{ TSynMarkupIdentComplWindow } { TSynMarkupIdentComplWindow }
function TSynMarkupIdentComplWindow.GetColor(AnIndex: TIdentWindowAhaColorRange function TSynMarkupIdentComplWindow.GetColor(AnIndex: TIdentWindowAhaColorRange
): TSynHighlighterAttributes; ): TLazEditTextAttribute;
begin begin
Result := FColor[AnIndex]; Result := FColor[AnIndex];
end; end;
@ -618,7 +618,7 @@ begin
inherited Create; inherited Create;
for i := low(TIdentWindowAhaColorRange) to high(TIdentWindowAhaColorRange) do for i := low(TIdentWindowAhaColorRange) to high(TIdentWindowAhaColorRange) do
FColor[i] := TSynHighlighterAttributes.Create; FColor[i] := TLazEditTextAttribute.Create;
Clear; Clear;
end; end;