mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 11:56:45 +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
|
else
|
||||||
EndInd := 0;
|
EndInd := 0;
|
||||||
for i := 0 to EndInd do begin
|
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);
|
Exit(True);
|
||||||
end;
|
end;
|
||||||
Result := False;
|
Result := False;
|
||||||
|
@ -475,7 +475,7 @@ begin
|
|||||||
if Assigned(fOnFilterNode) then
|
if Assigned(fOnFilterNode) then
|
||||||
Pass := fOnFilterNode(Node, Done);
|
Pass := fOnFilterNode(Node, Done);
|
||||||
if not (Pass and Done) then
|
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
|
if Pass and (fFirstPassedNode=Nil) then
|
||||||
fFirstPassedNode:=Node;
|
fFirstPassedNode:=Node;
|
||||||
// Recursive call for child nodes.
|
// Recursive call for child nodes.
|
||||||
|
@ -224,9 +224,9 @@ type
|
|||||||
fOnFilterItemEx: TFilterItemExEvent;
|
fOnFilterItemEx: TFilterItemExEvent;
|
||||||
fOnCheckItem: TCheckItemEvent;
|
fOnCheckItem: TCheckItemEvent;
|
||||||
function DoFilterItem(const ACaption, FilterLC: string;
|
function DoFilterItem(const ACaption, FilterLC: string;
|
||||||
ItemData: TObject): Boolean;
|
ItemData: Pointer): Boolean;
|
||||||
function DoDefaultFilterItem(const ACaption, FilterLC: string;
|
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 EditKeyDown(var Key: Word; Shift: TShiftState); override;
|
||||||
procedure EditChange; override;
|
procedure EditChange; override;
|
||||||
procedure EditEnter; override;
|
procedure EditEnter; override;
|
||||||
@ -1126,14 +1126,14 @@ begin
|
|||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCustomControlFilterEdit.DoDefaultFilterItem(const ACaption, FilterLC: string;
|
function TCustomControlFilterEdit.DoDefaultFilterItem(const ACaption,
|
||||||
const ItemData: TObject): Boolean;
|
FilterLC: string; const ItemData: Pointer): Boolean;
|
||||||
begin
|
begin
|
||||||
Result := (FilterLC='') or (Pos(FilterLC,UTF8LowerCase(ACaption))>0);
|
Result := (FilterLC='') or (Pos(FilterLC,UTF8LowerCase(ACaption))>0);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCustomControlFilterEdit.DoFilterItem(const ACaption, FilterLC: string;
|
function TCustomControlFilterEdit.DoFilterItem(const ACaption,
|
||||||
ItemData: TObject): Boolean;
|
FilterLC: string; ItemData: Pointer): Boolean;
|
||||||
var
|
var
|
||||||
Done: Boolean;
|
Done: Boolean;
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user