5,916
社区成员




procedure TfmFilterControlDialog.ApplyFilter;
begin
SetControlsEnabled(False);
DoBeforeApply;
try
FilterControl.ApplyFilter;
finally
DoAfterApply;
SetControlsEnabled(True);
end;
end;
继续跟踪 DoBeforeApply ,发现其也是一个虚方法:
procedure TfmFilterControlDialog.DoBeforeApply;
begin
if Assigned(FOnBeforeApply) then
FOnBeforeApply(Self);
end;
又发现 FOnBeforeApply 的声明为:
FOnBeforeApply: TNotifyEvent;
到这,就不懂得如何往下跟踪了... function TcxFilterCriteria.AddItem(AParent: TcxFilterCriteriaItemList; AItemLink: TObject;
AOperatorKind: TcxFilterOperatorKind; const AValue: Variant;
const ADisplayValue: string): TcxFilterCriteriaItem;
begin
if AParent = nil then
AParent := Root;
if AOperatorKind in [foLike, foNotLike] then
Result := AParent.AddItem(AItemLink, AOperatorKind, '%' + AValue + '%', ADisplayValue)
else
Result := AParent.AddItem(AItemLink, AOperatorKind, AValue, ADisplayValue);
end;