LCL: add Notification about removed ImageLists in ListView. Issue #20619

git-svn-id: trunk@33594 -
This commit is contained in:
juha 2011-11-17 18:57:22 +00:00
parent cc82e44e9b
commit a002250d2b
2 changed files with 12 additions and 1 deletions

View File

@ -1473,7 +1473,8 @@ type
procedure InsertItem(Item : TListItem);
procedure ImageChanged(Sender : TObject);
procedure Loaded; override;
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
function IsCustomDrawn(ATarget: TCustomDrawTarget; AStage: TCustomDrawStage): Boolean; virtual;
function CustomDraw(const ARect: TRect; AStage: TCustomDrawStage): Boolean; virtual; // Return True if default drawing should be done
function CustomDrawItem(AItem: TListItem; AState: TCustomDrawState; AStage: TCustomDrawStage): Boolean; virtual; //

View File

@ -1213,6 +1213,16 @@ begin
inherited Loaded;
end;
procedure TCustomListView.Notification(AComponent: TComponent; Operation: TOperation);
begin
inherited Notification(AComponent, Operation);
if Operation = opRemove then begin
if AComponent = LargeImages then LargeImages := nil;
if AComponent = SmallImages then SmallImages := nil;
if AComponent = StateImages then StateImages := nil;
end;
end;
procedure TCustomListView.SetScrollBars(const AValue: TScrollStyle);
begin
if (FScrollBars = AValue) then exit;