|
@@ -171,6 +171,7 @@ type
|
|
|
|
|
|
TOnToolChangedHandler = procedure(sender: TToolManager; ANewToolType: TPaintToolType) of object;
|
|
TOnToolChangedHandler = procedure(sender: TToolManager; ANewToolType: TPaintToolType) of object;
|
|
TOnPopupToolHandler = procedure(sender: TToolManager; APopupMessage: TToolPopupMessage; AKey: Word; AAlways: boolean) of object;
|
|
TOnPopupToolHandler = procedure(sender: TToolManager; APopupMessage: TToolPopupMessage; AKey: Word; AAlways: boolean) of object;
|
|
|
|
+ TOnQueryColorTargetHandler = procedure(sender: TToolManager; ATarget: TVectorialFill) of object;
|
|
|
|
|
|
TShapeOption = (toAliasing, toDrawShape, toFillShape, toCloseShape);
|
|
TShapeOption = (toAliasing, toDrawShape, toFillShape, toCloseShape);
|
|
TShapeOptions = set of TShapeOption;
|
|
TShapeOptions = set of TShapeOption;
|
|
@@ -186,6 +187,7 @@ type
|
|
TToolManager = class
|
|
TToolManager = class
|
|
private
|
|
private
|
|
FConfigProvider: IConfigProvider;
|
|
FConfigProvider: IConfigProvider;
|
|
|
|
+ FOnQueryColorTarget: TOnQueryColorTargetHandler;
|
|
FShouldExitTool: boolean;
|
|
FShouldExitTool: boolean;
|
|
FImage: TLazPaintImage;
|
|
FImage: TLazPaintImage;
|
|
FBlackAndWhite: boolean;
|
|
FBlackAndWhite: boolean;
|
|
@@ -414,6 +416,7 @@ type
|
|
procedure SetLightAltitude(AValue: integer);
|
|
procedure SetLightAltitude(AValue: integer);
|
|
procedure SetLightPosition(AValue: TPointF);
|
|
procedure SetLightPosition(AValue: TPointF);
|
|
procedure SetLineCap(AValue: TPenEndCap);
|
|
procedure SetLineCap(AValue: TPenEndCap);
|
|
|
|
+ procedure SetOnQueryColorTarget(AValue: TOnQueryColorTargetHandler);
|
|
procedure SetOutlineColor(AValue: TBGRAPixel);
|
|
procedure SetOutlineColor(AValue: TBGRAPixel);
|
|
procedure SetPerspectiveOptions(AValue: TPerspectiveOptions);
|
|
procedure SetPerspectiveOptions(AValue: TPerspectiveOptions);
|
|
procedure SetPhongShapeAltitude(AValue: integer);
|
|
procedure SetPhongShapeAltitude(AValue: integer);
|
|
@@ -495,6 +498,7 @@ type
|
|
function IsBackEditGradTexPoints: boolean;
|
|
function IsBackEditGradTexPoints: boolean;
|
|
function IsOutlineEditGradTexPoints: boolean;
|
|
function IsOutlineEditGradTexPoints: boolean;
|
|
procedure QueryExitTool;
|
|
procedure QueryExitTool;
|
|
|
|
+ procedure QueryColorTarget(ATarget: TVectorialFill);
|
|
|
|
|
|
function RenderTool(formBitmap: TBGRABitmap): TRect;
|
|
function RenderTool(formBitmap: TBGRABitmap): TRect;
|
|
function GetRenderBounds(VirtualScreenWidth, VirtualScreenHeight: integer): TRect;
|
|
function GetRenderBounds(VirtualScreenWidth, VirtualScreenHeight: integer): TRect;
|
|
@@ -580,6 +584,7 @@ type
|
|
property OnPopup: TOnPopupToolHandler read FOnPopupToolHandler write FOnPopupToolHandler;
|
|
property OnPopup: TOnPopupToolHandler read FOnPopupToolHandler write FOnPopupToolHandler;
|
|
property OnEraserChanged: TNotifyEvent read FOnEraserChanged write FOnEraserChanged;
|
|
property OnEraserChanged: TNotifyEvent read FOnEraserChanged write FOnEraserChanged;
|
|
property OnFillChanged: TNotifyEvent read FOnFillChanged write FOnFillChanged;
|
|
property OnFillChanged: TNotifyEvent read FOnFillChanged write FOnFillChanged;
|
|
|
|
+ property OnQueryColorTarget: TOnQueryColorTargetHandler read FOnQueryColorTarget write SetOnQueryColorTarget;
|
|
property OnPenWidthChanged: TNotifyEvent read FOnPenWidthChanged write FOnPenWidthChanged;
|
|
property OnPenWidthChanged: TNotifyEvent read FOnPenWidthChanged write FOnPenWidthChanged;
|
|
property OnBrushChanged: TNotifyEvent read FOnBrushChanged write FOnBrushChanged;
|
|
property OnBrushChanged: TNotifyEvent read FOnBrushChanged write FOnBrushChanged;
|
|
property OnBrushListChanged: TNotifyEvent read FOnBrushListChanged write FOnBrushListChanged;
|
|
property OnBrushListChanged: TNotifyEvent read FOnBrushListChanged write FOnBrushListChanged;
|
|
@@ -1392,6 +1397,12 @@ begin
|
|
if Assigned(FOnLineCapChanged) then FOnLineCapChanged(self);
|
|
if Assigned(FOnLineCapChanged) then FOnLineCapChanged(self);
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+procedure TToolManager.SetOnQueryColorTarget(AValue: TOnQueryColorTargetHandler);
|
|
|
|
+begin
|
|
|
|
+ if FOnQueryColorTarget=AValue then Exit;
|
|
|
|
+ FOnQueryColorTarget:=AValue;
|
|
|
|
+end;
|
|
|
|
+
|
|
procedure TToolManager.SetOutlineColor(AValue: TBGRAPixel);
|
|
procedure TToolManager.SetOutlineColor(AValue: TBGRAPixel);
|
|
begin
|
|
begin
|
|
FOutlineFill.SolidColor := AValue;
|
|
FOutlineFill.SolidColor := AValue;
|
|
@@ -3791,6 +3802,12 @@ begin
|
|
FShouldExitTool:= true;
|
|
FShouldExitTool:= true;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+procedure TToolManager.QueryColorTarget(ATarget: TVectorialFill);
|
|
|
|
+begin
|
|
|
|
+ if Assigned(OnQueryColorTarget) then
|
|
|
|
+ OnQueryColorTarget(self, ATarget);
|
|
|
|
+end;
|
|
|
|
+
|
|
function TToolManager.RenderTool(formBitmap: TBGRABitmap): TRect;
|
|
function TToolManager.RenderTool(formBitmap: TBGRABitmap): TRect;
|
|
begin
|
|
begin
|
|
if ToolCanBeUsed and Assigned(CurrentTool) and not FInTool then
|
|
if ToolCanBeUsed and Assigned(CurrentTool) and not FInTool then
|