mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-04 03:40:28 +02:00
SynEdit: Caret Color
git-svn-id: trunk@58647 -
This commit is contained in:
parent
a781aff21b
commit
17dd3e68b9
@ -594,7 +594,6 @@ type
|
|||||||
FOnClickLink: TMouseEvent;
|
FOnClickLink: TMouseEvent;
|
||||||
FOnMouseLink: TSynMouseLinkEvent;
|
FOnMouseLink: TSynMouseLinkEvent;
|
||||||
FPendingFoldState: String;
|
FPendingFoldState: String;
|
||||||
FScreenCaretPainterClass: TSynEditScreenCaretPainterClass;
|
|
||||||
|
|
||||||
procedure UpdateScreenCaret;
|
procedure UpdateScreenCaret;
|
||||||
procedure AquirePrimarySelection;
|
procedure AquirePrimarySelection;
|
||||||
@ -766,6 +765,7 @@ type
|
|||||||
procedure InternalBeginUndoBlock(aList: TSynEditUndoList = nil); // includes paintlock
|
procedure InternalBeginUndoBlock(aList: TSynEditUndoList = nil); // includes paintlock
|
||||||
procedure InternalEndUndoBlock(aList: TSynEditUndoList = nil);
|
procedure InternalEndUndoBlock(aList: TSynEditUndoList = nil);
|
||||||
protected
|
protected
|
||||||
|
FScreenCaretPainterClass: TSynEditScreenCaretPainterClass deprecated 'need refactor';
|
||||||
{$IFDEF EnableDoubleBuf}
|
{$IFDEF EnableDoubleBuf}
|
||||||
BufferBitmap: TBitmap; // the double buffer
|
BufferBitmap: TBitmap; // the double buffer
|
||||||
SavedCanvas: TCanvas; // the normal TCustomControl canvas during paint
|
SavedCanvas: TCanvas; // the normal TCustomControl canvas during paint
|
||||||
@ -2052,7 +2052,7 @@ begin
|
|||||||
FCaret.AddChangeHandler(@CaretChanged);
|
FCaret.AddChangeHandler(@CaretChanged);
|
||||||
FInternalCaret := TSynEditCaret.Create;
|
FInternalCaret := TSynEditCaret.Create;
|
||||||
FInternalCaret.MaxLeftChar := @CurrentMaxLineLen;
|
FInternalCaret.MaxLeftChar := @CurrentMaxLineLen;
|
||||||
FScreenCaretPainterClass := TSynEditScreenCaretPainterSystem;
|
FScreenCaretPainterClass{%H-} := TSynEditScreenCaretPainterSystem;
|
||||||
|
|
||||||
// Create the lines/views
|
// Create the lines/views
|
||||||
FTrimmedLinesView := TSynEditStringTrimmingList.Create(fLines, fCaret);
|
FTrimmedLinesView := TSynEditStringTrimmingList.Create(fLines, fCaret);
|
||||||
@ -4987,7 +4987,7 @@ begin
|
|||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
LastMouseCaret:=Point(-1,-1);
|
LastMouseCaret:=Point(-1,-1);
|
||||||
// Todo: Under Windows, keeping the Caret only works, if no other component creates a caret
|
// Todo: Under Windows, keeping the Caret only works, if no other component creates a caret
|
||||||
FScreenCaretPainterClass := TSynEditScreenCaretPainterClass(ScreenCaret.Painter.ClassType);
|
FScreenCaretPainterClass{%H-} := TSynEditScreenCaretPainterClass(ScreenCaret.Painter.ClassType);
|
||||||
UpdateScreenCaret;
|
UpdateScreenCaret;
|
||||||
if FHideSelection and SelAvail then
|
if FHideSelection and SelAvail then
|
||||||
Invalidate;
|
Invalidate;
|
||||||
@ -5007,8 +5007,8 @@ begin
|
|||||||
DebugLn(['[TCustomSynEdit.WMSetFocus] A ',DbgSName(Self), ' time=', dbgs(Now*86640)]);
|
DebugLn(['[TCustomSynEdit.WMSetFocus] A ',DbgSName(Self), ' time=', dbgs(Now*86640)]);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
FScreenCaret.DestroyCaret; // Ensure recreation. On Windows only one caret exists, and it must be moved to the focused editor
|
FScreenCaret.DestroyCaret; // Ensure recreation. On Windows only one caret exists, and it must be moved to the focused editor
|
||||||
if ScreenCaret.Painter.ClassType <> FScreenCaretPainterClass then
|
if ScreenCaret.Painter.ClassType <> FScreenCaretPainterClass{%H-} then
|
||||||
ScreenCaret.ChangePainter(FScreenCaretPainterClass);
|
ScreenCaret.ChangePainter(FScreenCaretPainterClass{%H-});
|
||||||
if ScreenCaret.Painter.ClassType <> TSynEditScreenCaretPainterSystem then // system painter does not use timer
|
if ScreenCaret.Painter.ClassType <> TSynEditScreenCaretPainterSystem then // system painter does not use timer
|
||||||
FScreenCaret.PaintTimer.ResetInterval;
|
FScreenCaret.PaintTimer.ResetInterval;
|
||||||
FScreenCaret.Visible := not(eoNoCaret in FOptions) and IsVisible;
|
FScreenCaret.Visible := not(eoNoCaret in FOptions) and IsVisible;
|
||||||
|
@ -123,6 +123,7 @@ const
|
|||||||
'', // ahaRightMargin
|
'', // ahaRightMargin
|
||||||
'', // ahaSpecialVisibleChars
|
'', // ahaSpecialVisibleChars
|
||||||
'', // ahaTopInfoHint
|
'', // ahaTopInfoHint
|
||||||
|
'', // ahaCaretColor
|
||||||
'', '', '', // ahaIfDefBlockInactive, ahaIfDefBlockActive, ahaIfDefBlockTmpActive
|
'', '', '', // ahaIfDefBlockInactive, ahaIfDefBlockActive, ahaIfDefBlockTmpActive
|
||||||
'', '', '', // ahaIfDefNodeInactive, ahaIfDefNodeActive, ahaIfDefNodeTmpActive
|
'', '', '', // ahaIfDefNodeInactive, ahaIfDefNodeActive, ahaIfDefNodeTmpActive
|
||||||
'', '', '', '', // ahaIdentComplWindow, ahaIdentComplWindowBorder, ahaIdentComplWindowSelection, ahaIdentComplWindowHighlight
|
'', '', '', '', // ahaIdentComplWindow, ahaIdentComplWindowBorder, ahaIdentComplWindowSelection, ahaIdentComplWindowHighlight
|
||||||
@ -163,6 +164,7 @@ const
|
|||||||
{ ahaRightMargin} agnGutter,
|
{ ahaRightMargin} agnGutter,
|
||||||
{ ahaSpecialVisibleChars } agnText,
|
{ ahaSpecialVisibleChars } agnText,
|
||||||
{ ahaTopInfoHint } agnLine,
|
{ ahaTopInfoHint } agnLine,
|
||||||
|
{ ahaCaretColor } agnText,
|
||||||
{ ahaIfDefBlockInactive } agnIfDef,
|
{ ahaIfDefBlockInactive } agnIfDef,
|
||||||
{ ahaIfDefBlockActive } agnIfDef,
|
{ ahaIfDefBlockActive } agnIfDef,
|
||||||
{ ahaIfDefBlockTmpActive } agnIfDef,
|
{ ahaIfDefBlockTmpActive } agnIfDef,
|
||||||
@ -220,6 +222,7 @@ const
|
|||||||
{ ahaRightMargin} [hafForeColor],
|
{ ahaRightMargin} [hafForeColor],
|
||||||
{ ahaSpecialVisibleChars }[hafBackColor, hafForeColor, hafFrameColor, hafAlpha, hafPrior, hafFrameStyle, hafFrameEdges, hafStyle, hafStyleMask],
|
{ ahaSpecialVisibleChars }[hafBackColor, hafForeColor, hafFrameColor, hafAlpha, hafPrior, hafFrameStyle, hafFrameEdges, hafStyle, hafStyleMask],
|
||||||
{ ahaTopInfoHint } [hafBackColor, hafForeColor, hafFrameColor, hafAlpha, hafPrior, hafFrameStyle, hafFrameEdges, hafStyle, hafStyleMask],
|
{ ahaTopInfoHint } [hafBackColor, hafForeColor, hafFrameColor, hafAlpha, hafPrior, hafFrameStyle, hafFrameEdges, hafStyle, hafStyleMask],
|
||||||
|
{ ahaCaretColor } [hafBackColor, hafForeColor],
|
||||||
{ ahaIfDefBlockInactive } [hafBackColor, hafForeColor, hafFrameColor, hafAlpha, hafPrior, hafFrameStyle, hafFrameEdges, hafStyle, hafStyleMask],
|
{ ahaIfDefBlockInactive } [hafBackColor, hafForeColor, hafFrameColor, hafAlpha, hafPrior, hafFrameStyle, hafFrameEdges, hafStyle, hafStyleMask],
|
||||||
{ ahaIfDefBlockActive } [hafBackColor, hafForeColor, hafFrameColor, hafAlpha, hafPrior, hafFrameStyle, hafFrameEdges, hafStyle, hafStyleMask],
|
{ ahaIfDefBlockActive } [hafBackColor, hafForeColor, hafFrameColor, hafAlpha, hafPrior, hafFrameStyle, hafFrameEdges, hafStyle, hafStyleMask],
|
||||||
{ ahaIfDefBlockTmpActive }[hafBackColor, hafForeColor, hafFrameColor, hafAlpha, hafPrior, hafFrameStyle, hafFrameEdges, hafStyle, hafStyleMask],
|
{ ahaIfDefBlockTmpActive }[hafBackColor, hafForeColor, hafFrameColor, hafAlpha, hafPrior, hafFrameStyle, hafFrameEdges, hafStyle, hafStyleMask],
|
||||||
@ -2523,6 +2526,7 @@ begin
|
|||||||
AdditionalHighlightAttributes[ahaRightMargin] := dlgRightMargin;
|
AdditionalHighlightAttributes[ahaRightMargin] := dlgRightMargin;
|
||||||
AdditionalHighlightAttributes[ahaSpecialVisibleChars] := dlgAddHiSpecialVisibleChars;
|
AdditionalHighlightAttributes[ahaSpecialVisibleChars] := dlgAddHiSpecialVisibleChars;
|
||||||
AdditionalHighlightAttributes[ahaTopInfoHint] := dlgTopInfoHint;
|
AdditionalHighlightAttributes[ahaTopInfoHint] := dlgTopInfoHint;
|
||||||
|
AdditionalHighlightAttributes[ahaCaretColor] := dlgCaretColor;
|
||||||
AdditionalHighlightAttributes[ahaIfDefBlockInactive] := dlgIfDefBlockInactive;
|
AdditionalHighlightAttributes[ahaIfDefBlockInactive] := dlgIfDefBlockInactive;
|
||||||
AdditionalHighlightAttributes[ahaIfDefBlockActive] := dlgIfDefBlockActive;
|
AdditionalHighlightAttributes[ahaIfDefBlockActive] := dlgIfDefBlockActive;
|
||||||
AdditionalHighlightAttributes[ahaIfDefBlockTmpActive] := dlgIfDefBlockTmpActive;
|
AdditionalHighlightAttributes[ahaIfDefBlockTmpActive] := dlgIfDefBlockTmpActive;
|
||||||
@ -6593,7 +6597,7 @@ procedure TColorSchemeLanguage.ApplyTo(ASynEdit: TSynEdit);
|
|||||||
Result := Result.GetSchemeGlobal;
|
Result := Result.GetSchemeGlobal;
|
||||||
end;
|
end;
|
||||||
var
|
var
|
||||||
Attri, att: TColorSchemeAttribute;
|
Attri: TColorSchemeAttribute;
|
||||||
i, c, j: Integer;
|
i, c, j: Integer;
|
||||||
IDESynEdit: TIDESynEditor;
|
IDESynEdit: TIDESynEditor;
|
||||||
aha: TAdditionalHilightAttribute;
|
aha: TAdditionalHilightAttribute;
|
||||||
@ -6632,8 +6636,14 @@ begin
|
|||||||
SetMarkupColor(ahaFoldedCodeLine, aSynEdit.FoldedCodeLineColor);
|
SetMarkupColor(ahaFoldedCodeLine, aSynEdit.FoldedCodeLineColor);
|
||||||
SetMarkupColor(ahaHiddenCodeLine, aSynEdit.HiddenCodeLineColor);
|
SetMarkupColor(ahaHiddenCodeLine, aSynEdit.HiddenCodeLineColor);
|
||||||
SetMarkupColor(ahaLineHighlight, aSynEdit.LineHighlightColor);
|
SetMarkupColor(ahaLineHighlight, aSynEdit.LineHighlightColor);
|
||||||
if ASynEdit is TIDESynEditor then
|
if ASynEdit is TIDESynEditor then begin
|
||||||
SetMarkupColor(ahaTopInfoHint, TIDESynEditor(aSynEdit).TopInfoMarkup);
|
SetMarkupColor(ahaTopInfoHint, TIDESynEditor(aSynEdit).TopInfoMarkup);
|
||||||
|
Attri := GetUsedAttr(ahaCaretColor);
|
||||||
|
if Attri <> nil then begin
|
||||||
|
TIDESynEditor(aSynEdit).CaretColor := Attri.Foreground;
|
||||||
|
TIDESynEditor(aSynEdit).MultiCaret.Color := Attri.Background;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
SetMarkupColorByClass(ahaHighlightWord, TSynEditMarkupHighlightAllCaret);
|
SetMarkupColorByClass(ahaHighlightWord, TSynEditMarkupHighlightAllCaret);
|
||||||
SetMarkupColorByClass(ahaWordGroup, TSynEditMarkupWordGroup);
|
SetMarkupColorByClass(ahaWordGroup, TSynEditMarkupWordGroup);
|
||||||
SetMarkupColorByClass(ahaSpecialVisibleChars, TSynEditMarkupSpecialChar);
|
SetMarkupColorByClass(ahaSpecialVisibleChars, TSynEditMarkupSpecialChar);
|
||||||
@ -6728,18 +6738,17 @@ begin
|
|||||||
j := 0;
|
j := 0;
|
||||||
c := 0;
|
c := 0;
|
||||||
for aha := ahaOutlineLevel1Color to ahaOutlineLevel10Color do begin
|
for aha := ahaOutlineLevel1Color to ahaOutlineLevel10Color do begin
|
||||||
att := AttributeByEnum[aha];
|
Attri := GetUsedAttr(aha);
|
||||||
if Att.IsEnabled or
|
if Attri = nil then Continue;
|
||||||
|
if (Attri.IsEnabled) or
|
||||||
(FFormatVersion >= 12)
|
(FFormatVersion >= 12)
|
||||||
then begin
|
then begin
|
||||||
SetMarkupColor(aha, TSynEditMarkupFoldColors(aSynEdit.Markup[i]).Color[j]);
|
SetMarkupColor(aha, TSynEditMarkupFoldColors(aSynEdit.Markup[i]).Color[j]);
|
||||||
|
|
||||||
if att.IsUsingSchemeGlobals then
|
TSynEditMarkupFoldColors(aSynEdit.Markup[i]).LineColor[j].Color := Attri.MarkupFoldLineColor;
|
||||||
att := att.GetSchemeGlobal;
|
TSynEditMarkupFoldColors(aSynEdit.Markup[i]).LineColor[j].Style := Attri.MarkupFoldLineStyle;
|
||||||
TSynEditMarkupFoldColors(aSynEdit.Markup[i]).LineColor[j].Color := att.MarkupFoldLineColor;
|
TSynEditMarkupFoldColors(aSynEdit.Markup[i]).LineColor[j].Alpha := Attri.MarkupFoldLineAlpha;
|
||||||
TSynEditMarkupFoldColors(aSynEdit.Markup[i]).LineColor[j].Style := att.MarkupFoldLineStyle;
|
TSynEditMarkupFoldColors(aSynEdit.Markup[i]).LineColor[j].Priority := Attri.FramePriority;
|
||||||
TSynEditMarkupFoldColors(aSynEdit.Markup[i]).LineColor[j].Alpha := att.MarkupFoldLineAlpha;
|
|
||||||
TSynEditMarkupFoldColors(aSynEdit.Markup[i]).LineColor[j].Priority := att.FramePriority;
|
|
||||||
inc(j);
|
inc(j);
|
||||||
c := j;
|
c := j;
|
||||||
end;
|
end;
|
||||||
|
@ -264,7 +264,7 @@ begin
|
|||||||
|
|
||||||
// Draw preview box - Background
|
// Draw preview box - Background
|
||||||
c := clNone;
|
c := clNone;
|
||||||
if (hafBackColor in Attri.Features) then
|
if (hafBackColor in Attri.Features) and not (AttriIdx = ord(ahaCaretColor)) then
|
||||||
c := Attri.Background;
|
c := Attri.Background;
|
||||||
// Fallback Background-color for gutter
|
// Fallback Background-color for gutter
|
||||||
if ((c = clNone) or (c = clDefault)) and
|
if ((c = clNone) or (c = clDefault)) and
|
||||||
@ -282,7 +282,7 @@ begin
|
|||||||
TheTree.Canvas.FillRect(NodeRect.Left+2, NodeRect.Top+2, NodeRect.Left+FullAbcWidth-2, NodeRect.Bottom-2);
|
TheTree.Canvas.FillRect(NodeRect.Left+2, NodeRect.Top+2, NodeRect.Left+FullAbcWidth-2, NodeRect.Bottom-2);
|
||||||
|
|
||||||
// Special draw Modified line gutter
|
// Special draw Modified line gutter
|
||||||
if AttriIdx = ord(ahaModifiedLine) then begin
|
if (AttriIdx = ord(ahaModifiedLine)) then begin
|
||||||
TextY := NodeRect.Bottom - NodeRect.Top - 4;
|
TextY := NodeRect.Bottom - NodeRect.Top - 4;
|
||||||
TheTree.Canvas.Brush.Color := Attri.Foreground;
|
TheTree.Canvas.Brush.Color := Attri.Foreground;
|
||||||
TheTree.Canvas.FillRect(NodeRect.Left+2, NodeRect.Top+2, NodeRect.Left+5, NodeRect.Bottom-2);
|
TheTree.Canvas.FillRect(NodeRect.Left+2, NodeRect.Top+2, NodeRect.Left+5, NodeRect.Bottom-2);
|
||||||
@ -291,9 +291,11 @@ begin
|
|||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// Special draw oultine color
|
// Special draw oultine color // Caret color
|
||||||
if Attri.Group = agnOutlineColors then begin
|
if (Attri.Group = agnOutlineColors) or (AttriIdx = ord(ahaCaretColor)) then begin
|
||||||
c := Attri.MarkupFoldLineColor;
|
c := Attri.MarkupFoldLineColor;
|
||||||
|
if (AttriIdx = ord(ahaCaretColor)) then
|
||||||
|
c := Attri.Foreground;
|
||||||
if c <> clNone then begin
|
if c <> clNone then begin
|
||||||
TheTree.Canvas.Pen.Color := c;
|
TheTree.Canvas.Pen.Color := c;
|
||||||
TheTree.Canvas.MoveTo(NodeRect.Left+2, NodeRect.Top+2);
|
TheTree.Canvas.MoveTo(NodeRect.Left+2, NodeRect.Top+2);
|
||||||
@ -305,7 +307,8 @@ begin
|
|||||||
FullAbcWidth := FullAbcWidth - 6;
|
FullAbcWidth := FullAbcWidth - 6;
|
||||||
TheTree.Canvas.Brush.Color := Attri.Background;
|
TheTree.Canvas.Brush.Color := Attri.Background;
|
||||||
TheTree.Canvas.FillRect(NodeRect.Left+2, NodeRect.Top+2, NodeRect.Left+FullAbcWidth-2, NodeRect.Bottom-2);
|
TheTree.Canvas.FillRect(NodeRect.Left+2, NodeRect.Top+2, NodeRect.Left+FullAbcWidth-2, NodeRect.Bottom-2);
|
||||||
// exit;
|
if (AttriIdx = ord(ahaCaretColor)) then
|
||||||
|
exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// Draw preview Frame
|
// Draw preview Frame
|
||||||
|
@ -1941,6 +1941,8 @@ resourcestring
|
|||||||
dlgUnsavedLineColor = 'Unsaved line';
|
dlgUnsavedLineColor = 'Unsaved line';
|
||||||
dlgSavedLineColor = 'Saved line';
|
dlgSavedLineColor = 'Saved line';
|
||||||
dlgGutterCollapsedColor = 'Collapsed';
|
dlgGutterCollapsedColor = 'Collapsed';
|
||||||
|
dlgCaretForeColor = 'Color (NotXor)';
|
||||||
|
dlgCaretBackColor = 'Multi/2nd (NotXor)';
|
||||||
dlgElementAttributes = 'Element Attributes';
|
dlgElementAttributes = 'Element Attributes';
|
||||||
dlgEdBold = 'Bold';
|
dlgEdBold = 'Bold';
|
||||||
dlgEdItal = 'Italic';
|
dlgEdItal = 'Italic';
|
||||||
@ -2132,6 +2134,7 @@ resourcestring
|
|||||||
dlgAddHiAttrOutlineLevel10Color = 'Level 10';
|
dlgAddHiAttrOutlineLevel10Color = 'Level 10';
|
||||||
dlgAddHiSpecialVisibleChars = 'Visualized Special Chars';
|
dlgAddHiSpecialVisibleChars = 'Visualized Special Chars';
|
||||||
dlgTopInfoHint = 'Current Class/Proc Hint';
|
dlgTopInfoHint = 'Current Class/Proc Hint';
|
||||||
|
dlgCaretColor = 'Caret';
|
||||||
dlgIfDefBlockInactive = 'Inactive $IFDEF code';
|
dlgIfDefBlockInactive = 'Inactive $IFDEF code';
|
||||||
dlgIfDefBlockActive = 'Active $IFDEF code';
|
dlgIfDefBlockActive = 'Active $IFDEF code';
|
||||||
dlgIfDefBlockTmpActive = 'Included mixed state $IFDEF code';
|
dlgIfDefBlockTmpActive = 'Included mixed state $IFDEF code';
|
||||||
|
@ -63,7 +63,7 @@ type
|
|||||||
ahaTemplateEditOther, ahaSyncroEditCur, ahaSyncroEditSync,
|
ahaTemplateEditOther, ahaSyncroEditCur, ahaSyncroEditSync,
|
||||||
ahaSyncroEditOther, ahaSyncroEditArea, ahaGutterSeparator,
|
ahaSyncroEditOther, ahaSyncroEditArea, ahaGutterSeparator,
|
||||||
ahaGutter, ahaRightMargin, ahaSpecialVisibleChars,
|
ahaGutter, ahaRightMargin, ahaSpecialVisibleChars,
|
||||||
ahaTopInfoHint,
|
ahaTopInfoHint, ahaCaretColor,
|
||||||
ahaIfDefBlockInactive, ahaIfDefBlockActive, ahaIfDefBlockTmpActive,
|
ahaIfDefBlockInactive, ahaIfDefBlockActive, ahaIfDefBlockTmpActive,
|
||||||
ahaIfDefNodeInactive, ahaIfDefNodeActive, ahaIfDefNodeTmpActive,
|
ahaIfDefNodeInactive, ahaIfDefNodeActive, ahaIfDefNodeTmpActive,
|
||||||
ahaIdentComplWindow, ahaIdentComplWindowBorder, ahaIdentComplWindowSelection, ahaIdentComplWindowHighlight,
|
ahaIdentComplWindow, ahaIdentComplWindowBorder, ahaIdentComplWindowSelection, ahaIdentComplWindowHighlight,
|
||||||
|
@ -238,6 +238,7 @@ type
|
|||||||
|
|
||||||
TIDESynEditor = class(TSynEdit)
|
TIDESynEditor = class(TSynEdit)
|
||||||
private
|
private
|
||||||
|
FCaretColor: TColor;
|
||||||
FCaretStamp: Int64;
|
FCaretStamp: Int64;
|
||||||
FMarkupIdentComplWindow: TSynMarkupIdentComplWindow;
|
FMarkupIdentComplWindow: TSynMarkupIdentComplWindow;
|
||||||
FShowTopInfo: boolean;
|
FShowTopInfo: boolean;
|
||||||
@ -266,6 +267,7 @@ type
|
|||||||
function GetOnMultiCaretBeforeCommand: TSynMultiCaretBeforeCommand;
|
function GetOnMultiCaretBeforeCommand: TSynMultiCaretBeforeCommand;
|
||||||
procedure GetTopInfoMarkupForLine(Sender: TObject; {%H-}Line: integer; var Special: boolean;
|
procedure GetTopInfoMarkupForLine(Sender: TObject; {%H-}Line: integer; var Special: boolean;
|
||||||
aMarkup: TSynSelectedColor);
|
aMarkup: TSynSelectedColor);
|
||||||
|
procedure SetCaretColor(AValue: TColor);
|
||||||
procedure SetHighlightUserWordCount(AValue: Integer);
|
procedure SetHighlightUserWordCount(AValue: Integer);
|
||||||
procedure SetOnMultiCaretBeforeCommand(AValue: TSynMultiCaretBeforeCommand);
|
procedure SetOnMultiCaretBeforeCommand(AValue: TSynMultiCaretBeforeCommand);
|
||||||
procedure SetShowTopInfo(AValue: boolean);
|
procedure SetShowTopInfo(AValue: boolean);
|
||||||
@ -309,6 +311,7 @@ type
|
|||||||
property IsInMultiCaretRepeatExecution: Boolean read GetIsInMultiCaretRepeatExecution;
|
property IsInMultiCaretRepeatExecution: Boolean read GetIsInMultiCaretRepeatExecution;
|
||||||
property OnMultiCaretBeforeCommand: TSynMultiCaretBeforeCommand read GetOnMultiCaretBeforeCommand write SetOnMultiCaretBeforeCommand;
|
property OnMultiCaretBeforeCommand: TSynMultiCaretBeforeCommand read GetOnMultiCaretBeforeCommand write SetOnMultiCaretBeforeCommand;
|
||||||
property CaretStamp: Int64 read FCaretStamp;
|
property CaretStamp: Int64 read FCaretStamp;
|
||||||
|
property CaretColor: TColor read FCaretColor write SetCaretColor;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TIDESynHighlighterPasRangeList = class(TSynHighlighterPasRangeList)
|
TIDESynHighlighterPasRangeList = class(TSynHighlighterPasRangeList)
|
||||||
@ -1563,6 +1566,27 @@ begin
|
|||||||
aMarkup.Assign(FTopInfoMarkup);
|
aMarkup.Assign(FTopInfoMarkup);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TIDESynEditor.SetCaretColor(AValue: TColor);
|
||||||
|
begin
|
||||||
|
if FCaretColor = AValue then Exit;
|
||||||
|
FCaretColor := AValue;
|
||||||
|
if (AValue = clDefault) or (AValue = clNone) then begin
|
||||||
|
FScreenCaretPainterClass{%H-} := TSynEditScreenCaretPainterSystem;
|
||||||
|
if ScreenCaret.Painter.ClassType <> TSynEditScreenCaretPainterSystem then begin
|
||||||
|
MultiCaret.ActiveMode := mcmNoCarets; // clear all carets, before changing the caret class
|
||||||
|
ScreenCaret.ChangePainter(TSynEditScreenCaretPainterSystem);
|
||||||
|
end;
|
||||||
|
end
|
||||||
|
else begin
|
||||||
|
FScreenCaretPainterClass{%H-} := TSynEditScreenCaretPainterInternal;
|
||||||
|
if ScreenCaret.Painter.ClassType <> TSynEditScreenCaretPainterInternal then begin
|
||||||
|
MultiCaret.ActiveMode := mcmNoCarets; // clear all carets, before changing the caret class
|
||||||
|
ScreenCaret.ChangePainter(TSynEditScreenCaretPainterInternal);
|
||||||
|
end;
|
||||||
|
TSynEditScreenCaretPainterInternal(ScreenCaret.Painter).Color := AValue;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TIDESynEditor.SetHighlightUserWordCount(AValue: Integer);
|
procedure TIDESynEditor.SetHighlightUserWordCount(AValue: Integer);
|
||||||
var
|
var
|
||||||
m: TSourceSynEditMarkupHighlightAllMulti;
|
m: TSourceSynEditMarkupHighlightAllMulti;
|
||||||
@ -1714,6 +1738,7 @@ var
|
|||||||
MarkupFoldColors: TSynEditMarkupFoldColors;
|
MarkupFoldColors: TSynEditMarkupFoldColors;
|
||||||
begin
|
begin
|
||||||
inherited Create(AOwner);
|
inherited Create(AOwner);
|
||||||
|
FCaretColor := clNone;
|
||||||
FUserWordsList := TFPList.Create;
|
FUserWordsList := TFPList.Create;
|
||||||
FTemplateEdit:=TSynPluginTemplateEdit.Create(Self);
|
FTemplateEdit:=TSynPluginTemplateEdit.Create(Self);
|
||||||
FSyncroEdit := TSynPluginSyncroEdit.Create(Self);
|
FSyncroEdit := TSynPluginSyncroEdit.Create(Self);
|
||||||
|
@ -502,6 +502,7 @@ begin
|
|||||||
try
|
try
|
||||||
// Adjust color captions
|
// Adjust color captions
|
||||||
ForeGroundUseDefaultCheckBox.Caption := dlgForecolor;
|
ForeGroundUseDefaultCheckBox.Caption := dlgForecolor;
|
||||||
|
BackGroundUseDefaultCheckBox.Caption := dlgBackColor;
|
||||||
FrameColorUseDefaultCheckBox.Caption := dlgFrameColor;
|
FrameColorUseDefaultCheckBox.Caption := dlgFrameColor;
|
||||||
if FCurrentColorScheme <> nil then begin
|
if FCurrentColorScheme <> nil then begin
|
||||||
if (FCurrentColorScheme.AttributeByEnum[ahaModifiedLine] <> nil) and
|
if (FCurrentColorScheme.AttributeByEnum[ahaModifiedLine] <> nil) and
|
||||||
@ -514,6 +515,12 @@ begin
|
|||||||
(FCurHighlightElement.StoredName = FCurrentColorScheme.AttributeByEnum[ahaCodeFoldingTree].StoredName)
|
(FCurHighlightElement.StoredName = FCurrentColorScheme.AttributeByEnum[ahaCodeFoldingTree].StoredName)
|
||||||
then begin
|
then begin
|
||||||
FrameColorUseDefaultCheckBox.Caption := dlgGutterCollapsedColor;
|
FrameColorUseDefaultCheckBox.Caption := dlgGutterCollapsedColor;
|
||||||
|
end else
|
||||||
|
if (FCurrentColorScheme.AttributeByEnum[ahaCaretColor] <> nil) and
|
||||||
|
(FCurHighlightElement.StoredName = FCurrentColorScheme.AttributeByEnum[ahaCaretColor].StoredName)
|
||||||
|
then begin
|
||||||
|
ForeGroundUseDefaultCheckBox.Caption := dlgCaretForeColor;
|
||||||
|
BackGroundUseDefaultCheckBox.Caption := dlgCaretBackColor;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user