Contains classes and types used in TCalculatorForm.

calcform.pas contains classes and types used in TCalculatorForm, a dialog form used to display a calculator. It is part of the Lazarus Component Library (LCL).

Defines the default number of digits of precision used for values in TCalculatorForm. Specifies an event handler signalled for Key events occurring in TCalculatorForm. Key value examined in the event handler. Specifies an event handler signalled when the display in TCalculatorForm is changed.

TCalculatorState is an enumerated type with values that represent the status for keys/operations in the calculator. TCalculatorState is the type used to implement the Status property in TCalculatorPanel.

Value on the First key press. Value after the operation for the key has been applied successfully. Value when the operation resulted in an error.

TCalculatorLayout is an enumerated type with values that represent the layout for keys and panels on a calculator form. TCalculatorLayout is passed as an argument to the CreateCalculatorForm routine, and to methods in TCalculatorForm and TCalculatorPanel.

The default layout with larger button sizes and more whitespace. The compact layout with smaller button sizes. Implements a panel used for buttons and the value display in a calculator form. Sets the value for the text property. New value for the property. Ensures that Text is updated and displayed when Status is csFirst. Performs actions for a key press not handled by a button in the calculator panel. Clears the display and operator in the calculator panel. Updates the calculator panel to reflect an error condition, and signals OnError. Sets the Text in the calculator panel to the specified value, and signals OnDisplayChange. Double value formatted and assigned to the Text property. Gets the Double value represented in the Text property. Finds the calculator button which handles the specified key character.

Key contains a character value to locate in the button captions on the panel. Keys which are not represented by buttons, like Enter (#13) and Escape (#27), are translated to the value used for the target button. In addition, when ',' is used as the decimal separator on the system, it is translated into the '.' decimal notation.

FindButton iterates through the Controls on the panel to locate the button using the associated Key. The return value is Nil when a button is not located for the value in Key.

Button which handles the Key, or Nil when no button is available for Key. Key character to locate in the buttons for the calculator panel. Translates a mouse click on a button to the character key used in CalcKey. Calculator button for the button click notification. ErrorBeep is an empty implementation in the current LCL version. Sets the display text for the associated control and signals OnTextChange. Initializes and configures the calculator panel using the specified layout. Locates the button using the specified Key and perform its Click method. CalcKey is called when a button is located using the specified Key. Object for the KeyPress event. Key value captured in the panel. Loads the value in Text into the Clipboard as a text value. Pastes text from the Clipboard into the text display for the calculator panel. Gets the minimum number of precision digits allowable for the panel. Updates the Memory indicator to reflect a non-zero value in the Memory property. Contains the Double value representing the Text in the panel. Contains the Double value stored in the memory for the calculator. Maximum number of digits of precision allowed for the Double value in the calculator. Indicates if a beep occurs when an error condition is detected in the calculator panel. Contains the status or state for the calculator panel. Character representing the last operator entered in the calculator panel. Text representation for the Double value in the calculator. Color for the calculator panel. Implements the form used to display a calculator in a TCalculatorDialog. Performs actions needed to handle OnKeyPress events in the calculator form. Object for the event notification. Key handled in the event handler. Implements a copy menu item in the pop-up menu for the form. Object for the event notification. Gets the value for the Value property. Value for the property. Implements a paste menu item in the pop-up menu for the form. Sets the value for the Value property. New value for the property. Performs actions needed when the OK button is clicked. Performs actions needed when the Cancel button is clicked. Object for the event notification. Performs actions needed for a key received in the calculator form. Object for the event notification. Key examined in the method. Performs actions needed when the calculator display is changed. Object for the event notification. Initializes the calculator form using the specified layout. Layout applied to the calculator form instance. Constructor for the class instance. Owner of the class instance. TCalculatorLayout used for the form instance. Value displayed or returned from the calculator. Panel with the calculator keys, operators,memory buttons, et. al. Panel for the display area on the calculator form. Label used to display the value in the panel. Event handler signalled to handle keys press on the calculator form. Event handler signalled when the calculator display has been changed. Creates and configures a new TCalculatorForm instance. Form instance created in the method. Owner for the new form instance. Layout for the calculator panel in the form instance. Color for the numeric digit buttons in a calculator. Color for the Memory button in a calculator. Color for the Clear button in a calculator. Color for the OK button in a calculator. Color for the Cancel button in a calculator. Color for miscellaneous "other" buttons in a calculator. Color for text on the display area for a calculator. Color for the background of the display area in a calculator. Font name used for buttons and displays in a calculator. Font size used for buttons and displays in a calculator. Font style used for buttons and displays in a calculator.