PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
  • Overview
  • Implementation
  • Creating a new layout for a Mobile window
  • Creating a new layout for an internal window
  • Handling layouts
  • Managing controls in the layouts
  • Special case of the Action Bar
  • Characteristics of layouts
  • Comparing windows or pages with layouts
  • Managing layouts at runtime
  • Default operating mode
  • Special case: Print layout
  • Programming
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Overview
Layouts are used to define several views of a window/page in the same project without duplicating this window/page.
WINDEV Mobile Thus, in a WINDEV or WINDEV Mobile application, you can define, for example:
  • a specific view for portrait mode,
  • a specific view for landscape mode,
  • a phone-specific view,
  • a view specific to the tablet,
  • ...
At runtime, you can:
This help page presents:
Implementation
Universal Windows 10 AppAndroidiPhone/iPad

Creating a new layout for a Mobile window

To create a new layout for a window:
  1. Open the relevant window in the editor.
  2. On the "Window" tab, in the "Layouts" group, expand "Layouts" and select "Add layouts".
    Add layouts
  3. The wizard for adding a layout starts. Pass the presentation step if necessary.
  4. The wizard prompts you to select an option to manage the differences between phones and tablets.
    Tablet/Phone differences
    You can:
    • Choose the current platform only (phone only or tablet only).
    • Create layouts (because the controls are organized differently on the tablet and on the phone).
    • Use the anchors only (because the anchors are sufficient to reposition the controls in the window according to its size).
  5. Go to the next step of the wizard.
  6. The wizard prompts you to select an option to manage the Portrait/Landscape orientation of the application.
    Portrait/Landscape
    You can:
    • Create layouts (because the controls are organized differently on the tablet and on the phone).
    • Use the anchors only (because the anchors are sufficient to reposition the controls in the window according to its orientation).
  7. Go to the next step of the wizard.
  8. The wizard proposes to use a different presentation for each platform used (for example, a presentation for iOS and a presentation for Android).
    Operating system
  9. Select the desired option and go to the next step of the wizard.
  10. Validate the wizard.
  11. The different layouts are created if necessary.
    Layouts
  12. The editor displays (on the right) the different layouts that can be used for the window. Double-clicking the badge of the desired layout allows you to open it in the editor and modify it.
Tip:
  • The creation of a layout is based on the current edit platform. It is faster to position on the layout that is the closest one graphically in order to limit the modifications.
  • To customize the controls found in the different layouts, we advise you to start with the largest and most complete layout then create the other layouts by reducing or hiding elements.
WINDEV Mobile

Creating a new layout for an internal window

In mobile, the internal windows are used by several features: detailed window in a table, appointment in a Scheduler control, ...
Using layouts on the internal windows allows you to propose an interface for the portrait mode and for the landscape mode.
To create a new layout for an internal window:
  1. Open the relevant internal window in the editor.
  2. On the "Window" tab, in the "Layouts" group, expand "Layouts" and select "Add layouts".
  3. The window for adding layouts is displayed.
    Click "Create" to add a new layout.
  4. Validate the window.
  5. The editor displays (on the right) the different layouts that can be used for the internal window.
    • Double-clicking the badge of the desired layout allows you to open it in the editor and modify it.
    • The "Description" option in the context menu of the layout title bar allows you to define the layout parameters.
Handling layouts

Managing controls in the layouts

By default:
  • A control created in a layout is created in all the layouts.
  • A control is positioned at the same location in all the layouts. It includes the same width and height properties.
  • A control moved in a layout is moved in all layouts.
In order for a control to have specific properties and position according to the layouts, it must be dissociated. Several options are available.
To handle a control in an independent way in the different layouts:
  1. Select the control.
  2. Right-click to open the context menu.
  3. In the "Layouts" menu, the different possibilities are displayed::
    • Dissociate the position: used to modify the control position in one or more layouts.
    • Dissociate the size: used to modify the control size in one or more layouts.
    • Dissociate the anchor: used to dissociate the anchor in one or more layouts.
    • Dissociate the font: used to dissociate the font in one or more layouts. You can for example use a specific font for Android and another font for iOS. It is also possible to specify a font size for each layout.
    • Hide in this layout: hides the control in one or more layouts.
    • Show in all layouts: shows the control in all layouts.
Remarks:
  • This context menu is available for a selection of controls.
  • "Automatic dissociation" option ():
    • If the "Automatic dissociation" option in the title bar of the current layout is enabled, the size and/or position of the controls will be dissociated when the first change is made (via the mouse or the keyboard).
    • If the "Automatic dissociation" option in the title bar of the current layout is disabled, all changes made to the controls (size or position) will be be applied in all the layouts.
    A toast is displayed to remind the user of the effects of this dissociation (the control is moved in all layouts or only in the current layout).
Limit: For the Chart controls, the properties of the title and the properties of the legend cannot be dissociated between several layouts.
AndroidiPhone/iPad

Special case of the Action Bar

The Action Bar control is available in Android and iOS.
When generating the application, the native control corresponding to the current platform will be automatically selected.

Characteristics of layouts

The context menu of thumbnails for the available layouts allows you to manage the layouts:
You can:
  • View the layout description and modify it. For more details, see Layout settings.
  • Activate the layout, which means display it in order to modify it.
  • Activate the layout in double-view mode: the two layouts can be displayed and modified in parallel.
  • Create a new layout from the current layout.
  • Delete the selected layout.
  • Display proportional thumbnails.
  • Refresh automatically: Used to refresh the layout as soon as a modification is performed in the window.
  • Refresh this layout: Used to immediately refresh the layout.
  • Refresh all: Used to immediately refresh all the layouts.

Comparing windows or pages with layouts

WINDEV Mobile allows you to compare two projects, two project elements, ... For more details, see Project comparator.
When comparing windows containing layouts, the differences found for each layout are listed.
Managing layouts at runtime

Default operating mode

The initial layout is automatically selected according to:
  • the system,
  • the orientation,
  • the platform size,
  • the size of the window or page (in the editor).
The layout changes automatically:
  • WINDEV Mobile when the device switches from portrait to landscape mode.
The layout parameters can be defined ("Description" in the context menu of the layout title bar):
  • WINDEV Mobile for each platform:
    iPhone/iPad The Phone / Tablet distinction only applies to the size of the window in the editor. This information is ignored at runtime.
      These parameters are taken into account to choose the layout at runtime:
      • Minimum size of device on which the layout can be started.
      • AndroidiPhone/iPad Operating system. If "Multi OS" is selected, the layout can be started on all OS. You have the ability to select specific systems (the proposed systems correspond to the platforms defined for the project).
      • AndroidiPhone/iPad Window orientation.
      • AndroidiPhone/iPad Edit platform.
      AndroidiPhone/iPad The order of parameters taken into account depends on the type of window run. Therefore:
      • If the window is intended for mobile devices (maximized or not), the following criteria are taken into account: the system, the orientation and the platform size.
      • If the window is intended for Windows, the following criteria are taken into account: the system. The biggest window is chosen. If several windows have the same size, the choice is made according to the orientation.
      iPhone/iPad The distinction between platform sizes (tablet/phone) is ignored at runtime. The largest layout is used.
      Remark: If the chosen layout is not suitable, you can force the use of a given layout programmatically.

    Special case: Print layout

    If a "Print" layout has been created on a page, this layout will automatically be used when the user selects the "Print" option in the context menu of the browser (or presses Ctrl + P). In this case, only the controls shown in the layout will be printed.

    Programming

    You can:
    Related Examples:
    WW_Layouts Training (WEBDEV): WW_Layouts
    [ + ] This example contains a website that can be displayed on mobile devices.
    The website uses WEBDEV layouts to adapt its UI.
    Minimum version required
    • Version 19
    This page is also available for…
    Comments
    Click [Add] to post a comment