Explorar o código

+ Patch from Mattias to support GraphicsObject methods

michael %!s(int64=20) %!d(string=hai) anos
pai
achega
5c98c741cc
Modificáronse 2 ficheiros con 28 adicións e 0 borrados
  1. 8 0
      fcl/image/fpcanvas.pp
  2. 20 0
      fcl/image/fphelper.inc

+ 8 - 0
fcl/image/fpcanvas.pp

@@ -39,6 +39,8 @@ type
     FFixedCanvas : boolean;
     FCanvas : TFPCustomCanvas;
     FFlags : word;
+    FOnChange: TNotifyEvent;
+    FOnChanging: TNotifyEvent;
     function GetAllocated : boolean;
     procedure NotifyCanvas;
   protected
@@ -51,6 +53,10 @@ type
     procedure DoDeAllocateResources; virtual;
     procedure DoCopyProps (From:TFPCanvasHelper); virtual;
     procedure SetColor (AValue:TFPColor); virtual;
+    procedure Changing; dynamic;
+    procedure Changed; dynamic;
+    Procedure Lock;
+    Procedure UnLock;
   public
     constructor Create; virtual;
     destructor destroy; override;
@@ -65,6 +71,8 @@ type
     property Canvas : TFPCustomCanvas read FCanvas;
     // color of the helper
     property Color : TFPColor read FColor Write SetColor;
+    property OnChanging: TNotifyEvent read FOnChanging write FOnChanging;
+    property OnChange: TNotifyEvent read FOnChange write FOnChange;
   end;
 
   TFPCustomFont = class (TFPCanvasHelper)

+ 20 - 0
fcl/image/fphelper.inc

@@ -51,6 +51,26 @@ begin
   FColor := AValue;
 end;
 
+procedure TFPCanvasHelper.Changing;
+begin
+  if Assigned(FOnChanging) then FOnChanging(Self);
+end;
+
+procedure TFPCanvasHelper.Changed;
+begin
+  if Assigned(FOnChange) then FOnChange(Self);
+end;
+
+procedure TFPCanvasHelper.Lock;
+begin
+
+end;
+
+procedure TFPCanvasHelper.UnLock;
+begin
+
+end;
+
 procedure TFPCanvasHelper.SetFlags (index:integer; AValue:boolean);
 begin
   if AValue then