These fragments provide data and code definitions, including those for the spin button control, referenced by other sections of the application. The first fragment contains variable definitions that are hand-coded in the Definitions section of the AppBuilder Section Editor:
/* Local Variable Definitions --- */
DEFINE VARIABLE result AS LOGICAL NO-UNDO.
DEFINE VARIABLE max-records AS INTEGER NO-UNDO.
DEFINE VARIABLE chCSSpin AS COM-HANDLE NO-UNDO.
Note the variable to hold the component handle CSSpin ActiveX control. All other necessary widget and component handles for this application are provided by the AppBuilder.
This is the query definition assembled by the AppBuilder from user input. The PRESELECT option allows the application to know the number of records it is scanning with the spin button at startup, as shown:
The AppBuilder assembles the widget definitions as you add objects to the design window. Thus, the AppBuilder assembles the definitions for the control-frame handles (custSpin and chcustSpin) after you insert the spin button control into the design window. (The programmer has changed the name of the control-frame from CtrlFrame to custSpin.) The application also uses the iRecordCount variable to display the ordinal record number of each Customer record scanned by the spin button control.
You can begin setting ActiveX control properties in the OCX Property Editor Window any time after you add the control into the design window.
You cannot view or change this AppBuilder-generated code from the Section Editor. However, it is part of the .w file generated for the application, and you can use Code Preview option of the Tools menu to view this code.
The AppBuilder automatically generates the query definition from the query criteria entered earlier.
This fragment shows the actual control-frame definition created by the AppBuilder using the custSpin widget handle defined earlier. The AppBuilder creates and maintains this definition as you insert, position, and size the spin button control in the design window. Note the setting of the control-frame NAME attribute after the widget is created and parented to the Dialog-Frame frame. The AppBuilder also sets the HIDDEN attribute to no (FALSE) because the spin button control is, by default, a visible control. For example:
Note: You cannot view or change this AppBuilder-generated code from the Section Editor. However, it is part of the .w file generated for the application, and you can use Code Preview option of the Tools menu to view this code.
The AppBuilder also ensures, with appropriate preprocessor settings, that ABL only compiles and executes OCX-related sections of this procedure file if it is running in the graphical mode (not TTY) of a Windows system (WIN32).