Sign in Join
Wiki copytemporary

LazControls

LazControls is a set of controls that are often used in Lazarus IDE itself, but they can be used elsewhere, too. They are available under the LazControls tab of the Component Palette.

FilterEdit controls

Controls inherited from TCustomControlFilterEdit provide a filtering edit box connected to a container control. Currently there are filters for TListBox, TListView and TTreeView implemented. When the container control is connected to the filter control, the filtering happens automatically as a user enters text. When the filter is empty and does not have focus, it shows a grey "(filter)" text.

There are some common properties that control the behavior:

Then the gray "(filter)" can remain visible even when the control gains focus. When UseFormActivate is True, it finds the parent form and registers handlers for its OnActivate and OnDeactivate events. They properly keep track when the control has focus. This setting is False by default to make sure no existing event handler is overwritten. (An improvent could be to save an existing handler before registering a new one.)

TListFilterEdit

This control can filter a ListBox. Properties:

Data should be added to TListFilterEdit.Items, not to the container ListBox.Items list. The filter works on its own internal data list and copies to the ListBox only the items that pass the filtering tests. The Items property is also a TStringList and works the same way as ListBox.Items.

You can also attach a filter to a ListBox which contains existing data. Then the existing items are copied to the filter's items initially.

Working with TCheckListBox

ToDo:

TListViewFilterEdit

This control can filter a ListView. Properties:

Data should be added to TListViewFilterEdit.Items, not to the container ListView.

ToDo...

You can also attach a filter to a ListView which contains existing data. Then the existing items are copied to the filter's items initially.

TTreeFilterEdit

This control can filter a TTreeView. Important properties:

This control has 2 different operation modes. They are so different that there could be 2 separate controls as well. One mode maintains and filters sub-items of root-nodes in a tree, another mode filters a whole existing tree using TreeNode.Visible property.

Mode 1: Sub-branches under root nodes

Items for each branch are maintained in TTreeFilterBranch class instance. The functions :

can be used to get a new or existing branch. All its items will show under ARootNode.

Items can be added to a branch with procedure

ToDo: explain better

The branches can also show a directory hierarchy. It is controlled by property :

If enabled, it assumes the strings are directory names with separators and creates a multi-level tree structure imitating the directory structure.

This mode of TreeFilterEdit is used in Lazarus IDE for Package and Project Inspectors.

Mode 2: A whole tree

When no branches are defined (no calls made to GetBranch), the TreeFilterEdit control filters the whole tree automatically. It uses each TreeNode's Visible property to show/hide it.

Nodes and their parent nodes are expanded during filtering as needed. There is also one property affecting the expansion:

If enabled, all nodes will be expanded in the beginning.

This mode of TreeFilterEdit is used in Lazarus IDE for Options windows, Object inspector, and others...

SpinEx controls

T(Float)SpinEditEx is a control similar to T(Float)SpinEdit, but it is implemented in a widgetset independant manor.
Especially the behaviour of the control, when the text inside it does no represent a valid number, is consistent across widgetsets.
This behaviour is controlled by the control's NullValueBehaviour property.
Unlike T(Float)SpinEdit then result of GetValue is always derived from the actual text in the control.
T(Float)SpinEdit also has some nice features that T(Float)SpinEdit does not have.

TSpinEditEx

TFloatSpinEditEx


From the Free Pascal wiki, page "LazControls", as it stood on 2024-03-24 after a change by Bart, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.

Revision 1, last changed by WikiArchive .

Talk about this page

Nobody has opened a bench for this page yet. Sign in to open one.