mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-24 10:20:55 +02:00
SynEdit: clean up, Colors to TLazSynTextArea
git-svn-id: trunk@34670 -
This commit is contained in:
parent
1c7bbcfc56
commit
2fd2705e59
@ -710,6 +710,7 @@ type
|
|||||||
AnInfo: TSynEditMouseActionInfo): Boolean;
|
AnInfo: TSynEditMouseActionInfo): Boolean;
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
procedure SetColor(Value: TColor); override;
|
||||||
procedure DragOver(Source: TObject; X, Y: Integer;
|
procedure DragOver(Source: TObject; X, Y: Integer;
|
||||||
State: TDragState; var Accept: Boolean); override;
|
State: TDragState; var Accept: Boolean); override;
|
||||||
procedure DoOnResize; override;
|
procedure DoOnResize; override;
|
||||||
@ -1891,7 +1892,6 @@ begin
|
|||||||
fMarkupManager.Caret := FCaret;
|
fMarkupManager.Caret := FCaret;
|
||||||
fMarkupManager.InvalidateLinesMethod := @InvalidateLines;
|
fMarkupManager.InvalidateLinesMethod := @InvalidateLines;
|
||||||
|
|
||||||
Color := clWhite;
|
|
||||||
fFontDummy.Name := SynDefaultFontName;
|
fFontDummy.Name := SynDefaultFontName;
|
||||||
fFontDummy.Height := SynDefaultFontHeight;
|
fFontDummy.Height := SynDefaultFontHeight;
|
||||||
fFontDummy.Pitch := SynDefaultFontPitch;
|
fFontDummy.Pitch := SynDefaultFontPitch;
|
||||||
@ -1909,9 +1909,8 @@ begin
|
|||||||
FTextArea.TheLinesView := FTheLinesView;
|
FTextArea.TheLinesView := FTheLinesView;
|
||||||
FTextArea.DisplayView := FDisplayView;
|
FTextArea.DisplayView := FDisplayView;
|
||||||
FTextArea.Highlighter := nil;
|
FTextArea.Highlighter := nil;
|
||||||
// colors are currently set in paint
|
|
||||||
|
|
||||||
|
|
||||||
|
Color := clWhite;
|
||||||
Font.Assign(fFontDummy);
|
Font.Assign(fFontDummy);
|
||||||
Font.OnChange := {$IFDEF FPC}@{$ENDIF}FontChanged;
|
Font.OnChange := {$IFDEF FPC}@{$ENDIF}FontChanged;
|
||||||
FontChanged(nil);
|
FontChanged(nil);
|
||||||
@ -2229,6 +2228,7 @@ end;
|
|||||||
|
|
||||||
procedure TCustomSynEdit.FontChanged(Sender: TObject);
|
procedure TCustomSynEdit.FontChanged(Sender: TObject);
|
||||||
begin // TODO: inherited ?
|
begin // TODO: inherited ?
|
||||||
|
FTextArea.ForegroundColor := Font.Color;
|
||||||
FLastSetFontSize := Font.Height;
|
FLastSetFontSize := Font.Height;
|
||||||
RecalcCharExtent;
|
RecalcCharExtent;
|
||||||
end;
|
end;
|
||||||
@ -2952,6 +2952,12 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCustomSynEdit.SetColor(Value: TColor);
|
||||||
|
begin
|
||||||
|
inherited SetColor(Value);
|
||||||
|
FTextArea.BackgroundColor := Color;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TCustomSynEdit.FindAndHandleMouseAction(AButton: TSynMouseButton;
|
procedure TCustomSynEdit.FindAndHandleMouseAction(AButton: TSynMouseButton;
|
||||||
AShift: TShiftState; X, Y: Integer; ACCount:TSynMAClickCount;
|
AShift: TShiftState; X, Y: Integer; ACCount:TSynMAClickCount;
|
||||||
ADir: TSynMAClickDir; AWheelDelta: Integer = 0);
|
ADir: TSynMAClickDir; AWheelDelta: Integer = 0);
|
||||||
@ -3361,8 +3367,6 @@ begin
|
|||||||
FLeftGutter.Paint(Canvas, rcDraw, nL1, nL2);
|
FLeftGutter.Paint(Canvas, rcDraw, nL1, nL2);
|
||||||
end;
|
end;
|
||||||
// Then paint the text area if it was (partly) invalidated.
|
// Then paint the text area if it was (partly) invalidated.
|
||||||
FTextArea.ForegroundColor := Font.Color;
|
|
||||||
FTextArea.BackgroundColor := Color;
|
|
||||||
FTextArea.Paint(Canvas, rcClip);
|
FTextArea.Paint(Canvas, rcClip);
|
||||||
// right gutter
|
// right gutter
|
||||||
if FRightGutter.Visible and (rcClip.Right > ClientWidth - FRightGutter.Width - ScrollBarWidth) then begin
|
if FRightGutter.Visible and (rcClip.Right > ClientWidth - FRightGutter.Width - ScrollBarWidth) then begin
|
||||||
|
Loading…
Reference in New Issue
Block a user