|
|
|
|
|
- Layout control overview
- Creating a Layout control
- Creating the control
- Creating a Layout control by refactoring
- Layout control in a Looper control
- Characteristics of Layout controls
- General tab
- Details tab
- Example of different types of overflow
- Layout control and Responsive mode (zoning and layouts)
The Layout control simplifies the implementation of dynamic UIs where controls are displayed and/or hidden programmatically. When a control is hidden (e.g. via the Visible property), the Layout control automatically repositions all the other controls to keep a neat interface and avoid "spaces". Layout controls are available in vertical and horizontal mode. The Layout control is composed of cells. These cells contain the controls found in the Layout control. Each cell can contain any type of control, including another Layout control. The controls can be shown or hidden. The cells can be created via the "General" tab in the description window or in the context menu of the Layout control. Creating a Layout control Creating the control To create a Layout control: - In the "Creation" pane, in the "Containers" group, pull down "Layout" and select orientation: horizontal or vertical..
- Click where the control will be created in the window or page. The control appears in the editor.
Note: The dimensions of the field created are optimized to occupy the space available at the position indicated.. If necessary, resize the control using the handles. - Add cells in the Layout control. These cells can be added:
- via the context menu of the control ("Insert a cell").
- via the "General" tab of the control description ("Add" button).
- Add controls in the cells of the Layout control.
- Set the anchors of the controls in the Layout control, and specify how they adapt to content. For more details, see:
To view the characteristics of the control, select "Description" in the context menu. Creating a Layout control by refactoring A Layout control can also be created using existing controls: - Select the controls that will be included in the Layout control.
- On the "Modification" tab, in the "Transformations" group, expand "Refactoring and swapping" and select "Create a layout from the selection".
- A Layout control is automatically created and a cell is created for each control on a different row.
Layout control in a Looper control Characteristics of Layout controls The characteristics of the Layout control can be found in the "General" and "Details" tabs of the control description window. General tab The "General" tab allows you to manage the different cells in the Layout control. It is possible to: - add, duplicate or delete cells.
- modify the order of the cells using the arrows.
- modify the parameters of the current cell. It is possible to:
- Make the cell visible or not (initial state).
- Define the height and the maximum height of the cell:
- The height corresponds to the minimum size of the cell.
- The maximum height of the cell cannot be exceeded if it is specified.
- Occupy the entire available space. This option is available if the "In case of overflow: Enlarge field, expand surrounding fields" has not been selected ("Detail" tab of the control description window)..
Details tab The layout parameters of the control can be defined in the "Details" tab. The available options are as follows: - Disposition: Allows you to specify whether the Layout control manages the layout of fields vertically or horizontally..
- Horizontal: cells are displayed on a single line, occupying the entire height of the field.. Only the width can be modified.
- Vertical: Cells are displayed in a single column, occupying the entire width of the field.. Only the height can be modified.
- Fix cells: Used to specify the alignment of cells in the field according to the chosen layout..
- In a vertical layout, cells can be aligned to the top or to the bottom.
- In a horizontal layout, cells can be aligned to the left or to the right.
- Management of overflow:
- Enlarge field, push fields around: field is enlarged to display all cells.
- If there are other controls below or to the right, they are "pushed".
- If one or more cells are reduced, the Layout control is resized without shrinking beyond its initial size.
- The controls below or to the right are moved according to the new size.
- The window is never reduced.
- Display a scrollbar automatically: the client area of the field is enlarged and scrollbars are displayed to allow scrolling within the field..
- Truncate content: No adaptation, cell display is truncated.
- The "Reduce the parent" option allows you to reduce the parent if necessary. If the window is the parent, it will be reduced next time it is opened.
Remark: When this option is enabled, cells or cell fields must be hidden either in the "Global declarations" window event, or in the "Initialization" field event..
- Margin between cells: Spacing between Layout control cells. This spacing is expressed in pixels. It can be changed programmatically with the MarginInterCell property.
Example of different types of overflow Example: A Layout control is created in the window editor. This Layout control contains: - Several cells used to display the different form controls.
- A horizontal Layout control containing 2 buttons, displayed (or not) according to the presence of phone number and/or email address.
Example 1: option Enlarge the field Push the fields around - During a test (Go), the window displays all controls.
- When the phone number and email address are deleted, the Layout control is reduced but the window stays the same size.
- When the phone number, email address and comment are added, the Layout control is enlarged, as well as the window.
Example 2: Option Display an elevator automatically - During a test (Go), the window displays all controls.
- When a comment is added, a scrollbar automatically appears in the Layout control in order to scroll through the different elements.
Example 3: Option Truncate content - During a test (Go), the window displays all controls.
- When a comment is added, the content that overflows the Layout control is not displayed.
Related Examples:
|
Unit examples (WINDEV): The Layout control
[ + ] Using the Layout control
|
|
Unit examples (WEBDEV): The Layout Control
[ + ] Using the Layout control
|
|
Unit examples (WINDEV Mobile): The Layout control
[ + ] Using a Layout control
|
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|