V2 Menu application logic
When an Explorer node is selected by the user, the system uses the Explorer group definitions from the related group section in the menu file to perform the following steps.
First Time selection:
- Reportn CCLAS_EXPLORER program settings are put into an array, making the Crystal Report templates available for selection by the user.
- A SQL Select statement is constructed from the BrowserView CCLAS_EXPLORER program setting.
- A SQL Select statement is constructed from the ListViewColumnn CCLAS_EXPLORER program settings. If these are absent, then the SQL Select statement is Select * from.
- PVExplorer header definitions, width and format are determined from the ListViewColumnn CCLAS_EXPLORER program settings. If these settings are absent, then the table or view field names are used as the column headers, with a default width for each column and a string format. The column headers are set in the PVExplorer object.
- The Checked and MultiSelect CCLAS_EXPLORER program settings are loaded for the system to drive the interface.
- If a ScreenFile CCLAS_EXPLORER program setting is defined and the file exists, then:
- The form is constructed and the Form_Load procedure called, followed by AfterNodeSelectionChange procedure (if these are present).
- If a SQLWhere procedure exists, then it is called to construct additional SQL statements required in the Select statement.
- If a SQLOrder procedure exists, then it is called to construct additional SQL Order By statements required in the Select statement.
- The constructed SQL statement is executed and a record set is established.
- If a ScreenFile CCLAS_EXPLORER program setting is defined and the file exists, then:
- If an AfterDataQuery procedure exists, then it is called, typically to construct a collection of Icons used against each record in the ListView.
- The PVExplorer items are populated with the content of the record set, with each field formatted as per the ListViewColumnn CCLAS_EXPLORER program settings, and the IconIndexCollection.
Subsequent selection:
- If a ScreenFile CCLAS_EXPLORER program setting is defined and the file exists, then:
- If an AfterNodeSelectionChange procedure exists, then it is called.
On detection of the defined cmdQuery_Click Event:
- If the ScreenFile CCLAS_EXPLORER program setting is defined and the file exists, then:
- If a SQLWhere procedure exists, then it is called to construct additional SQL statements required in the Select statement.
- If a SQLOrder procedure exists, then it is called to construct additional SQL Order By statements required in the Select statement.
- The constructed SQL Statement is executed and a record set is established.
- If an AfterDataQuery procedure exists, then it is called.
- The PVExplorer items are populated with the content of the record set, with each field formatted as per the ListViewColumnn CCLAS_EXPLORER program settings.