TcxCalcEdit Class
An editor with a dropdown calculator window.
Declaration
TcxCalcEdit = class(
TcxCustomCalcEdit
)
Remarks
The TcxCalcEdit editor incorporates a dropdown calculator. The calculator is displayed within the popup window and allows a user to perform arithmetic operations such as ‘/‘, ‘‘, ‘-‘, ‘+’, ‘square root’, ‘%’, ‘1/x’ and store the result in the edit value of the **TcxCalcEdit* control. A user can calculate a value either by pressing the appropriate keys or by clicking the buttons on the calculator window.
The following image demonstrates two calculator editors painted in default and native styles.
To access a stored value (result) in the editor you can use either the EditValue or the Value property. The Value property always returns the actual number, while EditValue is a variant and in some cases it can specify NULL.
Pressing the Enter key in the dropdown calculator evaluates the last operation and closes the dropdown window. If the dropdown window is opened, pressing the Esc key results in closing it. If pressing the Esc key repeats, then the changes made to the editor value are discarded and the editor value reverts to the old one.
Use the Properties and style (the Style, StyleDisabled, StyleFocused and StyleHot) members to specify the behavior and appearance of your calculator editor. Working with the style is discussed in the TcxCustomEditStyle class topic.