What's New in EhLib.VclFmx 12.1
What's New in EhLib.VclFmx 12.1
Support for RAD Studio 13
The library now supports Embarcadero RAD Studio 13.
Updates to EhLibFmx Package
Fmx.TDataVertGridEh and Fmx.TDataComboBoxEh components have been added to EhLibFmxpackage.
Fmx.TDataVertGridEh
The TDataVertGridEh is a grid component that displays records in a vertical orientation. Each record is represented as a set of rows, with rows (TDataVertGridRowEh) functioning similarly to columns in a standard TDataGridEh.
Features
- The interface and configuration are largely similar to the
Fmx.TDataGridEhcomponent. - Uses rows (
TDataVertGridRowEh) instead of columns, each corresponding to a specific field in the dataset. - Supports major data handling mechanisms, including editing, displaying, and binding to a data source.
- In the current version,
TDataVertGridEhdisplays only one record at a time on the screen.
See an example in the demo project EhLib.Fmx.MainDemo.dpr in the DemoFrame.VerticalGrid module.
Fmx.TDataComboBoxEh
The TDataComboBoxEh component is designed for displaying and selecting values from a list. It supports two operating modes:
- Regular Dropdown List
- Lookup List
Both modes can operate with or without data binding (DataSource/DataField).
Sources of List Items
- External List:
- Use the
ListSource: TComponentproperty to bind to aTDataSourceorTDataSetobject.
- Use the
- Built-in List:
- Use the
ListItems: TStringsproperty to manually define a collection of strings for the dropdown list.
- Use the
- Data Binding:
- Use the
DataSourceandDataFieldNameproperties to bind to a data source.
- Use the
- External List Configuration:
- Simple List Mode: Populate
ListSourceandListFieldName. - Lookup Mode: Populate
ListSource,ListFieldName, andListKeyFieldName.
- Simple List Mode: Populate
- Built-in List Configuration:
- Simple List Mode: Populate
ListItemswith strings to display. - Lookup Mode: Populate
ListItemswith strings in the format:Key|Display Value.
- Simple List Mode: Populate
See an example in the demo project EhLib.Fmx.MainDemo.dpr in the SolutionFrame.ComboBoxes module.
TDataGridComboboxColumnEh in Fmx.TDataGridEh
A new column type, TDataGridComboboxColumnEh, has been added to the TDataGridEh designer at design-time. This class enables cell editing using a ComboBox control with a dropdown list. Configuration of TDataGridComboboxColumnEh is similar to that of the TDataComboBoxEh component in data-binding mode.
URL Highlighting in Fmx.TDataGridStringColumnEh
The Fmx.TDataGridStringColumnEh component now supports automatic highlighting of URL text sections (e.g., http:// or https://), making clickable elements easily recognizable.
- Enabling URL Highlighting:
- Set the
HighlightHyperlinksproperty toTrue.
- Set the
- Event Handling:
- The
OnDataCellInTextLinkClickevent is triggered when clicking a highlighted URL, allowing custom handling of link navigation.
- The
See an example in the demo project EhLib.Fmx.MainDemo.dpr in the SolutionFrame.HighlightingLinksFormatTextSections.pas module.
Text Formatting in Fmx.TDataGridStringColumnEh
Support for formatting text sections has been added to the Fmx.TDataGridEh.OnDataCellGetStyleParams and Fmx.TDataGridColumnEh.OnDataCellGetStyleParams events. The Params: TList<TLaFormattedTextRangeEh> parameter now includes a FormattedRanges property. Populate this property with a list of text ranges and their formatting details.
Example Event Handler
The following example formats the first letter of each cell's text with a custom font:
procedure TfrHighlightingLinksFormatTextSections.
DataGridStringColumnEh2DataCellGetStyleParams(
Sender: TObject; Params: TDataGridStringDataCellStyleParamsEh);
var
FormattedRange: TLaFormattedTextRangeEh;
begin
FormattedRange := TLaFormattedTextRangeEh.Create;
FormattedRange.TextPos := 0;
FormattedRange.TextLength := 1;
FormattedRange.IsHyperLink := True;
FormattedRange.Font := CapitalCharFont;
FormattedRange.FontColor := TAlphaColorRec.Brown;
Params.FormattedRanges.Add(FormattedRange);
end;See an example in the demo project EhLib.Fmx.MainDemo.dpr in the SolutionFrame.HighlightingLinksFormatTextSections module.
Displaying Non-Split Records in Fmx.TDataGridEh
The OnGetDataRowSplitWay event has been added to Fmx.TDataGridEh, allowing a grid row to be displayed as a single, non-split record. This is useful for displaying group-common records. If the OnGetDataRowManager event is registered, implement its handler to return the CellManager used to display the entire record.
See an example in the demo project EhLib.Fmx.MainDemo.dpr in the SolutionFrame.RowAsWhole.pas module, visible on the Solutions – Row As Whole tab.
Tree Status Area in Fmx.TDataGridEh
The OnGetDataTreeViewAreaParams event has been added to Fmx.TDataGridEh. This event allows setting display parameters for the TreeView element, shown on the left side of the cell with a + or - icon for expanding/collapsing the tree and an indent level indicating nesting.
The TDataGridEh component cannot build a tree structure itself. Use additional classes like TMemTableEh in TreeView mode or base classes EhLibRtl.TTreeListEh and EhLibRtl.TBaseTreeNodeEh to create the tree structure.
The OnSetDataTreeSignState event has been added to handle mouse clicks on the +/- icon. In this event, update the "Open/Closed" state of the tree element and rebuild the internal list to include only visible sub-elements where TreeNode.Expanded = True.
See examples in the demo project EhLib.Fmx.MainDemo.dpr in the SolutionFrame.TreeViewWithMemTableEh.pas and SolutionFrame.TreeViewWithTreeListEh modules.
Other Improvements and Changes
EhLibFmx Package
New Events in Fmx.TDataGridColumnEh:
OnCreateDataCellContentOnDataCellInitContentOnDataCellInitEditorOnDataCellInitEditParamsOnDataCellStartEditOnDataCellCanModify
Changes in Module and Class Names:
- Removed module:
EhLibFmx.DataGrid.ComboDataCells.pas- ComboBox functionality for
TDataGridEhandTDataVertGridEhmoved toEhLibFmx.DataAxisGrid.ComboDataCells.
- ComboBox functionality for
- Removed module:
EhLibFmx.LaFlowRichBlocks.pas- Text section formatting functionality added to the
TLaTextBlockEhclass.
- Text section formatting functionality added to the
- Removed modules:
Design.Fmx\EhLibFmx.Design.DataGridColumns.pasDesign.Fmx\EhLibFmx.Design.Items.pas
- Added new modules:
EhLibFmx.DataAxisGrid.ComboDataCells.pasEhLibFmx.DataAxisGrid.CustomizeFieldBarsDialog.pasEhLibFmx.DataAxisGrid.DataCells.pasEhLibFmx.DataComboBoxes.pasEhLibFmx.CustomDataVertGrids.pasEhLibFmx.DataVertGrid.Columns.pasEhLibFmx.DataVertGrid.CustomizeRowsDialog.pasEhLibFmx.DataVertGrid.GridManagers.pasEhLibFmx.DataVertGrid.Rows.pasEhLibFmx.DataVertGrid.RowsHeader.pasEhLibFmx.DataVertGrid.ToolControls.pasEhLibFmx.DataVertGrids.pasDesign.Fmx\EhLibFmx.Design.DataGrids.pasDesign.Fmx\EhLibFmx.Design.DataVertGrids.pasDesign.Fmx\EhLibFmx.Design.ItemsEditorForm.pas
- Removed module:
EhLibVcl Package
No changes or additions were made to the EhLibVcl package in this version.
