mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-19 14:29:29 +02:00
MWE:
* Fixed bug on ListItems.Delete git-svn-id: trunk@1542 -
This commit is contained in:
parent
08109d2171
commit
790daedb9c
@ -420,7 +420,8 @@ type
|
||||
private
|
||||
FOwner : TCustomListView;
|
||||
FItems : TList;
|
||||
Function GetCount : Integer;
|
||||
function GetCount : Integer;
|
||||
procedure ItemDeleted(const AItem: TListItem); //called by TListItem when freed
|
||||
protected
|
||||
function GetItem(const AIndex: Integer): TListItem;
|
||||
procedure SetITem(const AIndex: Integer; const AValue: TListItem);
|
||||
@ -1782,6 +1783,10 @@ end.
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.29 2002/03/24 16:38:00 lazarus
|
||||
MWE:
|
||||
* Fixed bug on ListItems.Delete
|
||||
|
||||
Revision 1.28 2002/03/23 15:51:17 lazarus
|
||||
MWE: Fixed more compatebility issues (Sort, SelectedItem)
|
||||
|
||||
|
@ -72,7 +72,7 @@ destructor TListItem.Destroy;
|
||||
begin
|
||||
FDestroying := True;
|
||||
if FOwner <> nil
|
||||
then FOwner.Delete(Index);
|
||||
then FOwner.ItemDeleted(Self);
|
||||
|
||||
SubItems.Free;
|
||||
inherited Destroy;
|
||||
@ -90,6 +90,10 @@ end;
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.8 2002/03/24 16:38:01 lazarus
|
||||
MWE:
|
||||
* Fixed bug on ListItems.Delete
|
||||
|
||||
Revision 1.7 2002/03/23 15:49:22 lazarus
|
||||
MWE: Fixed more compatebility issues (Sort, SelectedItem)
|
||||
|
||||
|
@ -54,10 +54,19 @@ end;
|
||||
{------------------------------------------------------------------------------}
|
||||
procedure TListItems.Delete(const AIndex: Integer);
|
||||
begin
|
||||
if (FItems.Items[Aindex] <> nil)
|
||||
then Item[AIndex].Delete;
|
||||
FItems.Delete(AIndex);
|
||||
FOwner.ItemDeleted(AIndex);
|
||||
Item[AIndex].Delete;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------}
|
||||
{ TListItems ItemDeleted }
|
||||
{------------------------------------------------------------------------------}
|
||||
procedure TListItems.ItemDeleted(const AItem: TListItem);
|
||||
var
|
||||
idx: Integer;
|
||||
begin
|
||||
idx := FItems.Remove(AItem);
|
||||
if (idx >= 0) and (FOwner <> nil)
|
||||
then FOwner.ItemDeleted(idx);
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------}
|
||||
@ -111,6 +120,10 @@ end;
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.10 2002/03/24 16:38:01 lazarus
|
||||
MWE:
|
||||
* Fixed bug on ListItems.Delete
|
||||
|
||||
Revision 1.9 2002/03/23 15:49:22 lazarus
|
||||
MWE: Fixed more compatebility issues (Sort, SelectedItem)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user