LCL, LazControls: Finish the FilterItem events ItemData parameter change. Patch from Ondrej.

git-svn-id: trunk@52748 -
This commit is contained in:
juha 2016-07-24 21:39:50 +00:00
parent a9e52f41eb
commit d447c14966
3 changed files with 8 additions and 8 deletions

View File

@ -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;

View File

@ -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.

View File

@ -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