- The steps for creating a RAD pattern
- Which windows must be created?
- The files to create
- Standard to follow
- The Form windows
- Creating a Form window
- Case of print buttons
Creating the Form windows of a WINDEV RAD pattern
The steps for creating a RAD pattern
Which windows must be created?
The files to create
Reminder: To build a RAD pattern used to create a full project, the following files are required:
- A Form window for RADFileA.
- A Form window for RADFileB. A Combo Box control and a Vision Plus button (or a popup combo box) must allow you to select an element found in the RADFileA file.
- A Form window for RADFileC. A Combo Box control and a Vision Plus button (or a popup combo box) must allow you to select an element found in the RADFileB file.
- A Table window for RADFileA.
- A Table window for RADFileB.
- A Table window for RADFileC.
- A relation window RADFileB/RADFileD.
These different elements must contain link buttons. You also have the ability to provide the main menu of the application.
Standard to follow
This help page presents the different rules that must be applied when creating the pages and windows of the RAD pattern. These rules have been used to create the different patterns supplied with WINDEV 28.
These rules are recommendations. You can implement and use your own standard.
A Form window includes the following elements:
- A supercontrol: This supercontrol contains the controls of the form to display. This supercontrol is linked to the file to display.
- Buttons used to perform the main actions: Validate, Cancel and Print if necessary.
- Link buttons used to display the corresponding tables windows for example (only for the forms concerning RADFileA and RADFileB).
- Vision Plus buttons used to select the elements of another file in a specific window (only for the forms concerning RADFileB and RADFileC).
Example of Form window for the Simple RAD Pattern:
Creating a Form window
To create a Form window:
- Click in the quick access buttons:
- The creation window appears: click "Window" then "Window". The window creation wizard starts.
- In the wizard, select "Blank" and validate.
- In the description window, enter the following information:
- The window name. This name must necessarily contain the name of the file displayed in the form (some examples: WIN_Form_RADFileA, WIN_For_RADFileA, ...).
- The window title. If the title must display the name of the file, use the name of the "RADFileXX" file (for example, "RADFileA: Input form").
- Save the window.
- Create a supercontrol in the window: on the "Creation" tab, in the "Containers" group, click "Supercontrol".
This supercontrol will display the controls found in the form. Position this control in the window and define its size. Scrollbars will be automatically displayed if some of the controls cannot fit in the specified size.
- In the supercontrol description window, specify the name of the supercontrol. This name must necessarily be SC_Form (SC_ is the prefix defined in the code style: it is not required if no code style is used).
- In the "Content" tab of the supercontrol description, specify:
- the file browsed: RADFileXX ("RADFileA" for example).
- the item browsed: IDRADFileXX ("IDRADFileA" for example).
- Create and position the different buttons of your window (validation, cancelation, print and browse buttons, ...). These buttons can have any name.
Caution: if the user is allowed to apply a skin template to the windows created by RAD, you must define the type of button that must be used in the skin template. This information can be defined in the modifier ("Skin template" category).
- Case of validation button ("OK" or "Validate" button for example).
To simply the management of the validation button, you have the ability to use a preset action. We recommend that you use the "Close the window and return a value" action, with "Returned value: the value specified in the code by ..ReturnedValue".
In the code of the validation button, we advise you to enable the automatic management of errors ("If Error: ", with the automatic process "Display the error and go back to edit").
The code of the validation button can be (for a form on RADFileA):
// Read the information entered
// If it's a new record
IF RADFileA..NewRecord = True THEN
// Add it
// Modify it
// Return value of the window
MyWindow.ReturnedValue = True
- Case of cancellation button ("Cancel" button for example).
To simplify the management of cancelation button, you have the ability to use a preset action. We recommend that you use the "Close the window and return a value" action, with "Returned value: the value specified in the code by ..ReturnedValue".
- Enter the initialization code of the window. Example:
// Display the records
// Return value returned by default
MyWindow.ReturnedValue = False
This code is used to display the value of the records in the form and to return a value.
- Add the link buttons if necessary.
- Add the Vision Plus buttons if necessary (for the RADFileB and RADFileC forms).
Case of print buttons
A RAD pattern can contain buttons used to start a print. The code of these buttons (or the associated preset option) must allow you to start the printing (or the preview) of the report.
The reports must be created in the project of the RAD pattern:
- The name of these reports must contain RADFileX. For better readability, we recommend that you use "Form" or "Table" in the name of the form to easily identify the type of the report.
- This name must be used in the code of print button (or in the preset action associated with the button).
CAUTION: There is no need to customize the reports found in your project of the RAD pattern. Indeed, during the generation, only the name of the report will be kept. If the "Print" button is found in a "Form" window, the printed report will be a Form report. If the "Print" button is found in a "Table" window, the printed report will be a Table report.