From d6016f8810fe121ddc690eb16af55dedcaf8f90e Mon Sep 17 00:00:00 2001
From: dsiders
-CalcKey is assigned as the OnCalcKey event handler for -DlgForm in the Execute method. +CalcKey is assigned as the OnCalcKey event handler for the +TCalculatorForm instance created in the Execute method.
-The value from DefaultTitle is assigned as the value for the Title property -in the constructor for the class instance. +The value from DefaultTitle is assigned to the Title property in the +constructor for the class instance.
+DisplayChange signals the OnDisplayChange event handler (when +assigned) to perform actions needed for the update. DisplayChange is used as +the handler routine for the OnDisplayChange property in TCalculatorForm. It +is assigned when the calculator form instance is created and configured in +the Execute method. It allows the dialog form to notify the dialog component +when its calculator panel has been updated. +
++Create is the overridden constructor for the +TCalculatorDialog class. It calls the inherited method on entry, +and sets the default values for properties including: +
++Destroy is the overridden destructor for the +TCalculatorDialog class. Destroy frees references to handler +routines assigned to the OnChange and OnDisplayChange properties. It calls +the inherited method prior to exit. +
++OnDialogClose calls the DoClose method to signal the OnClose event +handler (when assigned). +
++OnDialogClose is assigned to the OnClose event handler for the dialog form +created in the Execute method. +
++See OnDialogCloseQuery for the handler routine used in the OnCloseQuery event +handler for the dialog form. +
++OnDialogCloseQuery copies the value from the ModalResult property +to the UserChoice property in the dialog component. +
++The CanClose argument is a variable parameter which contains True if the form +can be closed. It is passed as an argument to the DoCanClose method where the +OnCanClose event handler is signalled (when assigned) to get its return +value. OnCanClose should set CanClose to False to prevent closing the form. +
++OnDialogCloseQuery is assigned to the OnCloseQuery event handler for the +dialog form created in the Execute method. +
++See OnDialogClose for the actions performed when the form is actually closed. +
++GetNewDate is a procedure used to get the date value from the +TCalendar control on the dialog form. It assigns the DateTime value from the +calendar control to the Date property in the dialog component. +
++GetNewDate is called from methods like CalendarDblClick, +OnCalendarDayChanged, OnCalendarYearChanged, and OnCalendarMonthChanged. It +is assigned as the OnClick event handler for the OK button displayed on the +calendar dialog form. +
++CalendarDblClick is the handler routine assigned to the OnDblClick +event in the TCalendar instance for the dialog form. It ensures that the +value in Date is updated when a mouse double click occurs on a date in the +TCalendar control on the dialog form. GetNewDate is called to update the +value in Date. The calendar dialog form is updated to set its ModalResult +value to mbOK. +
++The return value is set to the content in the rsPickDate resource string. +
++Create is the overridden constructor for the +TCalendarDialog class. It calls the inherited method entry which +sets the value in DialogPosition to poMainFormCenter. Create sets the default +values for properties including: +
++Execute is an overridden method in TCalendarDialog. It +creates and configures a new TForm instance displayed for the dialog +component. The dialog form includes controls needed to select a +date value, and to accept or reject the selected value. This includes: +
++Values from properties in the class instance are used to configure the dialog +form, including: +
++Methods in the class instance are assigned to the event handlers for the +dialog form and its controls, including: +
++The ShowModal method for the dialog form is called to display the form and +capture the return value. The return value is True if the ModalResult +value is mrOK (when the OK button was clicked). The return value is +False if the Cancel button was clicked or the form was closed using +the window decoration. +
++The date selected using the calendar control is stored when the +OnCalendarChange routine is executed (via TCalendar.OnChange). This causes +the OnChange event handler in the class instance to be signalled to store the +updated value. +
++The form is freed prior to exiting from the method. +
++Used when Position contains poDesigned. Otherwise, it is updated after the form is dynamically created, aligned, and displayed. +
++Used when Position contains poDesigned. Otherwise, it is updated after the form is dynamically created, aligned, and displayed. +
+The selected Date, for return to the main program.
-This is NOT the standard RTL Date function.
++Date is a TDateTime property which contains the date +displayed and updated using the form for the dialog. The initial value in +Date is set in the Create constructor to the date returned from the Now +function. The property is updated in the GetNewDate method when a new month, +day, or year is selected using the calendar control on the dialog form. +
++This is not the standard RTL Date function. +
@@ -1787,7 +2041,7 @@ the Month in the Date is changed.