mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-22 12:59:26 +02:00
LCL: added Delphi compatibile function TCustomListView.FindData(StartIndex: Integer; Value: Pointer; Inclusive, Wrap: Boolean): TListItem;
git-svn-id: trunk@31480 -
This commit is contained in:
parent
8ccc414025
commit
31a93e1b6e
@ -852,7 +852,8 @@ type
|
||||
function FindCaption(StartIndex: Integer; Value: string;
|
||||
Partial, Inclusive, Wrap: Boolean;
|
||||
PartStart: Boolean = True): TListItem;
|
||||
function FindData(const AData: Pointer): TListItem;
|
||||
function FindData(const AData: Pointer): TListItem; overload;
|
||||
function FindData(StartIndex: Integer; Value: Pointer; Inclusive, Wrap: Boolean): TListItem; overload;
|
||||
function GetEnumerator: TListItemsEnumerator;
|
||||
function IndexOf(const AItem: TListItem): Integer;
|
||||
function Insert(const AIndex: Integer) : TListItem;
|
||||
@ -1183,6 +1184,7 @@ type
|
||||
procedure EndUpdate;
|
||||
procedure Repaint; override;
|
||||
function FindCaption(StartIndex: Integer; Value: string; Partial, Inclusive, Wrap: Boolean; PartStart: Boolean = True): TListItem;
|
||||
function FindData(StartIndex: Integer; Value: Pointer; Inclusive, Wrap: Boolean): TListItem;
|
||||
function GetHitTestInfoAt(X, Y: Integer): THitTests;
|
||||
function GetItemAt(x,y: integer): TListItem;
|
||||
property BoundingRect: TRect read GetBoundingRect;
|
||||
|
@ -863,6 +863,12 @@ begin
|
||||
Result := FListItems.FindCaption(StartIndex, Value, Partial, Inclusive, Wrap);
|
||||
end;
|
||||
|
||||
function TCustomListView.FindData(StartIndex: Integer; Value: Pointer;
|
||||
Inclusive, Wrap: Boolean): TListItem;
|
||||
begin
|
||||
Result := FListItems.FindData(StartIndex, Value, Inclusive, Wrap);
|
||||
end;
|
||||
|
||||
function TCustomListView.GetBoundingRect: TRect;
|
||||
begin
|
||||
if not HandleAllocated
|
||||
|
@ -436,11 +436,42 @@ begin
|
||||
FCacheItem := Result;
|
||||
Exit;
|
||||
end;
|
||||
end;
|
||||
|
||||
end;
|
||||
Result := nil;
|
||||
end;
|
||||
|
||||
function TListItems.FindData(StartIndex: Integer; Value: Pointer; Inclusive,
|
||||
Wrap: Boolean): TListItem;
|
||||
var
|
||||
AnItem: TListItem;
|
||||
i: Integer;
|
||||
begin
|
||||
Result := nil;
|
||||
if Inclusive then Dec(StartIndex);
|
||||
for i := StartIndex + 1 to Count - 1 do
|
||||
begin
|
||||
AnItem := Item[i];
|
||||
if (AnItem <> nil) and (AnItem.Data = Value) then
|
||||
begin
|
||||
Result := AnItem;
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
if Wrap then
|
||||
begin
|
||||
if Inclusive then Inc(StartIndex);
|
||||
for i := 0 to StartIndex - 1 do
|
||||
begin
|
||||
AnItem := Item[i];
|
||||
if (AnItem <> nil) and (AnItem.Data = Value) then
|
||||
begin
|
||||
Result := AnItem;
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TListItems.GetEnumerator: TListItemsEnumerator;
|
||||
begin
|
||||
Result := TListItemsEnumerator.Create(Self);
|
||||
|
Loading…
Reference in New Issue
Block a user