mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-10 03:48:27 +02:00
LCL, LazControls: Finish the FilterItem events ItemData parameter change. Patch from Ondrej.
git-svn-id: trunk@52748 -
This commit is contained in:
parent
a9e52f41eb
commit
d447c14966
@ -160,7 +160,7 @@ begin
|
||||
else
|
||||
EndInd := 0;
|
||||
for i := 0 to EndInd do begin
|
||||
if DoFilterItem(aData.StringArray[i], FilterLC, TObject(aData.Data)) then
|
||||
if DoFilterItem(aData.StringArray[i], FilterLC, aData.Data) then
|
||||
Exit(True);
|
||||
end;
|
||||
Result := False;
|
||||
|
@ -475,7 +475,7 @@ begin
|
||||
if Assigned(fOnFilterNode) then
|
||||
Pass := fOnFilterNode(Node, Done);
|
||||
if not (Pass and Done) then
|
||||
Pass := DoFilterItem(Node.Text, FilterLC, TObject(Node.Data));
|
||||
Pass := DoFilterItem(Node.Text, FilterLC, Node.Data);
|
||||
if Pass and (fFirstPassedNode=Nil) then
|
||||
fFirstPassedNode:=Node;
|
||||
// Recursive call for child nodes.
|
||||
|
@ -224,9 +224,9 @@ type
|
||||
fOnFilterItemEx: TFilterItemExEvent;
|
||||
fOnCheckItem: TCheckItemEvent;
|
||||
function DoFilterItem(const ACaption, FilterLC: string;
|
||||
ItemData: TObject): Boolean;
|
||||
ItemData: Pointer): Boolean;
|
||||
function DoDefaultFilterItem(const ACaption, FilterLC: string;
|
||||
const ItemData: TObject): Boolean; virtual;
|
||||
const ItemData: Pointer): Boolean; virtual;
|
||||
procedure EditKeyDown(var Key: Word; Shift: TShiftState); override;
|
||||
procedure EditChange; override;
|
||||
procedure EditEnter; override;
|
||||
@ -1126,14 +1126,14 @@ begin
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
function TCustomControlFilterEdit.DoDefaultFilterItem(const ACaption, FilterLC: string;
|
||||
const ItemData: TObject): Boolean;
|
||||
function TCustomControlFilterEdit.DoDefaultFilterItem(const ACaption,
|
||||
FilterLC: string; const ItemData: Pointer): Boolean;
|
||||
begin
|
||||
Result := (FilterLC='') or (Pos(FilterLC,UTF8LowerCase(ACaption))>0);
|
||||
end;
|
||||
|
||||
function TCustomControlFilterEdit.DoFilterItem(const ACaption, FilterLC: string;
|
||||
ItemData: TObject): Boolean;
|
||||
function TCustomControlFilterEdit.DoFilterItem(const ACaption,
|
||||
FilterLC: string; ItemData: Pointer): Boolean;
|
||||
var
|
||||
Done: Boolean;
|
||||
begin
|
||||
|
Loading…
Reference in New Issue
Block a user