TTMSFNCCustomFilterRulesManager Class
Non-visual component that owns a collection of filter rules and applies them by resolving item paths, evaluating filter expressions, and writing property values via RTTI.
API unit family: TMS.TMSFNCFilterRulesManager
Inherits from: TComponent
Syntax
TTMSFNCCustomFilterRulesManager = class(TComponent)
Remarks
Drop on a form or create in code. Add rules via AddRule, ShowWhere, HideWhere, EnableWhere, DisableWhere, or the AddRuleXxx shortcuts, then call Apply to evaluate all active rules. Use the published TTMSFNCFilterRulesManager subclass to expose Rules and events in the DFM designer.
Methods
| Name | Description |
|---|---|
| AddPlaceholder | Adds a text-source entry that substitutes {APlaceholderName} in FilterText and ItemsPath with the value of APropertyName on ASource at Apply time; returns Self for chaining. |
| AddRule | Adds a rule with a raw filter-text expression; returns the new rule. |
| AddRuleContains | Adds a contains-condition rule with no action; the caller adds actions via the returned rule. |
| AddRuleEndsWith | Adds an ends-with condition rule with no action; the caller adds actions via the returned rule. |
| AddRuleEquals | Adds an equals-condition rule with no action; the caller adds actions via the returned rule; AApply defaults to False. |
| AddRuleStartsWith | Adds a starts-with condition rule with no action; the caller adds actions via the returned rule. |
| Apply | Applies all active rules in order, firing OnBeforeApply and OnAfterApply events. |
| ApplyActiveRules | Applies active rules whose Name matches APattern using SQL-LIKE wildcards (% = any sequence, _ = one char); prefix with ! to invert the match. |
| ApplyInactiveRule | Pushes inactive values for one rule regardless of its Active flag; fires rule-level events. |
| ApplyRule | Applies a single rule, respecting its Active flag; fires rule-level events. |
| DisableWhere | Upserts a disable rule that sets Enabled=False on match and Enabled=True on no-match; applies immediately when AApply is True (default). |
| EnableWhere | Upserts an enable rule that sets Enabled=True on match and Enabled=False on no-match; applies immediately when AApply is True (default). |
| GetRuleByName | Returns the first rule whose Name matches AName (case-insensitive), or nil when not found. |
| HideWhere | Upserts a visibility rule that sets Visible=False on match, Visible=True on no-match and when inactive; applies immediately when AApply is True (default). |
| ShowWhere | Upserts a visibility rule that sets Visible=True on match and Visible=False on no-match; applies immediately when AApply is True (default). |