mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-06 12:47:29 +02:00
IDE, SynEdit: Add option to highlight current line in gutter
This commit is contained in:
parent
7fc68aa656
commit
e323ffce4b
@ -58,6 +58,7 @@ type
|
|||||||
published
|
published
|
||||||
property AutoSize;
|
property AutoSize;
|
||||||
property Color;
|
property Color;
|
||||||
|
property CurrentLineColor;
|
||||||
property Cursor: TCursor read FCursor write FCursor default crDefault;
|
property Cursor: TCursor read FCursor write FCursor default crDefault;
|
||||||
property LeftOffset;
|
property LeftOffset;
|
||||||
property RightOffset;
|
property RightOffset;
|
||||||
@ -89,6 +90,7 @@ type
|
|||||||
property LineOffset: Integer read FLineOffset write SetLineOffset default 0;
|
property LineOffset: Integer read FLineOffset write SetLineOffset default 0;
|
||||||
property LineOnRight: Boolean read FLineOnRight write SetLineOnRight default True;
|
property LineOnRight: Boolean read FLineOnRight write SetLineOnRight default True;
|
||||||
property MarkupInfo;
|
property MarkupInfo;
|
||||||
|
property MarkupInfoCurrentLine;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TSynEditMouseActionsGutter }
|
{ TSynEditMouseActionsGutter }
|
||||||
@ -257,25 +259,47 @@ end;
|
|||||||
|
|
||||||
procedure TSynGutter.Paint(Canvas: TCanvas; Surface:TLazSynGutterArea; AClip: TRect; FirstLine, LastLine: integer);
|
procedure TSynGutter.Paint(Canvas: TCanvas; Surface:TLazSynGutterArea; AClip: TRect; FirstLine, LastLine: integer);
|
||||||
var
|
var
|
||||||
i: integer;
|
aCaretRow: LongInt;
|
||||||
rcLine: TRect;
|
i, t: integer;
|
||||||
|
rcLine, rcClip: TRect;
|
||||||
dc: HDC;
|
dc: HDC;
|
||||||
begin
|
begin
|
||||||
|
aCaretRow := ToIdx(SynEdit.TextXYToScreenXY(SynEdit.CaretXY).Y);
|
||||||
|
if (aCaretRow < FirstLine) or (aCaretRow > LastLine) then
|
||||||
|
aCaretRow := -1;
|
||||||
|
FCaretRow := aCaretRow;
|
||||||
|
|
||||||
Canvas.Brush.Color := Color;
|
Canvas.Brush.Color := Color;
|
||||||
dc := Canvas.Handle;
|
dc := Canvas.Handle;
|
||||||
LCLIntf.SetBkColor(dc, TColorRef(Canvas.Brush.Color));
|
LCLIntf.SetBkColor(dc, TColorRef(Canvas.Brush.Color));
|
||||||
|
|
||||||
|
rcClip := AClip;
|
||||||
|
t := Surface.TextBounds.Top;
|
||||||
// Clear all
|
// Clear all
|
||||||
TextDrawer.BeginDrawing(dc);
|
TextDrawer.BeginDrawing(dc);
|
||||||
TextDrawer.SetBackColor(Color);
|
TextDrawer.SetBackColor(Color);
|
||||||
TextDrawer.SetForeColor(SynEdit.Font.Color);
|
TextDrawer.SetForeColor(SynEdit.Font.Color);
|
||||||
TextDrawer.SetFrameColor(clNone);
|
TextDrawer.SetFrameColor(clNone);
|
||||||
with AClip do
|
if aCaretRow >= 0 then
|
||||||
TextDrawer.ExtTextOut(Left, Top, ETO_OPAQUE, AClip, nil, 0);
|
rcClip.Bottom := t + aCaretRow * SynEdit.LineHeight;
|
||||||
|
with rcClip do
|
||||||
|
TextDrawer.ExtTextOut(Left, Top, ETO_OPAQUE, rcClip, nil, 0);
|
||||||
|
if aCaretRow >= 0 then begin
|
||||||
|
rcClip.top := rcClip.Bottom + SynEdit.LineHeight;
|
||||||
|
rcClip.Bottom := AClip.Bottom;
|
||||||
|
with rcClip do
|
||||||
|
TextDrawer.ExtTextOut(Left, Top, ETO_OPAQUE, rcClip, nil, 0);
|
||||||
|
|
||||||
|
rcClip.Bottom := rcClip.Top;
|
||||||
|
rcClip.top := rcClip.Top - SynEdit.LineHeight;
|
||||||
|
TextDrawer.SetBackColor(MarkupInfoCurLineMerged.Background);
|
||||||
|
with rcClip do
|
||||||
|
TextDrawer.ExtTextOut(Left, Top, ETO_OPAQUE, rcClip, nil, 0);
|
||||||
|
end;
|
||||||
TextDrawer.EndDrawing;
|
TextDrawer.EndDrawing;
|
||||||
|
|
||||||
AClip.Left := Surface.Left + LeftOffset;
|
AClip.Left := Surface.Left + LeftOffset;
|
||||||
AClip.Top := Surface.TextBounds.Top + FirstLine * SynEdit.LineHeight;
|
AClip.Top := t + FirstLine * SynEdit.LineHeight;
|
||||||
|
|
||||||
rcLine := AClip;
|
rcLine := AClip;
|
||||||
rcLine.Right := rcLine.Left;
|
rcLine.Right := rcLine.Left;
|
||||||
@ -435,12 +459,7 @@ end;
|
|||||||
|
|
||||||
procedure TSynGutterSeparator.Paint(Canvas: TCanvas; AClip: TRect; FirstLine, LastLine: integer);
|
procedure TSynGutterSeparator.Paint(Canvas: TCanvas; AClip: TRect; FirstLine, LastLine: integer);
|
||||||
begin
|
begin
|
||||||
if MarkupInfo.Background <> clNone then
|
PaintBackground(Canvas, AClip);
|
||||||
Canvas.Brush.Color := MarkupInfo.Background
|
|
||||||
else
|
|
||||||
Canvas.Brush.Color := Gutter.Color;
|
|
||||||
Canvas.Brush.Style := bsSolid;
|
|
||||||
Canvas.FillRect(AClip);
|
|
||||||
|
|
||||||
if FLineOnRight then begin
|
if FLineOnRight then begin
|
||||||
AClip.Right := Min(AClip.Right, Left + LeftOffset + Width - FLineOffset);
|
AClip.Right := Min(AClip.Right, Left + LeftOffset + Width - FLineOffset);
|
||||||
|
@ -12,7 +12,7 @@ uses
|
|||||||
LazMethodList,
|
LazMethodList,
|
||||||
// SynEdit
|
// SynEdit
|
||||||
SynEditMarks, SynEditMiscClasses, SynTextDrawer, SynEditMouseCmds,
|
SynEditMarks, SynEditMiscClasses, SynTextDrawer, SynEditMouseCmds,
|
||||||
LazSynTextArea;
|
LazSynTextArea, SynEditHighlighter;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
@ -34,7 +34,10 @@ type
|
|||||||
FSide: TSynGutterSide;
|
FSide: TSynGutterSide;
|
||||||
FSynEdit: TSynEditBase;
|
FSynEdit: TSynEditBase;
|
||||||
FTextDrawer: TheTextDrawer;
|
FTextDrawer: TheTextDrawer;
|
||||||
FColor: TColor;
|
FColor: TSynSelectedColor;
|
||||||
|
FCurrentLineColor: TSynHighlighterAttributesModifier;
|
||||||
|
FMarkupInfoCurLineMerged: TSynSelectedColorMergeResult;
|
||||||
|
|
||||||
FLeft, FWidth, FHeight, FTop: Integer;
|
FLeft, FWidth, FHeight, FTop: Integer;
|
||||||
FVisible: boolean;
|
FVisible: boolean;
|
||||||
FAutoSize: boolean;
|
FAutoSize: boolean;
|
||||||
@ -49,9 +52,13 @@ type
|
|||||||
FOnResizeHandler: TMethodList;
|
FOnResizeHandler: TMethodList;
|
||||||
FOnChangeHandler: TMethodList;
|
FOnChangeHandler: TMethodList;
|
||||||
|
|
||||||
|
procedure DoColorChanged(Sender: TObject);
|
||||||
|
procedure UpdateInternalColors;
|
||||||
|
function GetColor: TColor;
|
||||||
function GetMouseActions: TSynEditMouseActions;
|
function GetMouseActions: TSynEditMouseActions;
|
||||||
procedure SetAutoSize(const AValue: boolean);
|
procedure SetAutoSize(const AValue: boolean);
|
||||||
procedure SetColor(const Value: TColor);
|
procedure SetColor(const Value: TColor);
|
||||||
|
procedure SetCurrentLineColor(AValue: TSynHighlighterAttributesModifier);
|
||||||
procedure SetGutterParts(const AValue: TSynGutterPartListBase);
|
procedure SetGutterParts(const AValue: TSynGutterPartListBase);
|
||||||
procedure SetLeftOffset(const AValue: integer);
|
procedure SetLeftOffset(const AValue: integer);
|
||||||
procedure SetMouseActions(const AValue: TSynEditMouseActions);
|
procedure SetMouseActions(const AValue: TSynEditMouseActions);
|
||||||
@ -59,6 +66,7 @@ type
|
|||||||
procedure SetVisible(const AValue: boolean);
|
procedure SetVisible(const AValue: boolean);
|
||||||
procedure SetWidth(Value: integer);
|
procedure SetWidth(Value: integer);
|
||||||
protected
|
protected
|
||||||
|
FCaretRow: integer;
|
||||||
procedure SetChildBounds;
|
procedure SetChildBounds;
|
||||||
procedure DoChange(Sender: TObject);
|
procedure DoChange(Sender: TObject);
|
||||||
procedure DoResize(Sender: TObject);
|
procedure DoResize(Sender: TObject);
|
||||||
@ -73,6 +81,9 @@ type
|
|||||||
procedure Clear;
|
procedure Clear;
|
||||||
function GetOwner: TPersistent; override;
|
function GetOwner: TPersistent; override;
|
||||||
property GutterArea: TLazSynSurfaceWithText read FGutterArea write FGutterArea;
|
property GutterArea: TLazSynSurfaceWithText read FGutterArea write FGutterArea;
|
||||||
|
|
||||||
|
property MarkupInfoCurLineMerged: TSynSelectedColorMergeResult read FMarkupInfoCurLineMerged;
|
||||||
|
property CaretRow: integer read FCaretRow; // vaild only during paint
|
||||||
public
|
public
|
||||||
constructor Create(AOwner : TSynEditBase; ASide: TSynGutterSide; ATextDrawer: TheTextDrawer);
|
constructor Create(AOwner : TSynEditBase; ASide: TSynGutterSide; ATextDrawer: TheTextDrawer);
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
@ -106,7 +117,8 @@ type
|
|||||||
// properties available for the GutterPartClasses
|
// properties available for the GutterPartClasses
|
||||||
property SynEdit: TSynEditBase read FSynEdit;
|
property SynEdit: TSynEditBase read FSynEdit;
|
||||||
property TextDrawer: TheTextDrawer read FTextDrawer;
|
property TextDrawer: TheTextDrawer read FTextDrawer;
|
||||||
property Color: TColor read FColor write SetColor default clBtnFace;
|
property Color: TColor read GetColor write SetColor default clBtnFace;
|
||||||
|
property CurrentLineColor: TSynHighlighterAttributesModifier read FCurrentLineColor write SetCurrentLineColor;
|
||||||
property MouseActions: TSynEditMouseActions
|
property MouseActions: TSynEditMouseActions
|
||||||
read GetMouseActions write SetMouseActions;
|
read GetMouseActions write SetMouseActions;
|
||||||
end;
|
end;
|
||||||
@ -158,17 +170,22 @@ type
|
|||||||
FVisible: Boolean;
|
FVisible: Boolean;
|
||||||
FSynEdit: TSynEditBase;
|
FSynEdit: TSynEditBase;
|
||||||
FGutter: TSynGutterBase;
|
FGutter: TSynGutterBase;
|
||||||
FMarkupInfo: TSynSelectedColor;
|
FMarkupInfo, FMarkupInfoInternal: TSynSelectedColor;
|
||||||
|
FMarkupInfoCurrentLine: TSynHighlighterAttributesModifier;
|
||||||
|
FMarkupInfoCurLineMerged: TSynSelectedColorMergeResult;
|
||||||
FCursor: TCursor;
|
FCursor: TCursor;
|
||||||
FOnChange: TNotifyEvent;
|
FOnChange: TNotifyEvent;
|
||||||
FOnGutterClick: TGutterClickEvent;
|
FOnGutterClick: TGutterClickEvent;
|
||||||
FMouseActions: TSynEditMouseInternalActions;
|
FMouseActions: TSynEditMouseInternalActions;
|
||||||
|
procedure DoColorChanged(Sender: TObject);
|
||||||
|
function GetCaretRow: integer; inline;
|
||||||
function GetFullWidth: integer;
|
function GetFullWidth: integer;
|
||||||
function GetGutterArea: TLazSynSurfaceWithText;
|
function GetGutterArea: TLazSynSurfaceWithText;
|
||||||
function GetGutterParts: TSynGutterPartListBase;
|
function GetGutterParts: TSynGutterPartListBase;
|
||||||
function GetMouseActions: TSynEditMouseActions;
|
function GetMouseActions: TSynEditMouseActions;
|
||||||
procedure SetLeftOffset(AValue: integer);
|
procedure SetLeftOffset(AValue: integer);
|
||||||
procedure SetMarkupInfo(const AValue: TSynSelectedColor);
|
procedure SetMarkupInfo(const AValue: TSynSelectedColor);
|
||||||
|
procedure SetMarkupInfoCurrentLine(AValue: TSynHighlighterAttributesModifier);
|
||||||
procedure SetMouseActions(const AValue: TSynEditMouseActions);
|
procedure SetMouseActions(const AValue: TSynEditMouseActions);
|
||||||
procedure SetRightOffset(AValue: integer);
|
procedure SetRightOffset(AValue: integer);
|
||||||
protected
|
protected
|
||||||
@ -181,6 +198,8 @@ type
|
|||||||
procedure SetAutoSize(const AValue : boolean); virtual;
|
procedure SetAutoSize(const AValue : boolean); virtual;
|
||||||
procedure SetVisible(const AValue : boolean); virtual;
|
procedure SetVisible(const AValue : boolean); virtual;
|
||||||
procedure GutterVisibilityChanged; virtual;
|
procedure GutterVisibilityChanged; virtual;
|
||||||
|
procedure UpdateInternalColors;
|
||||||
|
procedure PaintBackground(Canvas: TCanvas; AClip: TRect);
|
||||||
procedure SetWidth(const AValue : integer); virtual;
|
procedure SetWidth(const AValue : integer); virtual;
|
||||||
procedure Init; override;
|
procedure Init; override;
|
||||||
procedure VisibilityOrSize(aCallDoChange: Boolean = False);
|
procedure VisibilityOrSize(aCallDoChange: Boolean = False);
|
||||||
@ -190,6 +209,9 @@ type
|
|||||||
property Gutter: TSynGutterBase read FGutter;
|
property Gutter: TSynGutterBase read FGutter;
|
||||||
property SynEdit:TSynEditBase read FSynEdit;
|
property SynEdit:TSynEditBase read FSynEdit;
|
||||||
property GutterArea: TLazSynSurfaceWithText read GetGutterArea;
|
property GutterArea: TLazSynSurfaceWithText read GetGutterArea;
|
||||||
|
property MarkupInfoInternal: TSynSelectedColor read FMarkupInfoInternal;
|
||||||
|
property MarkupInfoCurLineMerged: TSynSelectedColorMergeResult read FMarkupInfoCurLineMerged;
|
||||||
|
property CaretRow: integer read GetCaretRow;
|
||||||
public
|
public
|
||||||
constructor Create(AOwner: TComponent); override;
|
constructor Create(AOwner: TComponent); override;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
@ -217,6 +239,7 @@ type
|
|||||||
property OnChange: TNotifyEvent read FOnChange write FOnChange;
|
property OnChange: TNotifyEvent read FOnChange write FOnChange;
|
||||||
property Cursor: TCursor read FCursor write FCursor default crDefault;
|
property Cursor: TCursor read FCursor write FCursor default crDefault;
|
||||||
property MarkupInfo: TSynSelectedColor read FMarkupInfo write SetMarkupInfo;
|
property MarkupInfo: TSynSelectedColor read FMarkupInfo write SetMarkupInfo;
|
||||||
|
property MarkupInfoCurrentLine: TSynHighlighterAttributesModifier read FMarkupInfoCurrentLine write SetMarkupInfoCurrentLine;
|
||||||
published
|
published
|
||||||
property AutoSize: boolean read FAutoSize write SetAutoSize default True;
|
property AutoSize: boolean read FAutoSize write SetAutoSize default True;
|
||||||
property Width: integer read FWidth write SetWidth default 10;
|
property Width: integer read FWidth write SetWidth default 10;
|
||||||
@ -242,6 +265,13 @@ begin
|
|||||||
FOnResizeHandler := TMethodList.Create;
|
FOnResizeHandler := TMethodList.Create;
|
||||||
FOnChangeHandler := TMethodList.Create;
|
FOnChangeHandler := TMethodList.Create;
|
||||||
|
|
||||||
|
FColor := TSynSelectedColor.Create;
|
||||||
|
FColor.OnChange := @DoColorChanged;
|
||||||
|
|
||||||
|
FCurrentLineColor := TSynHighlighterAttributesModifier.Create;
|
||||||
|
FCurrentLineColor.OnChange := @DoColorChanged;
|
||||||
|
FMarkupInfoCurLineMerged := TSynSelectedColorMergeResult.Create;
|
||||||
|
|
||||||
inherited Create;
|
inherited Create;
|
||||||
FSide := ASide;
|
FSide := ASide;
|
||||||
FSynEdit := AOwner;
|
FSynEdit := AOwner;
|
||||||
@ -255,7 +285,7 @@ begin
|
|||||||
FWidth := -1;
|
FWidth := -1;
|
||||||
FLeftOffset := 0;
|
FLeftOffset := 0;
|
||||||
FRightOffset := 0;
|
FRightOffset := 0;
|
||||||
FColor := clBtnFace;
|
Color := clBtnFace;
|
||||||
FVisible := True;
|
FVisible := True;
|
||||||
AutoSize := True;
|
AutoSize := True;
|
||||||
end;
|
end;
|
||||||
@ -268,6 +298,9 @@ begin
|
|||||||
FreeAndNil(FMouseActions);
|
FreeAndNil(FMouseActions);
|
||||||
FreeAndNil(FOnChangeHandler);
|
FreeAndNil(FOnChangeHandler);
|
||||||
FreeAndNil(FOnResizeHandler);
|
FreeAndNil(FOnResizeHandler);
|
||||||
|
FreeAndNil(FMarkupInfoCurLineMerged);
|
||||||
|
FreeAndNil(FCurrentLineColor);
|
||||||
|
FreeAndNil(FColor);
|
||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -278,7 +311,8 @@ begin
|
|||||||
IncChangeLock;
|
IncChangeLock;
|
||||||
try
|
try
|
||||||
FGutterPartList.Assign(TSynGutterBase(Source).FGutterPartList);
|
FGutterPartList.Assign(TSynGutterBase(Source).FGutterPartList);
|
||||||
Color := TSynGutterBase(Source).FColor;
|
Color := TSynGutterBase(Source).Color;
|
||||||
|
CurrentLineColor := TSynGutterBase(Source).FCurrentLineColor;
|
||||||
Visible := TSynGutterBase(Source).FVisible;
|
Visible := TSynGutterBase(Source).FVisible;
|
||||||
AutoSize := TSynGutterBase(Source).FAutoSize;
|
AutoSize := TSynGutterBase(Source).FAutoSize;
|
||||||
Width := TSynGutterBase(Source).FWidth;
|
Width := TSynGutterBase(Source).FWidth;
|
||||||
@ -366,12 +400,19 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TSynGutterBase.SetColor(const Value: TColor);
|
procedure TSynGutterBase.SetColor(const Value: TColor);
|
||||||
|
var
|
||||||
|
i: Integer;
|
||||||
begin
|
begin
|
||||||
if FColor <> Value then
|
if FColor.Background = Value then
|
||||||
begin
|
exit;
|
||||||
FColor := Value;
|
FColor.Background := Value;
|
||||||
DoChange(Self);
|
end;
|
||||||
end;
|
|
||||||
|
procedure TSynGutterBase.SetCurrentLineColor(AValue: TSynHighlighterAttributesModifier);
|
||||||
|
var
|
||||||
|
i: Integer;
|
||||||
|
begin
|
||||||
|
FCurrentLineColor.Assign(AValue);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TSynGutterBase.SetAutoSize(const AValue: boolean);
|
procedure TSynGutterBase.SetAutoSize(const AValue: boolean);
|
||||||
@ -387,6 +428,29 @@ begin
|
|||||||
Result := FMouseActions.UserActions;
|
Result := FMouseActions.UserActions;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TSynGutterBase.GetColor: TColor;
|
||||||
|
begin
|
||||||
|
Result := FColor.Background;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TSynGutterBase.DoColorChanged(Sender: TObject);
|
||||||
|
begin
|
||||||
|
UpdateInternalColors;
|
||||||
|
DoChange(Self);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TSynGutterBase.UpdateInternalColors;
|
||||||
|
var
|
||||||
|
i: Integer;
|
||||||
|
begin
|
||||||
|
FMarkupInfoCurLineMerged.Clear;
|
||||||
|
FMarkupInfoCurLineMerged.Assign(FColor);
|
||||||
|
FMarkupInfoCurLineMerged.Merge(FCurrentLineColor);
|
||||||
|
FMarkupInfoCurLineMerged.ProcessMergeInfo;
|
||||||
|
for i := 0 to PartCount - 1 do
|
||||||
|
Parts[i].UpdateInternalColors;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TSynGutterBase.SetGutterParts(const AValue: TSynGutterPartListBase);
|
procedure TSynGutterBase.SetGutterParts(const AValue: TSynGutterPartListBase);
|
||||||
begin
|
begin
|
||||||
FGutterPartList.Assign(AValue);
|
FGutterPartList.Assign(AValue);
|
||||||
@ -606,11 +670,28 @@ begin
|
|||||||
Result := FWidth + FLeftOffset + FRightOffset;
|
Result := FWidth + FLeftOffset + FRightOffset;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TSynGutterPartBase.DoColorChanged(Sender: TObject);
|
||||||
|
begin
|
||||||
|
UpdateInternalColors;
|
||||||
|
DoChange(Self);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TSynGutterPartBase.GetCaretRow: integer;
|
||||||
|
begin
|
||||||
|
Result := Gutter.CaretRow;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TSynGutterPartBase.SetMarkupInfo(const AValue: TSynSelectedColor);
|
procedure TSynGutterPartBase.SetMarkupInfo(const AValue: TSynSelectedColor);
|
||||||
begin
|
begin
|
||||||
FMarkupInfo.Assign(AValue);
|
FMarkupInfo.Assign(AValue);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TSynGutterPartBase.SetMarkupInfoCurrentLine(AValue: TSynHighlighterAttributesModifier);
|
||||||
|
begin
|
||||||
|
if FMarkupInfoCurrentLine = AValue then Exit;
|
||||||
|
FMarkupInfoCurrentLine.Assign(AValue);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TSynGutterPartBase.SetMouseActions(const AValue: TSynEditMouseActions);
|
procedure TSynGutterPartBase.SetMouseActions(const AValue: TSynEditMouseActions);
|
||||||
begin
|
begin
|
||||||
FMouseActions.UserActions := AValue;
|
FMouseActions.UserActions := AValue;
|
||||||
@ -678,6 +759,44 @@ begin
|
|||||||
//
|
//
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TSynGutterPartBase.UpdateInternalColors;
|
||||||
|
begin
|
||||||
|
if Gutter = nil then
|
||||||
|
exit;
|
||||||
|
FMarkupInfoInternal.Assign(FMarkupInfo);
|
||||||
|
if FMarkupInfoInternal.Background = clNone then
|
||||||
|
FMarkupInfoInternal.Background := Gutter.Color;
|
||||||
|
if FMarkupInfoInternal.Foreground = clNone then
|
||||||
|
FMarkupInfoInternal.Foreground := SynEdit.Font.Color;
|
||||||
|
|
||||||
|
FMarkupInfoCurLineMerged.Clear;
|
||||||
|
FMarkupInfoCurLineMerged.Assign(FMarkupInfoInternal);
|
||||||
|
FMarkupInfoCurLineMerged.Merge(Gutter.FCurrentLineColor);
|
||||||
|
FMarkupInfoCurLineMerged.Merge(MarkupInfoCurrentLine);
|
||||||
|
FMarkupInfoCurLineMerged.ProcessMergeInfo;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TSynGutterPartBase.PaintBackground(Canvas: TCanvas; AClip: TRect);
|
||||||
|
var
|
||||||
|
t: Integer;
|
||||||
|
begin
|
||||||
|
if MarkupInfo.Background <> clNone then
|
||||||
|
begin
|
||||||
|
Canvas.Brush.Color := MarkupInfo.Background;
|
||||||
|
LCLIntf.SetBkColor(Canvas.Handle, TColorRef(Canvas.Brush.Color));
|
||||||
|
Canvas.FillRect(AClip);
|
||||||
|
end;
|
||||||
|
if (MarkupInfoCurLineMerged.Background <> clNone) and (CaretRow >= 0) then
|
||||||
|
begin
|
||||||
|
t := GutterArea.Top;
|
||||||
|
aClip.Top := t + CaretRow * SynEdit.LineHeight;
|
||||||
|
AClip.Bottom := AClip.Top + SynEdit.LineHeight;
|
||||||
|
Canvas.Brush.Color := MarkupInfoCurLineMerged.Background;
|
||||||
|
LCLIntf.SetBkColor(Canvas.Handle, TColorRef(Canvas.Brush.Color));
|
||||||
|
Canvas.FillRect(AClip);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TSynGutterPartBase.SetWidth(const AValue : integer);
|
procedure TSynGutterPartBase.SetWidth(const AValue : integer);
|
||||||
begin
|
begin
|
||||||
if (FWidth=AValue) or ((FAutoSize) and not(csLoading in ComponentState)) then exit;
|
if (FWidth=AValue) or ((FAutoSize) and not(csLoading in ComponentState)) then exit;
|
||||||
@ -709,7 +828,14 @@ begin
|
|||||||
FMarkupInfo.Background := clBtnFace;
|
FMarkupInfo.Background := clBtnFace;
|
||||||
FMarkupInfo.Foreground := clNone;
|
FMarkupInfo.Foreground := clNone;
|
||||||
FMarkupInfo.FrameColor := clNone;
|
FMarkupInfo.FrameColor := clNone;
|
||||||
FMarkupInfo.OnChange := @DoChange;
|
|
||||||
|
FMarkupInfoCurrentLine := TSynHighlighterAttributesModifier.Create;
|
||||||
|
FMarkupInfoCurrentLine.Background := clNone;
|
||||||
|
FMarkupInfoCurrentLine.Foreground := clNone;
|
||||||
|
FMarkupInfoCurrentLine.FrameColor := clNone;
|
||||||
|
|
||||||
|
FMarkupInfoInternal := TSynSelectedColor.Create;
|
||||||
|
FMarkupInfoCurLineMerged := TSynSelectedColorMergeResult.Create;
|
||||||
|
|
||||||
FMouseActions := CreateMouseActions;
|
FMouseActions := CreateMouseActions;
|
||||||
|
|
||||||
@ -718,6 +844,10 @@ begin
|
|||||||
FLeftOffset := 0;
|
FLeftOffset := 0;
|
||||||
FRightOffset := 0;
|
FRightOffset := 0;
|
||||||
Inherited Create(AOwner); // Todo: Lock the DoChange from RegisterItem, and call DoChange at the end (after/in autosize)
|
Inherited Create(AOwner); // Todo: Lock the DoChange from RegisterItem, and call DoChange at the end (after/in autosize)
|
||||||
|
|
||||||
|
FMarkupInfo.OnChange := @DoColorChanged;
|
||||||
|
FMarkupInfoCurrentLine.OnChange := @DoColorChanged;
|
||||||
|
UpdateInternalColors;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TSynGutterPartBase.Init;
|
procedure TSynGutterPartBase.Init;
|
||||||
@ -752,7 +882,10 @@ destructor TSynGutterPartBase.Destroy;
|
|||||||
begin
|
begin
|
||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
FreeAndNil(FMouseActions);
|
FreeAndNil(FMouseActions);
|
||||||
|
FreeAndNil(FMarkupInfoCurLineMerged);
|
||||||
FreeAndNil(FMarkupInfo);
|
FreeAndNil(FMarkupInfo);
|
||||||
|
FreeAndNil(FMarkupInfoInternal);
|
||||||
|
FreeAndNil(FMarkupInfoCurrentLine);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TSynGutterPartBase.Assign(Source : TPersistent);
|
procedure TSynGutterPartBase.Assign(Source : TPersistent);
|
||||||
@ -766,6 +899,8 @@ begin
|
|||||||
FWidth := Src.FWidth;
|
FWidth := Src.FWidth;
|
||||||
FAutoSize := Src.FAutoSize;
|
FAutoSize := Src.FAutoSize;
|
||||||
MarkupInfo.Assign(Src.MarkupInfo);
|
MarkupInfo.Assign(Src.MarkupInfo);
|
||||||
|
MarkupInfoCurrentLine.Assign(Src.MarkupInfoCurrentLine);
|
||||||
|
UpdateInternalColors;
|
||||||
DoChange(Self);
|
DoChange(Self);
|
||||||
// Todo, maybe on Resize?
|
// Todo, maybe on Resize?
|
||||||
end else
|
end else
|
||||||
@ -779,7 +914,9 @@ var
|
|||||||
begin
|
begin
|
||||||
if not Visible then exit;
|
if not Visible then exit;
|
||||||
|
|
||||||
if MarkupInfo.Background = clNone then
|
if (MarkupInfo.Background = clNone) and
|
||||||
|
( (MarkupInfoCurLineMerged.Background = clNone) or (CaretRow < 0))
|
||||||
|
then
|
||||||
begin
|
begin
|
||||||
Paint(Canvas, AClip, FirstLine, LastLine);
|
Paint(Canvas, AClip, FirstLine, LastLine);
|
||||||
exit;
|
exit;
|
||||||
@ -789,20 +926,14 @@ begin
|
|||||||
OffsRect := AClip;
|
OffsRect := AClip;
|
||||||
OffsRect.Left := FLeft;
|
OffsRect.Left := FLeft;
|
||||||
OffsRect.Right := FLeft + FLeftOffset;
|
OffsRect.Right := FLeft + FLeftOffset;
|
||||||
|
PaintBackground(Canvas, OffsRect);
|
||||||
Canvas.Brush.Color := MarkupInfo.Background;
|
|
||||||
LCLIntf.SetBkColor(Canvas.Handle, TColorRef(Canvas.Brush.Color));
|
|
||||||
Canvas.FillRect(OffsRect);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if FRightOffset > 0 then begin
|
if FRightOffset > 0 then begin
|
||||||
OffsRect := AClip;
|
OffsRect := AClip;
|
||||||
OffsRect.Right := FLeft + FullWidth;
|
OffsRect.Right := FLeft + FullWidth;
|
||||||
OffsRect.Left := OffsRect.Right - FRightOffset;
|
OffsRect.Left := OffsRect.Right - FRightOffset;
|
||||||
|
PaintBackground(Canvas, OffsRect);
|
||||||
Canvas.Brush.Color := MarkupInfo.Background;
|
|
||||||
LCLIntf.SetBkColor(Canvas.Handle, TColorRef(Canvas.Brush.Color));
|
|
||||||
Canvas.FillRect(OffsRect);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
AClip.Left := AClip.Left + FLeftOffset;
|
AClip.Left := AClip.Left + FLeftOffset;
|
||||||
|
@ -26,6 +26,7 @@ type
|
|||||||
published
|
published
|
||||||
property ModifiedColor: TColor read GetModifiedColor write SetModifiedColor;
|
property ModifiedColor: TColor read GetModifiedColor write SetModifiedColor;
|
||||||
property SavedColor: TColor read GetSavedColor write SetSavedColor;
|
property SavedColor: TColor read GetSavedColor write SetSavedColor;
|
||||||
|
property MarkupInfoCurrentLine;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
@ -84,11 +85,7 @@ begin
|
|||||||
c := SynEdit.Lines.Count;
|
c := SynEdit.Lines.Count;
|
||||||
t := ToIdx(GutterArea.TextArea.TopLine);
|
t := ToIdx(GutterArea.TextArea.TopLine);
|
||||||
|
|
||||||
if MarkupInfo.Background <> clNone then
|
PaintBackground(Canvas, AClip);
|
||||||
begin
|
|
||||||
Canvas.Brush.Color := MarkupInfo.Background;
|
|
||||||
Canvas.FillRect(AClip);
|
|
||||||
end;
|
|
||||||
|
|
||||||
Canvas.Pen.Width := Width;
|
Canvas.Pen.Width := Width;
|
||||||
Canvas.Pen.EndCap:= pecFlat;
|
Canvas.Pen.EndCap:= pecFlat;
|
||||||
|
@ -114,6 +114,7 @@ type
|
|||||||
procedure ResetMouseActions; override; // set mouse-actions according to current Options / may clear them
|
procedure ResetMouseActions; override; // set mouse-actions according to current Options / may clear them
|
||||||
published
|
published
|
||||||
property MarkupInfo;
|
property MarkupInfo;
|
||||||
|
property MarkupInfoCurrentLine;
|
||||||
property MouseActionsExpanded: TSynEditMouseActions
|
property MouseActionsExpanded: TSynEditMouseActions
|
||||||
read GetMouseActionsExpanded write SetMouseActionsExpanded;
|
read GetMouseActionsExpanded write SetMouseActionsExpanded;
|
||||||
property MouseActionsCollapsed: TSynEditMouseActions
|
property MouseActionsCollapsed: TSynEditMouseActions
|
||||||
@ -737,12 +738,7 @@ begin
|
|||||||
LineOffset := 2;
|
LineOffset := 2;
|
||||||
HalfBoxSize := Min(Width, LineHeight - cNodeOffset*2) div 2;
|
HalfBoxSize := Min(Width, LineHeight - cNodeOffset*2) div 2;
|
||||||
|
|
||||||
if MarkupInfo.Background <> clNone then
|
PaintBackground(Canvas, AClip);
|
||||||
begin
|
|
||||||
Canvas.Brush.Color := MarkupInfo.Background;
|
|
||||||
LCLIntf.SetBkColor(Canvas.Handle, TColorRef(Canvas.Brush.Color));
|
|
||||||
Canvas.FillRect(AClip);
|
|
||||||
end;
|
|
||||||
|
|
||||||
with Canvas do
|
with Canvas do
|
||||||
begin
|
begin
|
||||||
|
@ -59,6 +59,7 @@ type
|
|||||||
override;
|
override;
|
||||||
published
|
published
|
||||||
property MarkupInfo;
|
property MarkupInfo;
|
||||||
|
property MarkupInfoCurrentLine;
|
||||||
property DigitCount: integer read FDigitCount write SetDigitCount;
|
property DigitCount: integer read FDigitCount write SetDigitCount;
|
||||||
property ShowOnlyLineNumbersMultiplesOf: integer
|
property ShowOnlyLineNumbersMultiplesOf: integer
|
||||||
read FShowOnlyLineNumbersMultiplesOf write SetShowOnlyLineNumbersMultiplesOf;
|
read FShowOnlyLineNumbersMultiplesOf write SetShowOnlyLineNumbersMultiplesOf;
|
||||||
@ -248,24 +249,13 @@ begin
|
|||||||
// Changed to use fTextDrawer.BeginDrawing and fTextDrawer.EndDrawing only
|
// Changed to use fTextDrawer.BeginDrawing and fTextDrawer.EndDrawing only
|
||||||
// when absolutely necessary. Note: Never change brush / pen / font of the
|
// when absolutely necessary. Note: Never change brush / pen / font of the
|
||||||
// canvas inside of this block (only through methods of fTextDrawer)!
|
// canvas inside of this block (only through methods of fTextDrawer)!
|
||||||
if MarkupInfo.Background <> clNone then
|
|
||||||
Canvas.Brush.Color := MarkupInfo.Background
|
|
||||||
else
|
|
||||||
Canvas.Brush.Color := Gutter.Color;
|
|
||||||
dc := Canvas.Handle;
|
dc := Canvas.Handle;
|
||||||
LCLIntf.SetBkColor(dc, TColorRef(Canvas.Brush.Color));
|
|
||||||
FTextDrawer.BeginDrawing(dc);
|
FTextDrawer.BeginDrawing(dc);
|
||||||
try
|
try
|
||||||
if MarkupInfo.Background <> clNone then
|
FTextDrawer.SetBackColor(MarkupInfoInternal.Background);
|
||||||
FTextDrawer.SetBackColor(MarkupInfo.Background)
|
fTextDrawer.SetForeColor(MarkupInfoInternal.Foreground);
|
||||||
else
|
fTextDrawer.SetFrameColor(MarkupInfoInternal.FrameColor);
|
||||||
FTextDrawer.SetBackColor(Gutter.Color);
|
fTextDrawer.Style := MarkupInfoInternal.Style;
|
||||||
if MarkupInfo.Foreground <> clNone then
|
|
||||||
fTextDrawer.SetForeColor(MarkupInfo.Foreground)
|
|
||||||
else
|
|
||||||
fTextDrawer.SetForeColor(SynEdit.Font.Color);
|
|
||||||
fTextDrawer.SetFrameColor(MarkupInfo.FrameColor);
|
|
||||||
fTextDrawer.Style := MarkupInfo.Style;
|
|
||||||
// prepare the rect initially
|
// prepare the rect initially
|
||||||
rcLine := AClip;
|
rcLine := AClip;
|
||||||
rcLine.Bottom := AClip.Top;
|
rcLine.Bottom := AClip.Top;
|
||||||
@ -294,6 +284,19 @@ begin
|
|||||||
if i <> LineInfo.LineRange.Top then
|
if i <> LineInfo.LineRange.Top then
|
||||||
s := '';
|
s := '';
|
||||||
// erase the background and draw the line number string in one go
|
// erase the background and draw the line number string in one go
|
||||||
|
if i - t = CaretRow then begin
|
||||||
|
FTextDrawer.SetBackColor(MarkupInfoCurLineMerged.Background);
|
||||||
|
fTextDrawer.SetForeColor(MarkupInfoCurLineMerged.Foreground);
|
||||||
|
fTextDrawer.SetFrameColor(MarkupInfoCurLineMerged.FrameColor);
|
||||||
|
fTextDrawer.Style := MarkupInfoCurLineMerged.Style;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
if i - t = CaretRow+1 then begin
|
||||||
|
FTextDrawer.SetBackColor(MarkupInfoInternal.Background);
|
||||||
|
fTextDrawer.SetForeColor(MarkupInfoInternal.Foreground);
|
||||||
|
fTextDrawer.SetFrameColor(MarkupInfoInternal.FrameColor);
|
||||||
|
fTextDrawer.Style := MarkupInfoInternal.Style;
|
||||||
|
end;
|
||||||
fTextDrawer.ExtTextOut(rcLine.Left, rcLine.Top, ETO_OPAQUE or ETO_CLIPPED, rcLine,
|
fTextDrawer.ExtTextOut(rcLine.Left, rcLine.Top, ETO_OPAQUE or ETO_CLIPPED, rcLine,
|
||||||
PChar(Pointer(S)),Length(S));
|
PChar(Pointer(S)),Length(S));
|
||||||
end;
|
end;
|
||||||
@ -301,6 +304,10 @@ begin
|
|||||||
// now erase the remaining area if any
|
// now erase the remaining area if any
|
||||||
if AClip.Bottom > rcLine.Bottom then
|
if AClip.Bottom > rcLine.Bottom then
|
||||||
begin
|
begin
|
||||||
|
FTextDrawer.SetBackColor(MarkupInfoInternal.Background);
|
||||||
|
fTextDrawer.SetForeColor(MarkupInfoInternal.Foreground);
|
||||||
|
fTextDrawer.SetFrameColor(MarkupInfoInternal.FrameColor);
|
||||||
|
fTextDrawer.Style := MarkupInfoInternal.Style;
|
||||||
rcLine.Top := rcLine.Bottom;
|
rcLine.Top := rcLine.Bottom;
|
||||||
rcLine.Bottom := AClip.Bottom;
|
rcLine.Bottom := AClip.Bottom;
|
||||||
with rcLine do
|
with rcLine do
|
||||||
|
@ -42,6 +42,8 @@ type
|
|||||||
property DebugMarksImageIndex: Integer read FDebugMarksImageIndex write FDebugMarksImageIndex;
|
property DebugMarksImageIndex: Integer read FDebugMarksImageIndex write FDebugMarksImageIndex;
|
||||||
property ColumnWidth: Integer read FColumnWidth; // initialized in Paint
|
property ColumnWidth: Integer read FColumnWidth; // initialized in Paint
|
||||||
property ColumnCount: Integer read FColumnCount;
|
property ColumnCount: Integer read FColumnCount;
|
||||||
|
published
|
||||||
|
property MarkupInfoCurrentLine;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
@ -225,11 +227,7 @@ var
|
|||||||
rcLine: TRect;
|
rcLine: TRect;
|
||||||
begin
|
begin
|
||||||
if not Visible then exit;
|
if not Visible then exit;
|
||||||
if MarkupInfo.Background <> clNone then
|
PaintBackground(Canvas, AClip);
|
||||||
Canvas.Brush.Color := MarkupInfo.Background
|
|
||||||
else
|
|
||||||
Canvas.Brush.Color := Gutter.Color;
|
|
||||||
LCLIntf.SetBkColor(Canvas.Handle, TColorRef(Canvas.Brush.Color));
|
|
||||||
|
|
||||||
if assigned(FBookMarkOpt) and assigned(FBookMarkOpt.BookmarkImages) then
|
if assigned(FBookMarkOpt) and assigned(FBookMarkOpt.BookmarkImages) then
|
||||||
FColumnWidth := GetImgListRes(Canvas, FBookMarkOpt.BookmarkImages).Width
|
FColumnWidth := GetImgListRes(Canvas, FBookMarkOpt.BookmarkImages).Width
|
||||||
|
@ -40,7 +40,7 @@ interface
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
// RTL, FCL
|
// RTL, FCL
|
||||||
Classes, SysUtils, typinfo, fgl, resource,
|
Classes, SysUtils, typinfo, fgl, Math, resource,
|
||||||
// LCL
|
// LCL
|
||||||
Graphics, LResources, Forms, Dialogs, ComCtrls, LCLType, Controls,
|
Graphics, LResources, Forms, Dialogs, ComCtrls, LCLType, Controls,
|
||||||
// LazUtils
|
// LazUtils
|
||||||
@ -132,6 +132,7 @@ const
|
|||||||
'', // ahaSpecialVisibleChars
|
'', // ahaSpecialVisibleChars
|
||||||
'', // ahaTopInfoHint
|
'', // ahaTopInfoHint
|
||||||
'', '', // ahaCaretColor, ahaOverviewGutter
|
'', '', // ahaCaretColor, ahaOverviewGutter
|
||||||
|
'', '', // ahaGutterCurrentLine, ahaGutterNumberCurrentLine
|
||||||
'', '', '', // ahaIfDefBlockInactive, ahaIfDefBlockActive, ahaIfDefBlockTmpActive
|
'', '', '', // ahaIfDefBlockInactive, ahaIfDefBlockActive, ahaIfDefBlockTmpActive
|
||||||
'', '', '', // ahaIfDefNodeInactive, ahaIfDefNodeActive, ahaIfDefNodeTmpActive
|
'', '', '', // ahaIfDefNodeInactive, ahaIfDefNodeActive, ahaIfDefNodeTmpActive
|
||||||
'', '', '', '', '', // ahaIdentComplWindow, ahaIdentComplWindowBorder, ahaIdentComplRecent, ahaIdentComplWindowSelection, ahaIdentComplWindowHighlight
|
'', '', '', '', '', // ahaIdentComplWindow, ahaIdentComplWindowBorder, ahaIdentComplRecent, ahaIdentComplWindowSelection, ahaIdentComplWindowHighlight
|
||||||
@ -174,6 +175,8 @@ const
|
|||||||
{ ahaTopInfoHint } agnLine,
|
{ ahaTopInfoHint } agnLine,
|
||||||
{ ahaCaretColor } agnText,
|
{ ahaCaretColor } agnText,
|
||||||
{ ahaOverviewGutter } agnGutter,
|
{ ahaOverviewGutter } agnGutter,
|
||||||
|
{ ahaGutterCurrentLine } agnGutter,
|
||||||
|
{ ahaGutterNumberCurrentLine } agnGutter,
|
||||||
{ ahaIfDefBlockInactive } agnIfDef,
|
{ ahaIfDefBlockInactive } agnIfDef,
|
||||||
{ ahaIfDefBlockActive } agnIfDef,
|
{ ahaIfDefBlockActive } agnIfDef,
|
||||||
{ ahaIfDefBlockTmpActive } agnIfDef,
|
{ ahaIfDefBlockTmpActive } agnIfDef,
|
||||||
@ -234,6 +237,8 @@ const
|
|||||||
{ ahaTopInfoHint } [hafBackColor, hafForeColor, hafFrameColor, hafAlpha, hafPrior, hafFrameStyle, hafFrameEdges, hafStyle, hafStyleMask],
|
{ ahaTopInfoHint } [hafBackColor, hafForeColor, hafFrameColor, hafAlpha, hafPrior, hafFrameStyle, hafFrameEdges, hafStyle, hafStyleMask],
|
||||||
{ ahaCaretColor } [hafBackColor, hafForeColor],
|
{ ahaCaretColor } [hafBackColor, hafForeColor],
|
||||||
{ ahaOverviewGutter } [hafBackColor, hafForeColor, hafFrameColor],
|
{ ahaOverviewGutter } [hafBackColor, hafForeColor, hafFrameColor],
|
||||||
|
{ ahaGutterCurrentLine } [hafBackColor],
|
||||||
|
{ ahaGutterNumberCurrentLine } [hafBackColor, hafForeColor, hafFrameColor, hafStyle],
|
||||||
{ 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],
|
||||||
@ -1467,6 +1472,8 @@ type
|
|||||||
|
|
||||||
TEditorOptsScrollPastEolMode = (optScrollFixed, optScrollPage, optScrollNone);
|
TEditorOptsScrollPastEolMode = (optScrollFixed, optScrollPage, optScrollNone);
|
||||||
|
|
||||||
|
TEditorSynGutterOptsLineColor = (glcOff, glcOn, glcLineNum);
|
||||||
|
|
||||||
{ TEditorSynGutterOptions }
|
{ TEditorSynGutterOptions }
|
||||||
|
|
||||||
TEditorSynGutterOptions = class(TPersistent)
|
TEditorSynGutterOptions = class(TPersistent)
|
||||||
@ -1476,6 +1483,7 @@ type
|
|||||||
FIndex: integer;
|
FIndex: integer;
|
||||||
FOffsetLeft: integer;
|
FOffsetLeft: integer;
|
||||||
FOffsetRight: integer;
|
FOffsetRight: integer;
|
||||||
|
FShowLineColor: TEditorSynGutterOptsLineColor;
|
||||||
FVisible: boolean;
|
FVisible: boolean;
|
||||||
FWidth: integer;
|
FWidth: integer;
|
||||||
protected
|
protected
|
||||||
@ -1485,6 +1493,7 @@ type
|
|||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
procedure Assign(Source: TPersistent); override;
|
procedure Assign(Source: TPersistent); override;
|
||||||
procedure ApplyTo(AGutterPart: TSynGutterPartBase);
|
procedure ApplyTo(AGutterPart: TSynGutterPartBase);
|
||||||
|
procedure ApplyLineColorTo(AGutterPart: TSynGutterPartBase; Attri, NumAttri: TColorSchemeAttribute);
|
||||||
procedure ApplyIndexTo(AGutterPart: TSynGutterPartBase);
|
procedure ApplyIndexTo(AGutterPart: TSynGutterPartBase);
|
||||||
|
|
||||||
property Defaults: TEditorSynGutterOptions read FDefaults;
|
property Defaults: TEditorSynGutterOptions read FDefaults;
|
||||||
@ -1495,6 +1504,7 @@ type
|
|||||||
property Width: integer read FWidth write FWidth;
|
property Width: integer read FWidth write FWidth;
|
||||||
property OffsetLeft: integer read FOffsetLeft write FOffsetLeft;
|
property OffsetLeft: integer read FOffsetLeft write FOffsetLeft;
|
||||||
property OffsetRight: integer read FOffsetRight write FOffsetRight;
|
property OffsetRight: integer read FOffsetRight write FOffsetRight;
|
||||||
|
property ShowLineColor: TEditorSynGutterOptsLineColor read FShowLineColor write FShowLineColor;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TEditorSynGutterOptionsList }
|
{ TEditorSynGutterOptionsList }
|
||||||
@ -2217,6 +2227,7 @@ begin
|
|||||||
FGClass := AGClass;
|
FGClass := AGClass;
|
||||||
FIndex := AIdx;
|
FIndex := AIdx;
|
||||||
FVisible := True;
|
FVisible := True;
|
||||||
|
FShowLineColor := glcOn;
|
||||||
|
|
||||||
if FGClass = TSynGutterMarks then begin
|
if FGClass = TSynGutterMarks then begin
|
||||||
FWidth := 2;
|
FWidth := 2;
|
||||||
@ -2224,6 +2235,15 @@ begin
|
|||||||
else
|
else
|
||||||
if FGClass = TSynGutterLineNumber then begin
|
if FGClass = TSynGutterLineNumber then begin
|
||||||
FWidth := 2;
|
FWidth := 2;
|
||||||
|
FShowLineColor := glcLineNum;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
if FGClass = TSynGutterCodeFolding then begin
|
||||||
|
FShowLineColor := glcOff;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
if FGClass = TSynGutterLineOverview then begin
|
||||||
|
FShowLineColor := glcOff;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -2249,6 +2269,7 @@ begin
|
|||||||
FOffsetRight := TEditorSynGutterOptions(Source).FOffsetRight;
|
FOffsetRight := TEditorSynGutterOptions(Source).FOffsetRight;
|
||||||
FVisible := TEditorSynGutterOptions(Source).FVisible;
|
FVisible := TEditorSynGutterOptions(Source).FVisible;
|
||||||
FWidth := TEditorSynGutterOptions(Source).FWidth;
|
FWidth := TEditorSynGutterOptions(Source).FWidth;
|
||||||
|
FShowLineColor := TEditorSynGutterOptions(Source).FShowLineColor;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -2286,6 +2307,17 @@ begin
|
|||||||
AGutterPart.RightOffset := FOffsetRight;
|
AGutterPart.RightOffset := FOffsetRight;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TEditorSynGutterOptions.ApplyLineColorTo(AGutterPart: TSynGutterPartBase; Attri,
|
||||||
|
NumAttri: TColorSchemeAttribute);
|
||||||
|
begin
|
||||||
|
if AGutterPart = nil then exit;
|
||||||
|
case FShowLineColor of
|
||||||
|
glcOff: ;
|
||||||
|
glcOn: if Attri <> nil then Attri.ApplyTo(AGutterPart.MarkupInfoCurrentLine);
|
||||||
|
glcLineNum: if NumAttri <> nil then NumAttri.ApplyTo(AGutterPart.MarkupInfoCurrentLine);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TEditorSynGutterOptions.ApplyIndexTo(AGutterPart: TSynGutterPartBase);
|
procedure TEditorSynGutterOptions.ApplyIndexTo(AGutterPart: TSynGutterPartBase);
|
||||||
begin
|
begin
|
||||||
if AGutterPart <> nil then
|
if AGutterPart <> nil then
|
||||||
@ -2948,6 +2980,8 @@ begin
|
|||||||
AdditionalHighlightAttributes[ahaTopInfoHint] := dlgTopInfoHint;
|
AdditionalHighlightAttributes[ahaTopInfoHint] := dlgTopInfoHint;
|
||||||
AdditionalHighlightAttributes[ahaCaretColor] := dlgCaretColor;
|
AdditionalHighlightAttributes[ahaCaretColor] := dlgCaretColor;
|
||||||
AdditionalHighlightAttributes[ahaOverviewGutter] := dlgOverviewGutterColor;
|
AdditionalHighlightAttributes[ahaOverviewGutter] := dlgOverviewGutterColor;
|
||||||
|
AdditionalHighlightAttributes[ahaGutterCurrentLine] := dlgGutterCurrentLineOther;
|
||||||
|
AdditionalHighlightAttributes[ahaGutterNumberCurrentLine] := dlgGutterCurrentLineNumber;
|
||||||
AdditionalHighlightAttributes[ahaIfDefBlockInactive] := dlgIfDefBlockInactive;
|
AdditionalHighlightAttributes[ahaIfDefBlockInactive] := dlgIfDefBlockInactive;
|
||||||
AdditionalHighlightAttributes[ahaIfDefBlockActive] := dlgIfDefBlockActive;
|
AdditionalHighlightAttributes[ahaIfDefBlockActive] := dlgIfDefBlockActive;
|
||||||
AdditionalHighlightAttributes[ahaIfDefBlockTmpActive] := dlgIfDefBlockTmpActive;
|
AdditionalHighlightAttributes[ahaIfDefBlockTmpActive] := dlgIfDefBlockTmpActive;
|
||||||
@ -6472,6 +6506,8 @@ procedure TEditorOptions.SetMarkupColors(aSynEd: TSynEdit);
|
|||||||
var
|
var
|
||||||
Scheme: TColorSchemeLanguage;
|
Scheme: TColorSchemeLanguage;
|
||||||
TmpHl: TIDESynTextSyn;
|
TmpHl: TIDESynTextSyn;
|
||||||
|
Attri, AttriNum: TColorSchemeAttribute;
|
||||||
|
i: Integer;
|
||||||
begin
|
begin
|
||||||
// Find current color scheme for default colors
|
// Find current color scheme for default colors
|
||||||
if (aSynEd.Highlighter = nil) then begin
|
if (aSynEd.Highlighter = nil) then begin
|
||||||
@ -6490,6 +6526,13 @@ begin
|
|||||||
// get current colorscheme:
|
// get current colorscheme:
|
||||||
Scheme := GetColorSchemeLanguage(aSynEd.Highlighter);
|
Scheme := GetColorSchemeLanguage(aSynEd.Highlighter);
|
||||||
if Assigned(Scheme) then Scheme.ApplyTo(aSynEd);
|
if Assigned(Scheme) then Scheme.ApplyTo(aSynEd);
|
||||||
|
|
||||||
|
Attri := Scheme.AttributeByEnum[ahaGutterCurrentLine];
|
||||||
|
AttriNum := Scheme.AttributeByEnum[ahaGutterNumberCurrentLine];
|
||||||
|
for i := 0 to GutterPartList.Count - 1 do
|
||||||
|
GutterPartList[i].ApplyLineColorTo(aSynEd.Gutter.Parts.ByClass[GutterPartList[i].GClass, 0], Attri, AttriNum);
|
||||||
|
for i := 0 to GutterRightPartList.Count - 1 do
|
||||||
|
GutterRightPartList[i].ApplyLineColorTo(aSynEd.Gutter.Parts.ByClass[GutterRightPartList[i].GClass, 0], Attri, AttriNum);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TEditorOptions.ApplyFontSettingsTo(ASynEdit: TSynEdit);
|
procedure TEditorOptions.ApplyFontSettingsTo(ASynEdit: TSynEdit);
|
||||||
|
@ -42,7 +42,8 @@ uses
|
|||||||
// IdeConfig
|
// IdeConfig
|
||||||
IDEProcs, LazConf,
|
IDEProcs, LazConf,
|
||||||
// IDE
|
// IDE
|
||||||
EditorOptions, editor_general_options, LazarusIDEStrConsts, SourceMarks;
|
EditorOptions, editor_general_options,
|
||||||
|
LazarusIDEStrConsts, SourceMarks;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
@ -168,7 +169,6 @@ type
|
|||||||
|
|
||||||
procedure SetCurrentScheme(SynInstance: TSrcIDEHighlighter; const ColorScheme: String);
|
procedure SetCurrentScheme(SynInstance: TSrcIDEHighlighter; const ColorScheme: String);
|
||||||
procedure ApplyCurrentScheme;
|
procedure ApplyCurrentScheme;
|
||||||
procedure UpdateCurrentScheme;
|
|
||||||
|
|
||||||
procedure StatusChange(Sender: TObject; {%H-}Changes: TSynStatusChanges);
|
procedure StatusChange(Sender: TObject; {%H-}Changes: TSynStatusChanges);
|
||||||
procedure SpecialLineMarkup(Sender: TObject; Line: Integer;
|
procedure SpecialLineMarkup(Sender: TObject; Line: Integer;
|
||||||
@ -192,6 +192,7 @@ type
|
|||||||
procedure ReadSettings(AOptions: TAbstractIDEOptions); override;
|
procedure ReadSettings(AOptions: TAbstractIDEOptions); override;
|
||||||
procedure WriteSettings(AOptions: TAbstractIDEOptions); override;
|
procedure WriteSettings(AOptions: TAbstractIDEOptions); override;
|
||||||
procedure SelectAhaColor(aha: TAdditionalHilightAttribute);
|
procedure SelectAhaColor(aha: TAdditionalHilightAttribute);
|
||||||
|
procedure UpdateCurrentScheme;
|
||||||
class function SupportedOptionsClass: TAbstractIDEOptionsClass; override;
|
class function SupportedOptionsClass: TAbstractIDEOptionsClass; override;
|
||||||
property UnsavedColorSchemeSettings: TColorSchemeFactory read FTempColorSchemeSettings;
|
property UnsavedColorSchemeSettings: TColorSchemeFactory read FTempColorSchemeSettings;
|
||||||
property UnsavedColorSchemeDefaultNames: TStringList read FColorSchemes;
|
property UnsavedColorSchemeDefaultNames: TStringList read FColorSchemes;
|
||||||
@ -199,6 +200,8 @@ type
|
|||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
|
uses editor_display_options;
|
||||||
|
|
||||||
{$R *.lfm}
|
{$R *.lfm}
|
||||||
|
|
||||||
const
|
const
|
||||||
@ -1354,19 +1357,40 @@ end;
|
|||||||
|
|
||||||
procedure TEditorColorOptionsFrame.UpdateCurrentScheme;
|
procedure TEditorColorOptionsFrame.UpdateCurrentScheme;
|
||||||
var
|
var
|
||||||
a: Integer;
|
a, i: Integer;
|
||||||
|
col: TEditorDisplayOptionsFrame;
|
||||||
|
Attri, AttriNum: TColorSchemeAttribute;
|
||||||
begin
|
begin
|
||||||
// there is always a colorscheme selected, except during initialization
|
// there is always a colorscheme selected, except during initialization
|
||||||
with GeneralPage do begin
|
with GeneralPage do begin
|
||||||
if FCurrentColorScheme = nil then
|
if FCurrentColorScheme = nil then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
for a := Low(PreviewEdits) to High(PreviewEdits) do
|
for a := Low(PreviewEdits) to High(PreviewEdits) do
|
||||||
PreviewEdits[a].BeginUpdate;
|
PreviewEdits[a].BeginUpdate;
|
||||||
try
|
try
|
||||||
if not FIsEditingDefaults then
|
if not FIsEditingDefaults then
|
||||||
FCurrentColorScheme.ApplyTo(FCurrentHighlighter);
|
FCurrentColorScheme.ApplyTo(FCurrentHighlighter);
|
||||||
|
|
||||||
for a := Low(PreviewEdits) to High(PreviewEdits) do begin
|
for a := Low(PreviewEdits) to High(PreviewEdits) do begin
|
||||||
FCurrentColorScheme.ApplyTo(PreviewEdits[a]);
|
FCurrentColorScheme.ApplyTo(PreviewEdits[a]);
|
||||||
|
|
||||||
|
Attri := FCurrentColorScheme.AttributeByEnum[ahaGutterCurrentLine];
|
||||||
|
AttriNum := FCurrentColorScheme.AttributeByEnum[ahaGutterNumberCurrentLine];
|
||||||
|
col := TEditorDisplayOptionsFrame(FDialog.FindEditor(TEditorDisplayOptionsFrame));
|
||||||
|
if (col <> nil) then begin
|
||||||
|
for i := 0 to col.CurGutterPartList.Count - 1 do
|
||||||
|
col.CurGutterPartList[i].ApplyLineColorTo(PreviewEdits[a].Gutter.Parts.ByClass[col.CurGutterPartList[i].GClass, 0], Attri, AttriNum);
|
||||||
|
for i := 0 to col.CurGutterRightPartList.Count - 1 do
|
||||||
|
col.CurGutterRightPartList[i].ApplyLineColorTo(PreviewEdits[a].Gutter.Parts.ByClass[col.CurGutterRightPartList[i].GClass, 0], Attri, AttriNum);
|
||||||
|
end
|
||||||
|
else begin
|
||||||
|
for i := 0 to EditorOpts.GutterPartList.Count - 1 do
|
||||||
|
EditorOpts.GutterPartList[i].ApplyLineColorTo(PreviewEdits[a].Gutter.Parts.ByClass[EditorOpts.GutterPartList[i].GClass, 0], Attri, AttriNum);
|
||||||
|
for i := 0 to EditorOpts.GutterRightPartList.Count - 1 do
|
||||||
|
EditorOpts.GutterRightPartList[i].ApplyLineColorTo(PreviewEdits[a].Gutter.Parts.ByClass[EditorOpts.GutterRightPartList[i].GClass, 0], Attri, AttriNum);
|
||||||
|
end;
|
||||||
|
|
||||||
PreviewEdits[a].Invalidate;
|
PreviewEdits[a].Invalidate;
|
||||||
end;
|
end;
|
||||||
finally
|
finally
|
||||||
|
@ -12,13 +12,13 @@ object EditorDisplayOptionsFrame: TEditorDisplayOptionsFrame
|
|||||||
object MarginAndGutterGroupBox: TGroupBox
|
object MarginAndGutterGroupBox: TGroupBox
|
||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 249
|
Height = 250
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 588
|
Width = 588
|
||||||
Align = alTop
|
Align = alTop
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
Caption = 'MarginAndGutterGroupBox'
|
Caption = 'MarginAndGutterGroupBox'
|
||||||
ClientHeight = 229
|
ClientHeight = 230
|
||||||
ClientWidth = 584
|
ClientWidth = 584
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
object RightMarginLabel: TLabel
|
object RightMarginLabel: TLabel
|
||||||
@ -40,7 +40,7 @@ object EditorDisplayOptionsFrame: TEditorDisplayOptionsFrame
|
|||||||
AnchorSideTop.Side = asrCenter
|
AnchorSideTop.Side = asrCenter
|
||||||
Left = 325
|
Left = 325
|
||||||
Height = 15
|
Height = 15
|
||||||
Top = 182
|
Top = 211
|
||||||
Width = 121
|
Width = 121
|
||||||
BorderSpacing.Left = 6
|
BorderSpacing.Left = 6
|
||||||
BorderSpacing.Top = 6
|
BorderSpacing.Top = 6
|
||||||
@ -112,11 +112,11 @@ object EditorDisplayOptionsFrame: TEditorDisplayOptionsFrame
|
|||||||
end
|
end
|
||||||
object ShowOnlyLineNumbersMultiplesOfSpinEdit: TSpinEdit
|
object ShowOnlyLineNumbersMultiplesOfSpinEdit: TSpinEdit
|
||||||
AnchorSideLeft.Control = RightMarginComboBox
|
AnchorSideLeft.Control = RightMarginComboBox
|
||||||
AnchorSideTop.Control = spinGutterPartLeftOffs
|
AnchorSideTop.Control = cbCurLineMarkup
|
||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideTop.Side = asrBottom
|
||||||
Left = 265
|
Left = 265
|
||||||
Height = 23
|
Height = 23
|
||||||
Top = 178
|
Top = 207
|
||||||
Width = 54
|
Width = 54
|
||||||
BorderSpacing.Top = 6
|
BorderSpacing.Top = 6
|
||||||
MaxValue = 65536
|
MaxValue = 65536
|
||||||
@ -277,12 +277,27 @@ object EditorDisplayOptionsFrame: TEditorDisplayOptionsFrame
|
|||||||
TabOrder = 9
|
TabOrder = 9
|
||||||
OnClick = rgGutterSiteClick
|
OnClick = rgGutterSiteClick
|
||||||
end
|
end
|
||||||
|
object cbCurLineMarkup: TComboBox
|
||||||
|
AnchorSideLeft.Control = RightMarginComboBox
|
||||||
|
AnchorSideTop.Control = spinGutterPartLeftOffs
|
||||||
|
AnchorSideTop.Side = asrBottom
|
||||||
|
Left = 265
|
||||||
|
Height = 23
|
||||||
|
Top = 178
|
||||||
|
Width = 200
|
||||||
|
BorderSpacing.Top = 6
|
||||||
|
BorderSpacing.Bottom = 6
|
||||||
|
ItemHeight = 15
|
||||||
|
TabOrder = 11
|
||||||
|
Text = 'cbCurLineMarkup'
|
||||||
|
OnChange = spinGutterPartWidthChange
|
||||||
|
end
|
||||||
end
|
end
|
||||||
object EditorFontGroupBox: TGroupBox
|
object EditorFontGroupBox: TGroupBox
|
||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 113
|
Height = 113
|
||||||
Top = 255
|
Top = 256
|
||||||
Width = 588
|
Width = 588
|
||||||
Align = alTop
|
Align = alTop
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
@ -432,8 +447,8 @@ object EditorDisplayOptionsFrame: TEditorDisplayOptionsFrame
|
|||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
AnchorSideBottom.Side = asrBottom
|
AnchorSideBottom.Side = asrBottom
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 81
|
Height = 80
|
||||||
Top = 374
|
Top = 375
|
||||||
Width = 588
|
Width = 588
|
||||||
Align = alClient
|
Align = alClient
|
||||||
BorderSpacing.Top = 6
|
BorderSpacing.Top = 6
|
||||||
|
@ -42,6 +42,7 @@ type
|
|||||||
{ TEditorDisplayOptionsFrame }
|
{ TEditorDisplayOptionsFrame }
|
||||||
|
|
||||||
TEditorDisplayOptionsFrame = class(TAbstractIDEOptionsEditor)
|
TEditorDisplayOptionsFrame = class(TAbstractIDEOptionsEditor)
|
||||||
|
cbCurLineMarkup: TComboBox;
|
||||||
GutterPartVisible: TCheckBox;
|
GutterPartVisible: TCheckBox;
|
||||||
chkTopInfoView: TCheckBox;
|
chkTopInfoView: TCheckBox;
|
||||||
DisableAntialiasingCheckBox: TCheckBox;
|
DisableAntialiasingCheckBox: TCheckBox;
|
||||||
@ -170,6 +171,7 @@ end;
|
|||||||
procedure TEditorDisplayOptionsFrame.UpdatePreviews;
|
procedure TEditorDisplayOptionsFrame.UpdatePreviews;
|
||||||
var
|
var
|
||||||
i, j: Integer;
|
i, j: Integer;
|
||||||
|
col: TEditorColorOptionsFrame;
|
||||||
begin
|
begin
|
||||||
with GeneralPage do
|
with GeneralPage do
|
||||||
for i := Low(PreviewEdits) to High(PreviewEdits) do
|
for i := Low(PreviewEdits) to High(PreviewEdits) do
|
||||||
@ -183,6 +185,9 @@ begin
|
|||||||
FCurGutterRightPartList[j].ApplyIndexTo(PreviewEdits[i].RightGutter.Parts.ByClass[FCurGutterRightPartList[j].GClass, 0]);
|
FCurGutterRightPartList[j].ApplyIndexTo(PreviewEdits[i].RightGutter.Parts.ByClass[FCurGutterRightPartList[j].GClass, 0]);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
col := TEditorColorOptionsFrame(FDialog.FindEditor(TEditorColorOptionsFrame));
|
||||||
|
if col <> nil then
|
||||||
|
col.UpdateCurrentScheme;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TEditorDisplayOptionsFrame.EditorFontButtonClick(Sender: TObject);
|
procedure TEditorDisplayOptionsFrame.EditorFontButtonClick(Sender: TObject);
|
||||||
@ -354,6 +359,12 @@ begin
|
|||||||
spinGutterPartWidth.Value := FCurrentGutterPart.Width;
|
spinGutterPartWidth.Value := FCurrentGutterPart.Width;
|
||||||
spinGutterPartLeftOffs.Value := FCurrentGutterPart.OffsetLeft;
|
spinGutterPartLeftOffs.Value := FCurrentGutterPart.OffsetLeft;
|
||||||
spinGutterPartRightOffs.Value := FCurrentGutterPart.OffsetRight;
|
spinGutterPartRightOffs.Value := FCurrentGutterPart.OffsetRight;
|
||||||
|
case FCurrentGutterPart.ShowLineColor of
|
||||||
|
glcOff: cbCurLineMarkup.ItemIndex := 0;
|
||||||
|
glcOn: cbCurLineMarkup.ItemIndex := 1;
|
||||||
|
glcLineNum: cbCurLineMarkup.ItemIndex := 2;
|
||||||
|
end;
|
||||||
|
|
||||||
FGutterParsUpdating := False;
|
FGutterParsUpdating := False;
|
||||||
|
|
||||||
btnGutterUp.Enabled := lbGutterParts.ItemIndex > 0;
|
btnGutterUp.Enabled := lbGutterParts.ItemIndex > 0;
|
||||||
@ -362,6 +373,10 @@ begin
|
|||||||
ShowOnlyLineNumbersMultiplesOfSpinEdit.Enabled := (FCurrentGutterPart <> nil) and
|
ShowOnlyLineNumbersMultiplesOfSpinEdit.Enabled := (FCurrentGutterPart <> nil) and
|
||||||
(FCurrentGutterPart.GClass = TSynGutterLineNumber);
|
(FCurrentGutterPart.GClass = TSynGutterLineNumber);
|
||||||
ShowOnlyLineNumbersMultiplesOfLabel.Enabled := ShowOnlyLineNumbersMultiplesOfSpinEdit.Enabled;
|
ShowOnlyLineNumbersMultiplesOfLabel.Enabled := ShowOnlyLineNumbersMultiplesOfSpinEdit.Enabled;
|
||||||
|
|
||||||
|
cbCurLineMarkup.Enabled := (FCurrentGutterPart <> nil) and
|
||||||
|
(FCurrentGutterPart.GClass <> TSynGutterLineNumber) and
|
||||||
|
(FCurrentGutterPart.GClass <> TSynGutterLineOverview);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TEditorDisplayOptionsFrame.btnGutterUpClick(Sender: TObject);
|
procedure TEditorDisplayOptionsFrame.btnGutterUpClick(Sender: TObject);
|
||||||
@ -474,6 +489,11 @@ begin
|
|||||||
FCurrentGutterPart.Width := spinGutterPartWidth.Value;
|
FCurrentGutterPart.Width := spinGutterPartWidth.Value;
|
||||||
FCurrentGutterPart.OffsetLeft := spinGutterPartLeftOffs.Value;
|
FCurrentGutterPart.OffsetLeft := spinGutterPartLeftOffs.Value;
|
||||||
FCurrentGutterPart.OffsetRight := spinGutterPartRightOffs.Value;
|
FCurrentGutterPart.OffsetRight := spinGutterPartRightOffs.Value;
|
||||||
|
case cbCurLineMarkup.ItemIndex of
|
||||||
|
0: FCurrentGutterPart.ShowLineColor := glcOff;
|
||||||
|
1: FCurrentGutterPart.ShowLineColor := glcOn;
|
||||||
|
2: FCurrentGutterPart.ShowLineColor := glcLineNum;
|
||||||
|
end;
|
||||||
|
|
||||||
UpdatePreviews;
|
UpdatePreviews;
|
||||||
end;
|
end;
|
||||||
@ -533,6 +553,9 @@ begin
|
|||||||
lblGutterPartWidth.Caption := lisGutterPartWidth;
|
lblGutterPartWidth.Caption := lisGutterPartWidth;
|
||||||
lblGutterPartMargin.Caption := lisGutterPartMargin;
|
lblGutterPartMargin.Caption := lisGutterPartMargin;
|
||||||
|
|
||||||
|
cbCurLineMarkup.Items.Add(optDispGutterNoCurrentLineColor);
|
||||||
|
cbCurLineMarkup.Items.Add(optDispGutterUseCurrentLineColor);
|
||||||
|
cbCurLineMarkup.Items.Add(optDispGutterUseCurrentLineNumberColor);
|
||||||
|
|
||||||
with GeneralPage do
|
with GeneralPage do
|
||||||
AddPreviewEdit(DisplayPreview);
|
AddPreviewEdit(DisplayPreview);
|
||||||
|
@ -2164,6 +2164,8 @@ resourcestring
|
|||||||
dlgTopInfoHint = 'Current Class/Proc Hint';
|
dlgTopInfoHint = 'Current Class/Proc Hint';
|
||||||
dlgCaretColor = 'Caret (Text-Cursor)';
|
dlgCaretColor = 'Caret (Text-Cursor)';
|
||||||
dlgOverviewGutterColor = 'Overview Gutter';
|
dlgOverviewGutterColor = 'Overview Gutter';
|
||||||
|
dlgGutterCurrentLineOther = 'Current Line (other)';
|
||||||
|
dlgGutterCurrentLineNumber = 'Current Line (number)';
|
||||||
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';
|
||||||
@ -6450,6 +6452,9 @@ resourcestring
|
|||||||
optDispGutterChanges = 'Changes';
|
optDispGutterChanges = 'Changes';
|
||||||
optDispGutterSeparator = 'Separator';
|
optDispGutterSeparator = 'Separator';
|
||||||
optDispGutterFolding = 'Folding';
|
optDispGutterFolding = 'Folding';
|
||||||
|
optDispGutterNoCurrentLineColor = 'No current line color';
|
||||||
|
optDispGutterUseCurrentLineColor = 'Use current line color';
|
||||||
|
optDispGutterUseCurrentLineNumberColor = 'Use current line number color';
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
|
@ -64,6 +64,7 @@ type
|
|||||||
ahaSyncroEditOther, ahaSyncroEditArea, ahaGutterSeparator,
|
ahaSyncroEditOther, ahaSyncroEditArea, ahaGutterSeparator,
|
||||||
ahaGutter, ahaRightMargin, ahaSpecialVisibleChars,
|
ahaGutter, ahaRightMargin, ahaSpecialVisibleChars,
|
||||||
ahaTopInfoHint, ahaCaretColor, ahaOverviewGutter,
|
ahaTopInfoHint, ahaCaretColor, ahaOverviewGutter,
|
||||||
|
ahaGutterCurrentLine, ahaGutterNumberCurrentLine,
|
||||||
ahaIfDefBlockInactive, ahaIfDefBlockActive, ahaIfDefBlockTmpActive,
|
ahaIfDefBlockInactive, ahaIfDefBlockActive, ahaIfDefBlockTmpActive,
|
||||||
ahaIfDefNodeInactive, ahaIfDefNodeActive, ahaIfDefNodeTmpActive,
|
ahaIfDefNodeInactive, ahaIfDefNodeActive, ahaIfDefNodeTmpActive,
|
||||||
ahaIdentComplWindow, ahaIdentComplWindowBorder, ahaIdentComplRecent, ahaIdentComplWindowSelection, ahaIdentComplWindowHighlight,
|
ahaIdentComplWindow, ahaIdentComplWindowBorder, ahaIdentComplRecent, ahaIdentComplWindowSelection, ahaIdentComplWindowHighlight,
|
||||||
|
Loading…
Reference in New Issue
Block a user