The following parameters are available to set up value editor using binding string:
Name of the parameter |
Type | Description | Mandatory |
VALUE | Real | Default value. | None |
MINVAL | Real | Minimum available value. | None |
MAXVAL | Real | Maximum available value. | None |
PRECISION | Integer | Precision of displayed value (number of digits after comma). | None |
STEP | Real | Step. | None |
ALLOWEMPTY | Logical | Value can be empty. | None |
CORRECTONEXIT | Logical | Indicates that value is automatically adjusted on editor loss of focus. | None |
Logical values are set as a character string of the ON/OFF or the True/False type.
None
UI="FloatEdit" VALUE="50" MINVAL="0" MAXVAL="100" PRECISION="2" STEP="0.05"
Executing the example requires a form with the button named Button1 on it, the TabSheetBox component and the UiTabSheet component named UiTabSheet1, which is the data source for TabSheetBox.
Class TestForm: Form
Button1: Button;
UiTabSheet1: UiTabSheet;
TabSheetBox1: TabSheetBox;
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
BM: IBindingManager;
FloatEditBinding: IBindingFloatEdit;
Begin
BM := New BindingManager.Create;
FloatEditBinding := BM.CreateByUi("FloatEdit") As IBindingFloatEdit;
FloatEditBinding.MinValue := -100;
FloatEditBinding.MaxValue := 100;
FloatEditBinding.Precision := 3;
FloatEditBinding.Step_ := 0.005;
FloatEditBinding.Value := 0;
FloatEditBinding.CorrectOnExit := True;
UiTabSheet1.TabSheet.Cell(0, 0).Style.Binding := FloatEditBinding.AsString;
End Sub Button1OnClick;
End Class TestForm;
Clicking the button sets the value editor for the A0 table cell. On editing the cell the real value input field is displayed, minimum value is -100, maximum value is 100, precision is three decimal places, the step is 0.005, the default value is 0.