mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-17 12:50:15 +01: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;
|
function FindCaption(StartIndex: Integer; Value: string;
|
||||||
Partial, Inclusive, Wrap: Boolean;
|
Partial, Inclusive, Wrap: Boolean;
|
||||||
PartStart: Boolean = True): TListItem;
|
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 GetEnumerator: TListItemsEnumerator;
|
||||||
function IndexOf(const AItem: TListItem): Integer;
|
function IndexOf(const AItem: TListItem): Integer;
|
||||||
function Insert(const AIndex: Integer) : TListItem;
|
function Insert(const AIndex: Integer) : TListItem;
|
||||||
@ -1183,6 +1184,7 @@ type
|
|||||||
procedure EndUpdate;
|
procedure EndUpdate;
|
||||||
procedure Repaint; override;
|
procedure Repaint; override;
|
||||||
function FindCaption(StartIndex: Integer; Value: string; Partial, Inclusive, Wrap: Boolean; PartStart: Boolean = True): TListItem;
|
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 GetHitTestInfoAt(X, Y: Integer): THitTests;
|
||||||
function GetItemAt(x,y: integer): TListItem;
|
function GetItemAt(x,y: integer): TListItem;
|
||||||
property BoundingRect: TRect read GetBoundingRect;
|
property BoundingRect: TRect read GetBoundingRect;
|
||||||
|
|||||||
@ -863,6 +863,12 @@ begin
|
|||||||
Result := FListItems.FindCaption(StartIndex, Value, Partial, Inclusive, Wrap);
|
Result := FListItems.FindCaption(StartIndex, Value, Partial, Inclusive, Wrap);
|
||||||
end;
|
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;
|
function TCustomListView.GetBoundingRect: TRect;
|
||||||
begin
|
begin
|
||||||
if not HandleAllocated
|
if not HandleAllocated
|
||||||
|
|||||||
@ -436,11 +436,42 @@ begin
|
|||||||
FCacheItem := Result;
|
FCacheItem := Result;
|
||||||
Exit;
|
Exit;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Result := nil;
|
Result := nil;
|
||||||
end;
|
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;
|
function TListItems.GetEnumerator: TListItemsEnumerator;
|
||||||
begin
|
begin
|
||||||
Result := TListItemsEnumerator.Create(Self);
|
Result := TListItemsEnumerator.Create(Self);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user