LCL/TCustomGrid, TCustomCheckBoxEx: Add missing Notification method to react on destruction of TitleImageList and Images, respectively.

This commit is contained in:
wp_xyz 2021-12-16 14:52:01 +01:00
parent 6efaae3d24
commit 7114800c05
3 changed files with 22 additions and 0 deletions

View File

@ -156,6 +156,7 @@ type
procedure DrawItem(Index: Integer; ARect: TRect; State: TOwnerDrawState); override;
procedure FontChanged(Sender: TObject); override;
procedure InitializeWnd; override;
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
procedure SetItemHeight(const AValue: Integer); override;
public
constructor Create(TheOwner: TComponent); override;

View File

@ -1135,6 +1135,7 @@ type
function MoveNextAuto(const Inverse: boolean): boolean;
function MoveNextSelectable(Relative:Boolean; DCol, DRow: Integer): Boolean; virtual;
procedure MoveSelection; virtual;
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
function OffsetToColRow(IsCol, Physical: Boolean; Offset: Integer;
out Index, Rest: Integer): Boolean;
procedure Paint; override;
@ -8290,6 +8291,16 @@ begin
if Assigned(OnSelection) then OnSelection(Self, FCol, FRow);
end;
procedure TCustomGrid.Notification(AComponent: TComponent; Operation: TOperation);
begin
inherited Notification(AComponent, Operation);
if (Operation = opRemove) and (AComponent = FTitleImageList) then
begin
FTitleImageList := nil;
Invalidate;
end;
end;
procedure TCustomGrid.BeginUpdate;
begin
Inc(FUpdateCount);

View File

@ -452,6 +452,16 @@ begin
end;
end;
procedure TCustomComboBoxEx.Notification(AComponent: TComponent; Operation: TOperation);
begin
inherited Notification(AComponent, Operation);
if (Operation = opRemove) and (AComponent = FImages) then
begin
FImages := nil;
Invalidate;
end;
end;
procedure TCustomComboBoxEx.SetItemHeight(const AValue: Integer);
begin
inherited SetItemHeight(AValue);