The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....



ButtonPivots


Unit: SDL_numio
Class: TNumIO2
Declaration: ButtonPivots : TDoubleArray;

If the public array ButtonPivots is empty (the default case) the next value when clicking the up or down button is calculated by adding or subtracting the increment ButIncrem to or from the current value of the numeric input field. If ButtonPivots is not empty the next value is set to the next higher or lower value of the ButtonPivots array.

Hint: The array has to be filled with a sorted list of increasing double precision floating point numbers. If the array does not increase monotonously the behavior of the up/down buttons becomes indeterminate.

Example: The following code snippet shows how to set the ButtonPivots array of the component MyNumIO2 to a 1-2-5 system between 0.01 and 10:
const
  SizeArray = 10;
  SigLevels : array[1..SizeArray] of double =
                  (0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 1, 2, 5, 10);

var
  i : integer;

begin
Setlength(MyNumIO2.ButtonPivots,SizeArray);
for i:=1 to SizeArray do
  MyNumIO2.ButtonPivots[i-1] := SigLevels[i];
end;
If, for example, the current value of the input field is 0.43, the value is changed to 0.2 if the down button is clicked, or 0.5 if the up button is clicked.



Last Update: 2023-Dec-14