mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-11 11:58:21 +02:00
LCL/TColorButton: Add missing Notification method to prevent crash when assigned ColorDialog is deleted.
This commit is contained in:
parent
e0c4d9c77b
commit
285ed6ea0d
@ -312,6 +312,7 @@ type
|
|||||||
function GetDisabledPattern: TBitmap; virtual;
|
function GetDisabledPattern: TBitmap; virtual;
|
||||||
function GetGlyphSize(Drawing: Boolean; PaintRect: TRect): TSize; override;
|
function GetGlyphSize(Drawing: Boolean; PaintRect: TRect): TSize; override;
|
||||||
class function GetControlClassDefaultSize: TSize; override;
|
class function GetControlClassDefaultSize: TSize; override;
|
||||||
|
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
|
||||||
procedure ShowColorDialog; virtual;
|
procedure ShowColorDialog; virtual;
|
||||||
public
|
public
|
||||||
constructor Create(AnOwner: TComponent); override;
|
constructor Create(AnOwner: TComponent); override;
|
||||||
|
@ -148,6 +148,13 @@ begin
|
|||||||
Result.CY := 25;
|
Result.CY := 25;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TColorButton.Notification(AComponent: TComponent; Operation: TOperation);
|
||||||
|
begin
|
||||||
|
inherited Notification(AComponent, Operation);
|
||||||
|
if (Operation = opRemove) and (AComponent = FColorDialog) then
|
||||||
|
FColorDialog := nil;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TColorButton.SetButtonColorSize(const AValue: Integer);
|
procedure TColorButton.SetButtonColorSize(const AValue: Integer);
|
||||||
begin
|
begin
|
||||||
if FButtonColorSize = AValue then Exit;
|
if FButtonColorSize = AValue then Exit;
|
||||||
|
Loading…
Reference in New Issue
Block a user