mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-22 09:19:32 +02:00
LCL/TColorButton: Add missing Notification method to prevent crash when assigned ColorDialog is deleted.
(cherry picked from commit 285ed6ea0d
)
This commit is contained in:
parent
a1a2e3dc28
commit
2bd1bb2406
@ -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