Lesson 2 - The power of the Application Wizards

Top  Previous  Next

Introduction

Application Wizard

Procedure Wizards

Browse Wizard

Form Wizard

Report Wizard

Report Label Wizard

Process Wizard

Window Wizard

Theme Maintenance

 

Introduction

This section explores a powerful set of application utility templates in the Clarion IDE called wizards.

In the Environment Overview lesson, we saw that templates are the building blocks of the Application Generator. They provide much of the design options you will see in the applications that you create, and also generate solid source code that is used to build your target executables and libraries.

A wizard is essentially a collection of templates whose features are activated under your control (i.e., based on a series of questions that you answer, a series of templates generate a specially formatted text file that is imported into an active application. When you create your target output, the templates step in again to generate the source code that is compiled).

This release of Clarion also introduces template styles, which contain default colors, icons, text, and other options that you can reuse in other applications for a consistent look and feel in all of your projects.

 

 

The green boxes indicate actions that the IDE performs automatically. The blue boxes indicate areas where the developer has control, and where input is required.

Referring to the diagram above, you should notice that a wizard could be accessed in one of three ways:

·

Creating a new application, and checking the Application Wizard check box in the Application Properties window.

·

In the Application Generator, press CTRL + U or Application  Template Utility… from the IDE menu.

·

In the Application Generator, press the INSERT key or press the New Procedure button from the IDE menu.

Upon start up of all wizards, you will be prompted for an associated style file. The style file controls the default prompts that you are presented with in each wizard. In addition, you can modify these prompts and save your changes to an existing style file, or write the entire contents of your wizard session to a new style file.

On exit, each wizard processes the style file according to your options, and generates an application text file (.TXA) that is imported into the active application file.

In the following sections, we will explore the features of each wizard. If you are new to Clarion, please refer first to the Getting Started Help for a quick lesson designed to help you create an application using the Application Wizard.

 

Application Wizard

The Clarion Application Wizard generates an entire application program. The program includes a main menu and subordinate procedures for viewing, searching, updating, and printing data from one or more tables. The Application Wizard generates a full program based on an existing data dictionary with one or more related or unrelated tables.

After the introduction screen, you are presented with the following options:

Theme Selection:

Theme

Select from the drop list of themes. Themes are groups of settings that control colors, fonts, icons, backgrounds, positions and much more - for Frame, Browse, Form and Report procedures. You will have the opportunity to create a new theme as you progress through the wizard. Select a starting or default theme here.

Report Layout

Select a default report layout from the drop list provided. This layout will be the basis for all of the reports that will be generated by the wizard.

 

If you are using the Quick Start Wizard, this is the only dialog that you will be presented with. Press the Finish button to begin the creation of your application.

 

Other prompts that follow on subsequent windows:

 

Generate Procedures for:

all files in my dictionary

Select this item to instruct the wizard to generate browse/form and optional report procedures for all tables defined in the dictionary.

primary files

Select this item to instruct the wizard to generate browse/form and optional reports for all tables defined in the dictionary that are not defined as relational child tables to any other table. This option is useful for applications with large dictionaries whose relationships have not yet been defined, and limits the generation of additional procedures used to establish these related tables (child browse procedures and selects).

selected files

Select this item to instruct the wizard to generate browse/form and optional report procedures for all tables selected in the next dialog window, which is a list of all tables defined in the selected dictionary.

For SQL based file systems, the Application Wizard also generates code to capture user login information upon initial program load, and then reuse the login information for each file accessed.

 

Which control model should the Application use?

There are three models the wizard can use to create applications: Button, Toolbar, or Both.

 

Button

The wizard builds the application with traditional Insert, Change, Delete, OK, and Cancel command buttons that appear on each dialog.

 

Toolbar

The wizard builds the application with global toolbar command buttons that appear on the application frame. The toolbar buttons control each dialog.

 

Both

The wizard builds the application with both the traditional dialog command buttons and the global toolbar command buttons.

 

Customization

Wizards have different "look and feel" settings and actions called themes, which can be modified and saved for use in other applications. Themes are set and controlled by a variety of customization options.

Press the Next button to accept the selected theme’s settings, or press one of the customization buttons to modify them at this time.

 

Create an Internet Enabled Application

If you are using the ABC template chain, check this box to apply the Web Application Extension (WebBuilder) templates to your application. If you are using the Clarion template chain, check this box to apply the Internet Application Extension (Internet Connect) templates to your application. In both instances, this allows your application to be deployed as both a Windows and Internet application.

You must have the appropriate template set registered in order to use this feature.

 

Overwrite existing procedures

Check this box to overwrite existing procedures with the same names. Clear the box to preserve existing procedures.

 

Generate Reports for each file

Check this box to automatically generate report procedures. Clear the box to omit report procedures.

 

Select Sort Order

Select from the drop list the sort and report generation method from the following choices:

 

Single Key

Select this option to force the wizard to generate a separate report for each key defined in your file (or files).

 

Runtime Key Selection

Select this option to force the wizard to generate a single report that pops up a sort order dialog prior to printing at runtime.

 

Record Order

Select this option to force the wizard to generate a single report sorted by record order for your selected file (or files).

 

On the last dialog, the Finish button is enabled. If you are satisfied with your answers, press the Finish button. You also have the option here to Save Changes, where any changes to customization options are saved to the theme that you selected at the start of the wizard. If you wish, you can opt to Save on a new theme, and enter the new name of the Theme and Theme file.

You can press the Back button to change a prior selection or press the Cancel button to abandon the application.

The Application Wizard creates the .APP file based on the dictionary and the answers you provided, and then displays the Application Tree dialog for your new application.

 

Fine Tuning the Wizard

You can control how the wizard builds your application by specifying options for Tables, Columns, Keys, and Relationships in the Data Dictionary.

 

 

Procedure Wizards

Generate data oriented procedures (data browsing, data entry, and reports) based on specific table descriptions in a data dictionary. The generated code accommodates the defined table relationships, by including multiple procedures as needed to support both primary and related table updates and validation.

The following Procedure Wizards are available in this release:

 

Browse Wizard

This wizard creates a multi-keyed Browse procedure from an existing dictionary table definition. The BrowseBox is sorted by each key you specify. The sort order is controlled by Tab Controls. It also creates associated Form (Update) procedures, if you specify that updates be allowed.

After the introduction screen, you are presented with the following options:

 

Theme Selection

Theme

Select from the drop list of themes. Themes are groups of settings that control colors, fonts, icons, backgrounds, positions and much more - for Frame, Browse, Form and Report procedures. You will have the opportunity to create a new theme as you progress through the wizard. Select a starting or default theme here.

Save Settings

After you have selected a theme, you have the option to save these settings for any future applications that you create.

 

What name should be used as the label of the procedure?

Type the browse procedure name.

 

Which file do you want to browse?

Press the ellipsis (...) button to select a file from the dictionary.

 

Browse using all record keys

Check this box to make the list sortable on all keys. Clear the box to specify a single sort key.

 

Allow the user to update records

Check this box to generate a subordinate procedure to update the table. Optionally, provide the name of the update procedure. Clear the box to make the list read only.

 

Call update using popup menu

Check this box to provide right-click popup menus on the Browse list in addition to any command or toolbar buttons.

 

Parent Record Selection

This prompt appears only if you specify a single sort key that is the linking key in a Many:One relationship. The Browse Wizard infers from this that you may want to browse only the child records for a specific parent record. Select one of the following to confirm or deny this inference.

 

Do not select by parent record

Do not limit the browse - in other words, browse all records.

 

Select parent record via button

Browse only the child records for a specific parent record. Provide a button to select the parent record.

 

Assume that the parent record is active

Browse only the child records for a specific parent record. Assume the parent record is already active.

 

Provide buttons for child files

Check this box to provide buttons on the Browse window to access related child tables. Alternatively, related tables may be accessed from the generated update procedure.

 

Provide a "Select" button

Check this box to provide a "Select" button that displays when the Browse procedure is called to select a record, but is hidden when the Browse is called to update records.

Which control model should the Application use?

Button

The wizard builds the browse with traditional Insert, Change, and Delete command buttons that appear on each dialog.

Toolbar

The wizard builds the browse to use global toolbar command buttons that appear on the application frame. See Control Templates - FrameBrowseControl.

Both

The wizard builds the browse to use both traditional dialog command buttons and global toolbar command buttons.

 

Customization

Wizards have different "look and feel" settings and actions called themes, which can be modified and saved for use in other applications. Themes are set and controlled by a variety of customization options.

Press the Next button to accept the selected theme’s settings, or press one of the customization buttons to modify them at this time.

 

Overwrite existing procedures

Check this box to overwrite existing procedures with the same names. Clear the box to preserve existing procedures.

 

On the last dialog, the Finish button is enabled. If you are satisfied with your answers, press the Finish button. You also have the option here to Save Changes, where any changes to customization options are saved to the theme that you selected at the start of the wizard. If you wish, you can opt to Save to a new theme.

 

The Browse Procedure Wizard creates the procedure(s) based on the dictionary file and the answers you provided, and then displays the Procedure Properties dialog for your new procedure.

 

 

Form Wizard

This wizard creates an update Form Procedure from an existing dictionary table definition.

 

After the introduction screen, you are presented with the following options:

Theme Selection:

Theme

Select from the drop list of themes. Themes are groups of settings that control colors, fonts, icons, backgrounds, positions and much more - for Frame, Browse, Form and Report procedures. You will have the opportunity to create a new theme as you progress through the wizard. Select a starting or default theme here.

Save Settings

After you have selected a theme, you have the option to save these settings for any future applications that you create.

 

What name should be used as the label of the form procedure?

Type the procedure name.

 

Which file do you want the form to update?

Press the ellipsis (...) button to select a file from the dictionary.

 

Allow Records To Be Added

Check this box to allow new records.

 

Allow Records To Be Modified

Check this box to allow records to be changed.

 

Allow Records To Be Deleted

Check this box to allow records to be deleted.

 

Insert Message

Type the title bar text to display when adding a record.

 

Change Message

Type the text to display when changing a record.

 

Delete Message

Type the text to display when deleting a record.

 

Where do you want this message to be displayed?

Choose the title bar or the status bar.

 

A field can be displayed that identifies the active record.

Press the ellipsis button to select a column from the dictionary to display on the window title bar.

 

Validate field values whenever field value changes?

Check this box for immediate validation when the end user "accepts" the column.

 

Validate field values when the OK button is pressed?

Check this box for column validation on the OK button.

 

Browsing child files

Select one of the following choices.

Place children on tabs

Access children with push buttons

Do not provide child access

 

Which control model should the Application use?

Button

The wizard builds the dialogs with traditional Insert, Change, and Delete command buttons.

Toolbar

The wizard builds the form to use global toolbar command buttons that appear on the application frame.

Both

The wizard builds the form to use both traditional dialog command buttons and global toolbar command buttons.

 

Customization

Wizards have different "look and feel" settings and actions called themes, which can be modified and saved for use in other applications. Themes are set and controlled by a variety of customization options.

Press the Next button to accept the selected theme’s settings, or press one of the customization buttons to modify them at this time.

 

Overwrite existing procedures

Check this box to overwrite existing procedures with the same names. Clear the box to preserve existing procedures.

 

On the last dialog, the Finish button is enabled. If you are satisfied with your answers, press the Finish button. You also have the option here to Save Changes, where any changes to customization options are saved to the theme that you selected at the start of the wizard. If you wish, you can opt to Save to a new theme.

 

The Form Procedure Wizard creates the procedure(s) based on the dictionary table and the answers you provided, and then displays the Procedure Properties dialog for your new procedure.

 

 

Report Wizard

This wizard creates a Report Procedure from an existing dictionary table definition.

 

After the introduction screen, you are presented with the following options:

 

Theme Selection:

Theme

Select from the drop list of themes. Themes are groups of settings that control colors, fonts, icons, backgrounds, positions and much more - for Frame, Browse, Form and Report procedures. You will have the opportunity to create a new theme as you progress through the wizard. Select a starting or default theme here.

Report Layout

Select a default report layout from the drop list provided. This layout will be the basis for all of the reports that will be generated by the wizard.

Save Changes?

After you have selected a theme, you have the option to automatically save changes to this theme for any future applications that you create.

Check this box to store changes when completing the wizard.

 

What name should be used as the label of the report procedure?

Type the procedure name.

 

Which file do you want to report?

Press the ellipsis (...) button to select a file from the dictionary.

 

Key Sequence - Select Sort Order

Select from the drop list the sort and report generation method from the following choices:

 

Single Key

Select this option to force the wizard to generate a separate report for the key that you select in the Enter a key prompt that follows.

 

Runtime Key Selection

Select this option to force the wizard to generate a single report that pops up a sort order dialog prior to printing at runtime.

 

Record Order

Select this option to force the wizard to generate a single report sorted by record order for your selected file (or files).

 

How many columns do you want the report to use?

Type the number of columns for your report. The Report Wizard distributes the report columns evenly across the columns.

 

Select the fields that you want to use

Build your report in this list box by adding and deleting fields from the selected file. You can also modify the properties of the fields regarding column labels, picture tokens, and justification. Use the arrow buttons to specify the order that each field will appear on the report.

 

Customization

Wizards have different "look and feel" settings and actions called themes, which can be modified and saved for use in other applications. Themes are set and controlled by a variety of customization options.

Press the Next button to accept the selected theme’s settings, or press the Report Customization button to modify it at this time.

 

Overwrite existing procedures

Check this box to overwrite existing procedures with the same names. Clear the box to preserve existing procedures.

On the last dialog, the Finish button is enabled. If you are satisfied with your answers, press the Finish button. You also have the option here to Save Changes, where any changes to customization options are saved to the theme that you selected at the start of the wizard. If you wish, you can opt to Save to a new theme.

The Report Procedure Wizard creates the procedure based on the dictionary table and the answers you provided, and then displays the Procedure Properties dialog for your new procedure.

 

 

 

Report Label Wizard

This wizard creates a report procedure from an existing dictionary file definition that includes a defined report label layout.

 

After the introduction screen, you are presented with the following options:

 

Theme Selection:

Theme

Select from the drop list of themes. Themes are groups of settings that control colors, fonts, icons, backgrounds, positions and much more - for Frame, Browse, Form and Report procedures. You will have the opportunity to create a new theme as you progress through the wizard. Select a starting or default theme here.

Label Group

Select a label group from the drop list. A label group contains the most popular classes of labels (Avery, Card Products, InkJet, etc.). If your type of label is not listed here, select Others.

Label Type

Select a label type from the drop list. A label type normally corresponds to its product code.

Save Settings

After you have selected a theme, you have the option to save these settings for any future applications that you create.

 

What name should be used as the label of the report procedure?

Type the procedure name.

 

Which file do you want to report?

Press the ellipsis (...) button to select a file from the dictionary.

 

A report can use a single record key, or can run in record order. Enter a key below, or leave the field blank to run in record order.

Press the ellipsis (...) button to select a sort key. Leave the field blank to specify no sort key.

 

Select the fields that you want the report to use?

Build your report in this list box by adding and deleting fields from the selected file. You can also modify the properties of the fields regar