MaxValue: Decimal;
MaxValue: Decimal;
The MaxValue property determines value of the MAXVAL parameter in binding string.
The MAXVAL parameter determines maximum available value, which can be set in editor.
The MaxValue property is available if the MaxValueDefined property is set to True. If the MaxValue property is changed, the MaxValueDefined property is automatically set to True.
Function CreateDecimalEditBidning(DefaultValue: Decimal): String;
Var
BM: IBindingManager;
DecimalEditBinding: IBindingDecimalEdit;
Begin
BM := New BindingManager.Create;
DecimalEditBinding := BM.CreateByUi("DecimalEdit") As IBindingDecimalEdit;
DecimalEditBinding.MinValue := DefaultValue - 100;
DecimalEditBinding.MaxValue := DefaultValue + 100;
DecimalEditBinding.Precision := 20;
DecimalEditBinding.Step_ := 0.000000000000000000005;
DecimalEditBinding.Value := DefaultValue;
DecimalEditBinding.CorrectOnExit := True;
Return DecimalEditBinding.AsString;
End Function CreateDecimalEditBidning;
This function generates binding string to use value editor of high precision real values. The value, towards which editor parameters are determined, is passed by the DefaultValue input parameter. The value precision will be 20 digits after comma in the editor, the editor step is 0.000000000000000000005. When invalid value is input into the cell with editor (greater than maximum or less than minimum) and the focus is removed from the cell, the editor value will be replaced with the nearest available.
Imports Prognoz.Platform.Interop.ForeSystem;
Function CreateDecimalEditBidning(DefaultValue: Decimal): String;
Var
BM: BindingManager = New BindingManagerClass();
DecimalEditBinding: IBindingDecimalEdit;
Begin
DecimalEditBinding := BM.CreateByUi("DecimalEdit") As IBindingDecimalEdit;
DecimalEditBinding.MinValue := DefaultValue - 100;
DecimalEditBinding.MaxValue := DefaultValue + 100;
DecimalEditBinding.Precision := 3;
DecimalEditBinding.@Step := 0.005;
DecimalEditBinding.Value := DefaultValue;
DecimalEditBinding.CorrectOnExit := True;
Return DecimalEditBinding.AsString;
End Function;
The example execution result is similar to the Fore Example result.
See also: