Operating principle
The filter is enabled by the Column object's FILTER property.
This property determines whether or not a read-only field containing the filter value is displayed in the column heading, underneath the column name.
A context-sensitive menu can be called from this field. This menu contains:
- The four most recently used filters.
A symbol to the left of the filter text, indicating the selection type: "=" (Equal to), ">" (Greater than or equal to), "<" (Less than or equal to), "~" (Contains), "%" (Starts with), "!" (Not equal to), and "/" (Does not contain). - The special value "*", which does not filter any rows.
- A "Filter" option that displays the filter definition box.
A check mark indicates the current filter setting.
Notes:
-
- Where a column has a check box representation, the filter menu will only offer the "Checked", "Unchecked" and "*" options.
- The Column object's INITIALIZE_FILTER_FIELD method resets a column's filter field with the "*" value.
- The List object's INITIALIZE_FILTER_FIELDS method resets all the columns in the list.
Filters can be managed in either automatic mode or manual mode.
Automatic mode
In automatic mode, row filtering is managed entirely by Adelia. Filtering only applies to the rows loaded in the graphical list. The filtered rows are still present in the list but are hidden. The VISIBLE_LINE property of filtered rows is set to *FALSE.
Selecting the "Filter" option in the context-sensitive menu opens a dialog box that lets the user specify selection criteria.
Manual mode
In manual mode, the developer filters the rows manually and can create a dedicated filter definition box.
Clicking the Filter option in a column's context-sensitive menu triggers the SelectFilter event for the column. This event lets the developer call their own filter definition box. After this dialog box is called, the TRIGGER_FILTER_ACTION method must be called in order to trigger the FilterAction event, specifying the filter's internal value (which unambiguously identifies the desired value) and the filter's external value (which is displayed in the Filters context-sensitive menu).
In the FilterAction event, the developer codes the row filtering based on the value of the INTERNAL_FILTER_VALUE property. This property will have been updated when the TRIGGER_FILTER_ACTION method was called, either directly if the event was triggered as a result of calling this method, or else indirectly, if the event was triggered based on the selection of a filter in the context-sensitive menu (in which case, it is the internal value associated with the displayed filter's external value that is used, the link having been established by a previous TRIGGER_FILTER_ACTION method call).
Note: If the column's SelectFilter event is not supported in the program, the "Filter" option calls the Adelia filter definition dialog box, and the FilterAction event is triggered when this dialog box is executed. In this case, the INTERNAL_FILTER_VALUE property will have the following format:
- Positions 1 to 2: filter operator. Possible values: '=', '>', '<', '~', '%', '!', '/'. |
- Position 3: case indicator ('0' not case-sensitive, '1' case-sensitive). |
- Positions 4 to 6: value length (3 digits, left-padded with zeros). |
- Position 50: start of value. |
- The property is blank if the user has chosen to display everything ("*" filter). |
Filter definition
The filter definition dialog box is accessible in both automatic and manual filter management mode.
Radio buttons
Show all
No rows are filtered.
Filter
Enables a filter definition. Selecting this option enables the other fields in the dialog box.
The filter radio button is selected by default.
Combo box
The combo box enables the user to choose a selection criterion.
Possible values:
Starts with |
The cell must start with the string set in the filter. This criterion is only valid for alphanumerical columns. |
Contains |
The cell must contain the string set in the filter. This criterion is only valid for alphanumerical columns. |
Not equal to |
The cell must not contain the same string as the one set in the filter. The comparison may or may not be case-sensitive, depending on the value of the Match case check box. |
Equal to |
The cell must contain exactly the same value as the filter. The comparison may or may not be case-sensitive, depending on the value of the Match case check box. |
Does not contain |
The cell must not contain the string set in the filter. This criterion is only valid for alphanumerical columns. |
Greater than or equal to |
The cell must contain a value greater than or equal to the filter value. |
Less than or equal to |
The cell must contain a value less than or equal to the filter value. |
Check boxes
Match case
Valid only for alphanumerical columns, where the selection criterion is "Equal to" or "Not equal to".
Note: By default, a Visual Adelia Runtime in English displays the constants in the dialog box and the Adelia texts relating to the Filter menu options ("Filter..." , "Checked", "Unchecked") in English. A French Runtime shows these constants in French. If you want to display these constants in an alternative language, copy the "objectsv.sav" file, rename it as "objectsv.ini" and then translate the texts found in the [COLUMN] section.