* Delphi compatebility. Patch from Graeme Geldenhuys

git-svn-id: trunk@8390 -
This commit is contained in:
marc 2005-12-30 16:15:16 +00:00
parent b234e3cdfc
commit bd4284dbd7
2 changed files with 12 additions and 0 deletions

View File

@ -565,6 +565,8 @@ type
TListItemFlag = (lifDestroying, lifCreated);
TListItemFlags = set of TListItemFlag;
{ TListItem }
TListItem = class(TPersistent)
private
FOwner: TListItems;
@ -574,6 +576,7 @@ type
FData: Pointer;
FImageIndex: Integer;
FStates: TListItemStates;
function GetListView: TCustomListView;
function GetState(const ALisOrd: Integer): Boolean;
function GetIndex: Integer;
function GetSubItemImages(const AIndex: Integer): Integer;
@ -606,6 +609,7 @@ type
property Focused: Boolean index Ord(lisFocused) read GetState write SetState;
property Index: Integer read GetIndex;
property ImageIndex: Integer read FImageIndex write SetImageIndex default -1;
property ListView: TCustomListView read GetListView;
property Owner: TListItems read FOwner;
property Selected: Boolean index Ord(lisSelected) read GetState write SetState;
property SubItems: TStrings read GetSubItems write SetSubItems;

View File

@ -442,6 +442,14 @@ begin
else Result := AState in FStates;
end;
{------------------------------------------------------------------------------}
{ The ListView this ListItem belongs to }
{------------------------------------------------------------------------------}
function TListItem.GetListView: TCustomListView;
begin
Result := Owner.Owner;
end;
{------------------------------------------------------------------------------}
{ TListItem GetSubItemImages }
{------------------------------------------------------------------------------}