EqapSpinEdit (version 1.1, 10.10.2011)

The EqapSpinEdit is a part of EqapPackage and is a visual component designed to edit integer and real numbers.


1. Appearance

The EqapSpinEdit (Fig. 1) contains the text field for a number and the control buttons to edit the number digits.

Fig. 1. EqapSpinEdit component

A number might be entered manually or inserted from the clipboard. The principal feature of the component is that you can edit the whole number or a single digit of this number. To edit the desired digit just left-click to the digit to select it (Fig. 1, on the right). Then change the digit value by control for number editing. If a digit value increases to "9", the selection will move automatically to the next superior digit. If a digit value decreases to "0", the selection will move to neighbour minor digit. If no any particular digit is selected, the number will be changed to "Increment" (see below) in the most minor digit when the control for number editing is clicking.


2. Properties and events

The EqapSpinEdit inherits properties and events of TPanel, and has own properties and events:

Properties

Value: double - current value (number) as indicated in the number field.

DigitsAfterSeparator: integer - maximal number of digits after decimal separator for Value. If Value has more digits than DigitsAfterSeparator, the Value will be truncated until DigitsAfterSeparator. The default value is "3", so the default Value will appear as "0.000".

Increment: double - desired increment/decrement for Value, when operating via control for number editing.

MaxValue: double - maximal value of the number. Further increment will not result in Value increase.

MinValue: double - minimal value of the number. Further decrement will not result in Value decrease.

NumberType: TEqapSpinEditNumberType - type of the number. The available values are: esentInteger (integer number) and esentFloat (real number). The default value is esentFloat.

Events

OnChange: TNotifyEvent - event arises when the Value is changed.


3. The example of using

EqapSpinEdit1 is placed on Form1 and its OnChange event is assigned. A message will appear if the number in EqapSpinEdit has been changed.

procedure TForm1.EqapSpinEdit1Change(Sender: TObject);
begin
ShowMessage(FloatToStr(EqapSpinEdit1.CurrentValue));
end;

All the software products are free for use. Any commercial using is not permitted without author's permission (o.lookin@iip.uran.ru).

 

Hosted by uCoz