mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-22 13:59:31 +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 GetGlyphSize(Drawing: Boolean; PaintRect: TRect): TSize; override;
|
||||
class function GetControlClassDefaultSize: TSize; override;
|
||||
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
|
||||
procedure ShowColorDialog; virtual;
|
||||
public
|
||||
constructor Create(AnOwner: TComponent); override;
|
||||
|
@ -148,6 +148,13 @@ begin
|
||||
Result.CY := 25;
|
||||
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);
|
||||
begin
|
||||
if FButtonColorSize = AValue then Exit;
|
||||
|
Loading…
Reference in New Issue
Block a user