EhLib has a set of data-aware edit controls to edit data: TDBEditEh, TDBDateTimeEditEh, TDBComboBoxEh, TDBNumberEditEh and TDBLookupComboboxEh. EhLib doesn’t have not data-aware version of these controls because every control can work as in data-aware mode and not in data-aware mode. The base class for every edit control is TCustomDBEditEh. TCustomDBEditEh encapsulates the behavior that is common for all edit controls for editing text and if it is required for editing a DataSet’s field by introducing methods and properties that provide:
Application can use Text (String type) and Value (Variant type) properties to get and set string or variant values to controls. Text property is a text that you can see in control. Value property hold value of variant type and can hold values of types depending of control type. It can hold Null value or:
If control is connected to the field then the assignment data to the Text or Value properties automatically write data to the field.
Every control has Flat and AlwaysShowBorder properties to control the border appearance.
All controls have EmptyDataInfo property that allows customize edit control to draw special text and font when control have no data (Edit1.Text = ‘’).
DynVarsEh is declared in a module class TDynVarsEh which implements a dynamic collection of scalar variables. Property of the type declared in the component can store a collection of named dynamic set of variables.
Property type TDynVarsEh is declared with the following components and classes:
Collection TDynVarsEh generated from class TCollection. In Design-Time can create the elements of the type TDynVarEh with the following properties:
public property AsBoolean: Boolean; property AsCurrency: Currency; property AsDateTime: TDateTime; property AsFloat: Double; property AsInteger: LongInt; property AsRefObject: TObject; property AsString: String; property IsNull: Boolean; published property Name: String; property Value: Variant;
In Run-Time collection items can be created dynamically by assigning values.
When reading a collection of values (DBEditEh1.DynProps ['Var1'].Value), if the item in the collection named 'Var1' is present in the list, it returns the value of the variable. If the element name is not present, it returns the value Unassigned.
When assigning values, the algorithm checks for the item in the collection.
DBEditEh1.DynProps ['Var1'].Value: = 'StrValue1';
If the item named 'Var1' isn’t in the list, a new element is created in the collection and is assigned with the specified value.
Every edit control allows to have one or more edit buttons on the right side. You can use EditButton and EditButtons to control them.
Copyright (c) 1998-2013. All rights reserved.
What do you think about this topic? Send feedback!