[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] | Reference for unit 'CalcForm' (#lcl)

# TCalculatorForm

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Implements the form used to display a calculator for a TCalculatorDialog instance.

## Declaration

Source position: calcform.pas line 103

`type TCalculatorForm = class(TForm)`
`protected`
`class procedure WSRegisterClass; override;`
`procedure OkClick();` |  | Performs actions needed when the OK button is clicked.
`procedure CancelClick();` |  | Performs actions needed when the Cancel button is clicked.
`procedure CalcKey();` |  | Performs actions needed for a key received in the calculator form.
`procedure DisplayChange();` |  | Performs actions needed when the calculator display is changed.
`procedure InitForm(); virtual;` |  | Initializes the calculator form using the specified layout.
`public`
`constructor Create();` |  | Constructor for the class instance.
`property Value: Double; [rw]` |  | Value displayed or returned from the calculator.
`property MainPanel: TPanel; [r]` |  | TPanel instance used as a container for the display and button panels on the calculator form.
`property CalcPanel: TCalculatorPanel; [r]` |  | Panel with the calculator keys, operators,memory buttons, et. al.
`property DisplayPanel: TPanel; [r]` |  | Panel for the display area on the calculator form.
`property DisplayLabel: TLabel; [r]` |  | Label used to display the value in the panel.
`property OnCalcKey: TCalculatorCalcKeyEvent; [rw]` |  | Event handler signalled to handle keys press on the calculator form.
`property OnDisplayChange: TCalculatorDispChangeEvent; [rw]` |  | Event handler signalled when the calculator display has been changed.
`end;`

## Inheritance

`TCalculatorForm` |  | Implements the form used to display a calculator for a TCalculatorDialog instance.
`TForm` |  | Implements a form used in an LCL application.
`TCustomForm` |  | The base type for TForm classes.
`TCustomDesignControl` |  | Provides a designer surface for scaling and layout of its child controls.
`TScrollingWinControl` |  | Implements a windowed control with scroll bars.
`TCustomControl` |  | The base class for windowed controls which paint themselves.
`TWinControl` |  | Implements a windowed control which can contain other child controls.
`TControl` |  | The base class for visible controls.
`TLCLComponent` |  | The base class for LCL components which have an associated widget.
`TComponent`
?
`TObject`

## Description

TCalculatorForm is a TForm descendant which implements the form used to display a calculator. It extends the ancestor class with properties, methods, and events needed to configure and display the form instance with UI elements needed for either a simple (compact) or a normal calculator layout. Use the Create constructor to control the layout for the calculator form instance.

Use the Value property to set or get the value displayed on the calculator.

Use the OnCalcKey and OnDisplayChange event handlers to perform actions needed when keys are pressed or the display value is changed on the form instance.

## See also

TCalculatorForm.Create |  | Constructor for the class instance.
TCalculatorForm.Value |  | Value displayed or returned from the calculator.
TCalculatorPanel |  | Implements a panel used for buttons and the value display in a calculator form.
TForm |  | Implements a form used in an LCL application.