PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • The steps for creating a RAD pattern
  • Which windows must be created?
  • The files to create
  • Difference between Mobile and Smartphone
  • Standard to follow
  • The Form windows for Mobile
  • Overview
  • Creating a form window
  • Case of print buttons
  • The Form windows for Smartphone
  • Overview
  • Creating a form window for Smartphone
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Creating the Form windows of a WINDEV Mobile RAD Pattern
The steps for creating a RAD pattern
The steps for creating a WINDEV Mobile RAD pattern are as follows:
  1. Create the "RAD Pattern" project.
  2. Creating the different pattern windows.
  3. Generating the RAD pattern.
  4. Using the 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 for RADFileA.
  • A form for RADFileB. A combo box and a Vision Plus button (or a popup combo box) must allow you to select an element found in the RADFileA file.
  • A form for RADFileC. A combo box and a Vision Plus button (or a popup combo box) must allow you to select an element found in the RADFileB file.
  • A table for RADFileA.
  • A table for RADFileB.
  • A table 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.

Difference between Mobile and Smartphone

Creating an application for Mobile and an application for Smartphone are two different things. On a Smartphone, the screen is smaller and a drop-down menu allows you to validate (or not) the screens.
This difference also applies to the RAD patterns. This help page explains how to create a form window for Mobile and for Smartphone.

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 Mobile 23.
These rules are recommendations. You can implement and use your own standard.
The Form windows for Mobile

Overview

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 and Print if necessary.
  • Link options used to display the corresponding tables for example (only for the forms affecting RADFileA and RADFileB).
  • Vision Plus buttons used to select elements of another file in a specific window (only for the forms affecting RADFileB and RADFileC).
Example of Form window for the Simple RAD Pattern:

Creating a form window

To create a form window:
  1. Select "File .. New .. Window", then "Blank window wizard". In the wizard, keep the default options.Click among the quick access buttons.
    • Click "Window" in the wheel that is displayed. The wizard for window creation starts. The window for creating a new element is displayed: click "Window" then "Window". The wizard for window creation starts.
    • Select "Blank window wizard".
    • In the wizard, keep the default options.
  2. In the description window, enter the following information:
    • The window name. This name must necessarily contain the name of the file that appears 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").
  3. Save the window.
  4. Create a supercontrol in the window ("Insert .. Special .. 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.Create a supercontrol in the window: on the "Creation" pane, 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.
  5. In the description window of the supercontrol, specify the name of the supercontrol. This name must necessarily be SC_Form (SC_ is the prefix defined in the programming charter: it is not required if no programming charter is used).
  6. In the "Content" tab of the description window of the supercontrol, specify:
    • the file browsed: RADFileXX ("RADFileA" for example).
    • the item browsed: IDRADFileXX ("IDRADFileA" for example).
  7. Create and position the different buttons of your window (validation, print, browse, ...). These buttons can have any name.
    Note: In a Mobile RAD pattern, there is no Cancel button in order not to crowd the windows. The user is clicking the button for closing the window.
    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).
  8. 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
    ScreenToFile()
    // If it's a new record
    IF RADFileA..NewRecord = True THEN
    // Add it
    HAdd(RADFileA)
    ELSE
    // Modify it
    HModify(RADFileA)
    END
    // Return value of the window
    MyWindow..ReturnedValue = True
  9. Enter the initialization code of the window: Let's see an example:
    // Print the order form
    FileName = fDataDir() + [fSep()] + StringBuild("ORF_%1.PDF", OrderNumber)
    iDestination(iGenericPDF, FileName)
    iPrintReport(RPT_OrderForm, OrderNumber, OrderNumber)

    // Check the existence of the file
    IF fFileExist(FileName) = False THEN
    Error("The PDF file was not generated")
    RETURN
    END

    // Confirmation to display the PDF
    IF YesNo(Yes, "Display the generated order form (PDF format)?") = Yes THEN
    // Display the generated order form
    ShellExecute(FileName)
    ELSE
    iPrintPDF(FileName)
    END

    This code is used to display the value of the records in the form and to return a value.
  10. Add the link menu options if necessary.
  11. 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 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 in the name of the report:
    • "Details" for the form reports,
    • "List" for the table reports.
  • This name must be used in the code of the "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.
The Form windows for Smartphone

Overview

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.
  • Menu options used to perform the main actions: Validate and Cancel.
  • Link menu options used to display the corresponding tables for example (only for the forms affecting RADFileA and RADFileB).
  • Vision Plus buttons used to select elements of another file in a specific window (only for the forms affecting RADFileB and RADFileC).
Example of Form window for the Smartphone Simple RAD Pattern:
Note: The project must be configured to use a Smartphone platform ("Project .. Project description", "Project" tab, "Platform" button).Note: The project must be configured to use a Smartphone platform:
  • Display the description window of project: on the "Project" pane, in the "Project" group, click "Description".
  • In the "Project" tab, click the "Platform description" button.

Creating a form window for Smartphone

To create a form window for Smartphone:
  1. Select "File .. New .. Window", then "Blank window wizard". In the wizard, keep the default options.Click among the quick access buttons.
    • Click "Window" in the wheel that is displayed. The wizard for window creation starts. The window for creating a new element is displayed: click "Window" then "Window". The wizard for window creation starts.
    • Select "Blank window wizard".
    • In the wizard, keep the default options.
  2. 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: Form").
  3. Save the window.
  4. Create a supercontrol in the window ("Insert .. Special .. 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.Create a supercontrol in the window: on the "Creation" pane, 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.
  5. In the description window of the supercontrol, specify the name of the supercontrol. This name must necessarily be SC_Form (SC_ is the prefix defined in the programming charter: it is not required if no programming charter is used).
  6. In the "Content" tab of the description window of the supercontrol, specify:
    • the file browsed: RADFileXX ("RADFileA" for example).
    • the item browsed: IDRADFileXX ("IDRADFileA" for example).
  7. Modify the menu found in the window:
    • A menu option must allow you to validate the window.
    • A menu option must allow you to access the linked file (to access RADFileB from the form of RADFileA for example)
    • A menu option must allow you to exit form the form without validating.
  8. The menu options must have specific names:
    • MAINMENU_xxxx for the main options.
    • MENULIA_xxx for the link options.
  9. Case of the menu option for validation.
    In the code of the menu option for validation, we advise you 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
    ScreenToFile()
    // If it's a new record
    IF RADFileA..NewRecord = True THEN
    // Add it
    HAdd(RADFileA)
    ELSE
    // Modify it
    HModify(RADFileA)
    END
    // Return value of the window
    MyWindow..ReturnedValue = True
  10. Case of link options:
    From the RADFileA form, you can have a link option used to display the RADFileB table for example.
    From the RADFileB form, you can have a link option used to display the RADFileA form, the RADFileC table and the relation window for example.
    Example of code used to open the RADFileB Table window from the RADFileA form window:
    // Implement the filter on the link key
    HFilter(RADFileB, IDRADFileARel, RADFileA.IDRADFileA)
    // Open the table window of RADFileB
    Open(WIN_Table_RADFileB)
    // Disable the filter
    HDeactivateFilter(RADFileB)
  11. Case of the "Cancel" option
    // Return value of the window
    MyWindow..ReturnedValue = False
    // Close the window
    Close()
  12. Enter the initialization code of the window. Example:

    // Display the records
    FileToScreen()
    // 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.
  13. Add the Vision + buttons if necessary (for the RADFileB and RADFileC forms).
Minimum required version
  • Version 12
Comments
Click [Add] to post a comment