[Overview][Classes][Procedures and functions][Index] |
Creates, configures, and displays the form for the calculator dialog.
Source position: extdlgs.pas line 165
public function TCalculatorDialog.Execute: Boolean; override; |
True when the modal result for the form is mrOk.
Execute is an overridden Boolean function used to create, configure, display, and capture the result from the form for the calculator dialog. Execute calls CreateCalculatorForm to create the TCalculatorForm in the DlgForm property, and sets the event handlers for the form to methods defined in the class instance. For example:
When DialogScale contains any value other than 100, the scaling percentage is applied to DlgForm.
The value in DialogPosition is stored in DlgForm as well. At design-time, the dialog position is always aligned to the center of the screen (or current monitor). When DialogPosition is poDesigned, the form coordinates in DlgForm are set to the values in the Left and Top properties. The content stored in the Title, Memory, Precision, and Value properties are copied into the corresponding properties in DlgForm.
Execute calls the ShowModal method in DlgForm to display the modal calculator dialog form. The return value for the method is set to True when the modal result from the form is mrOk. When the result is True, the Memory and Value properties are updated with the values form the dialog form. The Change method is called when the Value property has been altered.
The coordinates for the form are captured on exit, and stored in the Left and Top properties. The dimensions for the form (Width and Height) are also stored.
Execute frees the resources allocated to the DlgForm property prior to exit from the method.
|
The Title or Caption displayed for the dialog. |
|
|
Memory - the value stored in the calculator's memory. |
|
|
Precision - the level of precision to be used in calculations; default is set by DefCalcPrecision. |
|
|
Value - the numeric value (result) returned by the calculator. |
|
|
Specifies the position where the dialog is displayed. |
|
|
Contains the left coordinate for the dialog form. |
|
|
Contains the top coordinate for the dialog form. |
|
|
Creates, configures, and returns a new TCalculatorForm instance. |
|
|
Implements the form used to display a calculator for a TCalculatorDialog instance. |
|
|
Displays the dialog and captures the result. |
Version 4.0 | Generated 2025-05-03 | Home |