PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

  • Overview
  • How to proceed?
  • Anchoring a control in a window
  • Anchoring a control in a tab
  • Anchoring a selection of controls
  • Anchor to content
  • Configuring the anchor by programming
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
Overview
The windows found in a WINDEV application can be resized at runtime. The anchoring mechanism is used to automatically adapt the size and position of controls when resizing the window.
The management of control anchoring includes two parameters:
  • The control anchoring: this parameter is used to define the modification that will be applied to the control according to the change of window size. The control can move to the left and/or to the bottom, it can be enlarged in width and/or in height.
  • The anchor rate: this parameter is used to manage the percentage by which the control is moved or stretched. This parameter allows you to:
    • keep a control centered in width in the window regardless of its size,
    • proportionally enlarge some window controls.
These parameters can be configured:
  • In the window editor.
  • By programming with the WLanguage properties.
How to proceed?

Anchoring a control in a window

To anchor a control in a window:
  1. Select one or more controls to anchor.
  2. Define the anchoring of controls:
    • in the "GUI" tab of the description window of control ("Description" from the popup menu of control),
    • via "Anchor" from the popup menu of control.
  3. In this window, choose the type of anchoring that will be used. The most common options are represented by icons:
    No anchorThe control is not modified when the window is resized. No anchoring option is selected.
    WidthThe control stretches to the right when the window is enlarged. To change the speed at which a control stretches in relation to the window, use the anchor rate in width.
    RightThe controls moves to the right when the window is enlarged. To make the control move slower or faster, use the anchor rate to right.
    Centered in widthThe control remains centered in width in the window regardless of the window width.
    HeightThe control stretches toward the bottom when the window height is enlarged. To change the speed at which a control stretches in relation to the window, use the anchor rate in height
    Width and HeightThe control stretches to the right and to the bottom when the window is enlarged. To change the speed at which a control stretches in relation to the window, use the anchor rate in height and the anchor rate in width.
    Height and RightThe control stretches toward the bottom and moves toward the right when the window is enlarged.
    To make the control move slower or faster, use the anchor rate to right.
    To change the speed at which a control stretches in relation to the window, use the anchor rate in height.
    Vertical DistributionThis option is available only when several controls are selected. The anchoring options are used to keep a vertical distribution of selected controls when the window is enlarged in height.
    BottomThe control moves to the bottom when the window is enlarged toward the bottom. To make the control move slower or faster, use the anchor rate to bottom.
    Width and BottomThe control stretches to the right and moves to the bottom when the window is enlarged.
    To make the control move slower or faster, use the anchor rate to bottom.
    To change the speed at which a control stretches in relation to the window, use the anchor rate in width.
    Right and BottomThe control moves to the right and to the bottom when the window is enlarged. To make the control move slower or faster, use the anchor rate to bottom and the anchor rate to right.
    Horizontally centered at bottomThe control remains centered in width in the window regardless of the window width. However, the control is anchored to right and it moves to right when the window is enlarged.
    To make the control move slower or faster, use the anchor rate to bottom.
    Centered in heightThe control remains centered in height in the window regardless of the window height.
    Horizontal DistributionThis option is available only when several controls are selected. The anchoring options are used to keep an horizontal distribution of selected controls when the window is enlarged.
    Vertically centered to rightThe control remains centered in height in the window regardless of window height. However, the control is anchored to right and it moves to right when the window is enlarged.
    To make the control move slower or faster, use the anchor rate to right.
    CenteredThe control remains centered in height and in width in the window regardless of the window size.
  4. Define (if necessary) the different anchor rates.
  5. Validate.
If "Display .. Options .. Show the anchors" is enabled, the anchoring markers are automatically displayed in the control (red arrows).To display the anchoring markers in the control (red arrows), on the "Display" pane, in the "Show (all the controls)" group, check "Anchors".

Anchoring a control in a tab

A control displayed in a tab is anchored in relation to the tab and not to the window.

Anchoring a selection of controls

To anchor a selection of controls, select "Anchor" from the popup menu (right mouse click) of selection.
Versions 23 and later

Anchor to content

An additional anchor is available for some types of controls: the anchor to content.
The anchor to content, available in height or in width, is used to adapt the control size according to its content. Therefore, a multiline edit control adapted to content in height will be enlarged in height if the control content changes and contains more lines. This type of anchor is very useful for the controls found in a Layout control.
The anchor to content is available for the following controls: Static control, Edit control, Looper, Table, Check box or Radio button.
To anchor a control to content:
  1. Select one or more controls to anchor: Static control, Edit control, Looper, Table, Check box or Radio button.
  2. Define the anchoring of controls:
    • in the "GUI" tab of the description window of control ("Description" from the popup menu of control),
    • via "Anchor" from the popup menu of control.
  3. In the anchoring window, select the type of anchor to content:
  4. If the anchor to content is defined in height:
    • The controls will be enlarged in height according to their content.
    • You must specify the anchor of control in width:
      • None. In this case, the control stretches to the bottom according to its content.
      • The control stretches to the right. In this case, the control stretches to the bottom according to its content and to the right.
      • Right: In this case, the control stretches to the bottom according to its content and it moves to the right.
  5. If the anchor to content is defined in width:
    • The controls will be enlarged in width according to their content.
    • You must specify the anchor of control in height:
      • None. In this case, the control stretches to the right according to its content.
      • The control stretches to the bottom. In this case, the control stretches to the right according to its content and to the bottom.
      • Bottom: In this case, the control stretches to the right according to its content and it moves to the bottom.
  6. Validate.
New in version 23

Anchor to content

An additional anchor is available for some types of controls: the anchor to content.
The anchor to content, available in height or in width, is used to adapt the control size according to its content. Therefore, a multiline edit control adapted to content in height will be enlarged in height if the control content changes and contains more lines. This type of anchor is very useful for the controls found in a Layout control.
The anchor to content is available for the following controls: Static control, Edit control, Looper, Table, Check box or Radio button.
To anchor a control to content:
  1. Select one or more controls to anchor: Static control, Edit control, Looper, Table, Check box or Radio button.
  2. Define the anchoring of controls:
    • in the "GUI" tab of the description window of control ("Description" from the popup menu of control),
    • via "Anchor" from the popup menu of control.
  3. In the anchoring window, select the type of anchor to content:
  4. If the anchor to content is defined in height:
    • The controls will be enlarged in height according to their content.
    • You must specify the anchor of control in width:
      • None. In this case, the control stretches to the bottom according to its content.
      • The control stretches to the right. In this case, the control stretches to the bottom according to its content and to the right.
      • Right: In this case, the control stretches to the bottom according to its content and it moves to the right.
  5. If the anchor to content is defined in width:
    • The controls will be enlarged in width according to their content.
    • You must specify the anchor of control in height:
      • None. In this case, the control stretches to the right according to its content.
      • The control stretches to the bottom. In this case, the control stretches to the right according to its content and to the bottom.
      • Bottom: In this case, the control stretches to the right according to its content and it moves to the bottom.
  6. Validate.

Anchor to content

An additional anchor is available for some types of controls: the anchor to content.
The anchor to content, available in height or in width, is used to adapt the control size according to its content. Therefore, a multiline edit control adapted to content in height will be enlarged in height if the control content changes and contains more lines. This type of anchor is very useful for the controls found in a Layout control.
The anchor to content is available for the following controls: Static control, Edit control, Looper, Table, Check box or Radio button.
To anchor a control to content:
  1. Select one or more controls to anchor: Static control, Edit control, Looper, Table, Check box or Radio button.
  2. Define the anchoring of controls:
    • in the "GUI" tab of the description window of control ("Description" from the popup menu of control),
    • via "Anchor" from the popup menu of control.
  3. In the anchoring window, select the type of anchor to content:
  4. If the anchor to content is defined in height:
    • The controls will be enlarged in height according to their content.
    • You must specify the anchor of control in width:
      • None. In this case, the control stretches to the bottom according to its content.
      • The control stretches to the right. In this case, the control stretches to the bottom according to its content and to the right.
      • Right: In this case, the control stretches to the bottom according to its content and it moves to the right.
  5. If the anchor to content is defined in width:
    • The controls will be enlarged in width according to their content.
    • You must specify the anchor of control in height:
      • None. In this case, the control stretches to the right according to its content.
      • The control stretches to the bottom. In this case, the control stretches to the right according to its content and to the bottom.
      • Bottom: In this case, the control stretches to the right according to its content and it moves to the bottom.
  6. Validate.
Configuring the anchor by programming
Several WLanguage properties allow you to configure the anchor of controls by programming:
Versions 09 and later
Anchor
New in version 09
Anchor
Anchor
..Anchor is used to manage the anchor of a control in a window or report.
Versions 09 and later
AnchorRateBottom
New in version 09
AnchorRateBottom
AnchorRateBottom
..AnchorRateBottom is used to:
  • Find out the anchor rate when a control moves on the vertical axis.
  • Modify the anchor rate when a control moves on the vertical axis.
Versions 09 and later
AnchorRateHeight
New in version 09
AnchorRateHeight
AnchorRateHeight
..AnchorRateHeight is used to:
  • Find out the anchor rate in height of a control.
  • Modify the anchor rate in height of a control.
Versions 09 and later
AnchorRateRight
New in version 09
AnchorRateRight
AnchorRateRight
..AnchorRateRight is used to:
  • Find out the anchor rate when a control moves on the horizontal axis.
  • Modify the anchor rate when a control moves on the horizontal axis.
Versions 09 and later
AnchorRateWidth
New in version 09
AnchorRateWidth
AnchorRateWidth
..AnchorRateWidth is used to:
  • Find out the anchor rate when a control (or a table column) stretches on the horizontal axis.
  • Modify the anchor rate when a control (or a table column) stretches on the horizontal axis.
Versions 23 and later
AnchorToContent
New in version 23
AnchorToContent
AnchorToContent
..AnchorToContent is used to find out and modify how the control adapts according to its content.
Minimum required version
  • Version 10
This page is also available for…
Comments
Click [Add] to post a comment