mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-08 14:54:55 +01:00
lcl: using fpcanvas EndCap
git-svn-id: trunk@40239 -
This commit is contained in:
parent
b4a29891b3
commit
9860bb1ef1
@ -5,7 +5,7 @@ unit SynGutterChanges;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, Graphics, LCLType, LCLIntf, SynGutterBase;
|
Classes, FPCanvas, Graphics, LCLType, LCLIntf, SynGutterBase;
|
||||||
|
|
||||||
type
|
type
|
||||||
{ TSynGutterChanges }
|
{ TSynGutterChanges }
|
||||||
|
|||||||
@ -11,7 +11,7 @@ uses
|
|||||||
SynGutterChanges, SynEditMouseCmds, SynEditHighlighter, SynTextDrawer,
|
SynGutterChanges, SynEditMouseCmds, SynEditHighlighter, SynTextDrawer,
|
||||||
DividerBevel, Laz2_XMLCfg, EditorOptions, IDEOptionsIntf,
|
DividerBevel, Laz2_XMLCfg, EditorOptions, IDEOptionsIntf,
|
||||||
editor_general_options, IDEImagesIntf, LazarusIDEStrConsts, IDEProcs, typinfo,
|
editor_general_options, IDEImagesIntf, LazarusIDEStrConsts, IDEProcs, typinfo,
|
||||||
LazConf, types, math;
|
LazConf, types, math, FPCanvas;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
|
|||||||
@ -36,7 +36,7 @@ uses
|
|||||||
// IMPORTANT: the object inspector is a tool and can be used in other programs
|
// IMPORTANT: the object inspector is a tool and can be used in other programs
|
||||||
// too. Don't put Lazarus IDE specific things here.
|
// too. Don't put Lazarus IDE specific things here.
|
||||||
// FCL
|
// FCL
|
||||||
SysUtils, Types, Classes, TypInfo, contnrs,
|
SysUtils, Types, Classes, TypInfo, contnrs, FPCanvas,
|
||||||
// LCL
|
// LCL
|
||||||
InterfaceBase, Forms, Buttons, Graphics, GraphType, LCLProc, StdCtrls,
|
InterfaceBase, Forms, Buttons, Graphics, GraphType, LCLProc, StdCtrls,
|
||||||
LCLType, LCLIntf, Controls, ComCtrls, ExtCtrls, LMessages, LResources,
|
LCLType, LCLIntf, Controls, ComCtrls, ExtCtrls, LMessages, LResources,
|
||||||
|
|||||||
@ -36,6 +36,11 @@ interface
|
|||||||
{$DEFINE HasFPCanvas1}
|
{$DEFINE HasFPCanvas1}
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
|
{$IF FPC_FULLVERSION>=20701}
|
||||||
|
{$DEFINE HasFPEndCap}
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
|
|
||||||
uses
|
uses
|
||||||
SysUtils, Math, Types, Classes, Contnrs, FPCAdds, LCLversion,
|
SysUtils, Math, Types, Classes, Contnrs, FPCAdds, LCLversion,
|
||||||
FileUtil,
|
FileUtil,
|
||||||
@ -168,6 +173,10 @@ const
|
|||||||
bsCross = FPCanvas.bsCross;
|
bsCross = FPCanvas.bsCross;
|
||||||
bsDiagCross = FPCanvas.bsDiagCross;
|
bsDiagCross = FPCanvas.bsDiagCross;
|
||||||
|
|
||||||
|
pecRound = FPCanvas.pecRound;
|
||||||
|
pecSquare = FPCanvas.pecSquare;
|
||||||
|
pecFlat = FPCanvas.pecFlat;
|
||||||
|
|
||||||
type
|
type
|
||||||
TFillStyle = TGraphicsFillStyle;
|
TFillStyle = TGraphicsFillStyle;
|
||||||
TFillMode = (fmAlternate, fmWinding);
|
TFillMode = (fmAlternate, fmWinding);
|
||||||
@ -573,11 +582,15 @@ type
|
|||||||
TPenMode = TFPPenMode;
|
TPenMode = TFPPenMode;
|
||||||
|
|
||||||
// pen end caps. valid only for geometric pens
|
// pen end caps. valid only for geometric pens
|
||||||
|
{$IFDEF HasFPEndCap}
|
||||||
|
TPenEndCap = TFPPenEndCap;
|
||||||
|
{$ELSE}
|
||||||
TPenEndCap = (
|
TPenEndCap = (
|
||||||
pecRound,
|
pecRound,
|
||||||
pecSquare,
|
pecSquare,
|
||||||
pecFlat
|
pecFlat
|
||||||
);
|
);
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
// join style. valid only for geometric pens
|
// join style. valid only for geometric pens
|
||||||
TPenJoinStyle = (
|
TPenJoinStyle = (
|
||||||
@ -614,7 +627,9 @@ type
|
|||||||
TPen = class(TFPCustomPen)
|
TPen = class(TFPCustomPen)
|
||||||
private
|
private
|
||||||
FColor: TColor;
|
FColor: TColor;
|
||||||
|
{$IFNDEF HasFPEndCap}
|
||||||
FEndCap: TPenEndCap;
|
FEndCap: TPenEndCap;
|
||||||
|
{$ENDIF}
|
||||||
FCosmetic: Boolean;
|
FCosmetic: Boolean;
|
||||||
FJoinStyle: TPenJoinStyle;
|
FJoinStyle: TPenJoinStyle;
|
||||||
FPattern: TPenPattern;
|
FPattern: TPenPattern;
|
||||||
@ -633,7 +648,7 @@ type
|
|||||||
procedure SetColor(const NewColor: TColor; const NewFPColor: TFPColor); virtual;
|
procedure SetColor(const NewColor: TColor; const NewFPColor: TFPColor); virtual;
|
||||||
procedure SetFPColor(const AValue: TFPColor); override;
|
procedure SetFPColor(const AValue: TFPColor); override;
|
||||||
procedure SetColor(Value: TColor);
|
procedure SetColor(Value: TColor);
|
||||||
procedure SetEndCap(const AValue: TPenEndCap);
|
procedure SetEndCap(AValue: TPenEndCap); {$IFDEF HasFPEndCap}override;{$ENDIF}
|
||||||
procedure SetJoinStyle(const AValue: TPenJoinStyle);
|
procedure SetJoinStyle(const AValue: TPenJoinStyle);
|
||||||
procedure SetMode(Value: TPenMode); override;
|
procedure SetMode(Value: TPenMode); override;
|
||||||
procedure SetStyle(Value: TPenStyle); override;
|
procedure SetStyle(Value: TPenStyle); override;
|
||||||
@ -650,7 +665,11 @@ type
|
|||||||
published
|
published
|
||||||
property Color: TColor read FColor write SetColor default clBlack;
|
property Color: TColor read FColor write SetColor default clBlack;
|
||||||
property Cosmetic: Boolean read FCosmetic write SetCosmetic default True;
|
property Cosmetic: Boolean read FCosmetic write SetCosmetic default True;
|
||||||
|
{$IFDEF HasFPEndCap}
|
||||||
|
property EndCap default pecRound;
|
||||||
|
{$ELSE}
|
||||||
property EndCap: TPenEndCap read FEndCap write SetEndCap default pecRound;
|
property EndCap: TPenEndCap read FEndCap write SetEndCap default pecRound;
|
||||||
|
{$ENDIF}
|
||||||
property JoinStyle: TPenJoinStyle read FJoinStyle write SetJoinStyle default pjsRound;
|
property JoinStyle: TPenJoinStyle read FJoinStyle write SetJoinStyle default pjsRound;
|
||||||
property Mode default pmCopy;
|
property Mode default pmCopy;
|
||||||
property Style default psSolid;
|
property Style default psSolid;
|
||||||
|
|||||||
@ -214,10 +214,13 @@ constructor TPen.Create;
|
|||||||
begin
|
begin
|
||||||
inherited Create;
|
inherited Create;
|
||||||
DelayAllocate := True;
|
DelayAllocate := True;
|
||||||
FEndCap := pecRound;
|
|
||||||
FJoinStyle := pjsRound;
|
FJoinStyle := pjsRound;
|
||||||
FCosmetic := True;
|
FCosmetic := True;
|
||||||
FPattern := nil;
|
{$IFDEF HasFPEndCap}
|
||||||
|
inherited SetEndCap(pecRound);
|
||||||
|
{$ELSE}
|
||||||
|
FEndCap := pecRound;
|
||||||
|
{$ENDIF}
|
||||||
inherited SetWidth(1);
|
inherited SetWidth(1);
|
||||||
inherited SetStyle(psSolid);
|
inherited SetStyle(psSolid);
|
||||||
inherited SetMode(pmCopy);
|
inherited SetMode(pmCopy);
|
||||||
@ -446,12 +449,16 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TPen.SetEndCap(const AValue: TPenEndCap);
|
procedure TPen.SetEndCap(AValue: TPenEndCap);
|
||||||
begin
|
begin
|
||||||
if EndCap <> AValue then
|
if EndCap <> AValue then
|
||||||
begin
|
begin
|
||||||
FreeReference;
|
FreeReference;
|
||||||
|
{$IFDEF HasFPEndCap}
|
||||||
|
inherited SetEndCap(AValue);
|
||||||
|
{$ELSE}
|
||||||
FEndCap := AValue;
|
FEndCap := AValue;
|
||||||
|
{$ENDIF}
|
||||||
Changed;
|
Changed;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -504,7 +511,7 @@ begin
|
|||||||
FreeReference;
|
FreeReference;
|
||||||
inherited DoCopyProps(From);
|
inherited DoCopyProps(From);
|
||||||
FCosmetic := APen.Cosmetic;
|
FCosmetic := APen.Cosmetic;
|
||||||
FEndCap := APen.EndCap;
|
EndCap := APen.EndCap;
|
||||||
FJoinStyle := APen.JoinStyle;
|
FJoinStyle := APen.JoinStyle;
|
||||||
//TODO: query new parameters
|
//TODO: query new parameters
|
||||||
Changed;
|
Changed;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user