mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-06 02:18:03 +02:00
LCL: Made TCustomImageList more extensible. Based on idea from merge request !202.
1. MarkAsChanged method (protected) is added, which sets FChanged to true. 2. Virtual DoAfterUpdateStarted and DoBeforeUpdateEnded methods (protected) are added. They are called in first BeginUpdate and last EndUpdate respectively.
This commit is contained in:
parent
faf326a95f
commit
79f7f1bbf2
@ -313,6 +313,9 @@ type
|
||||
procedure DefineProperties(Filer: TFiler); override;
|
||||
procedure SetWidthHeight(NewWidth, NewHeight: integer);
|
||||
procedure ClearOverlays;
|
||||
procedure MarkAsChanged;
|
||||
procedure DoAfterUpdateStarted; virtual;
|
||||
procedure DoBeforeUpdateEnded; virtual;
|
||||
public
|
||||
constructor Create(AOwner: TComponent); override;
|
||||
constructor CreateSize(AWidth, AHeight: Integer);
|
||||
|
@ -1532,6 +1532,7 @@ end;
|
||||
procedure TCustomImageList.BeginUpdate;
|
||||
begin
|
||||
inc(FUpdateCount);
|
||||
if FUpdateCount = 1 then DoAfterUpdateStarted;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
@ -1792,6 +1793,7 @@ procedure TCustomImageList.EndUpdate;
|
||||
begin
|
||||
if FUpdateCount<=0 then
|
||||
RaiseGDBException('');
|
||||
if FUpdateCount = 1 then DoBeforeUpdateEnded;
|
||||
dec(FUpdateCount);
|
||||
Change;
|
||||
end;
|
||||
@ -2004,6 +2006,21 @@ begin
|
||||
FHasOverlays := false;
|
||||
end;
|
||||
|
||||
procedure TCustomImageList.MarkAsChanged;
|
||||
begin
|
||||
FChanged := true;
|
||||
end;
|
||||
|
||||
procedure TCustomImageList.DoAfterUpdateStarted;
|
||||
begin
|
||||
//
|
||||
end;
|
||||
|
||||
procedure TCustomImageList.DoBeforeUpdateEnded;
|
||||
begin
|
||||
//
|
||||
end;
|
||||
|
||||
procedure TCustomImageList.CreateDefaultResolution;
|
||||
begin
|
||||
if ResolutionCount=0 then
|
||||
|
Loading…
Reference in New Issue
Block a user