parentAspect
Type: Integer
Availability: Read or write at any time
The parentAspect property of the Control class contains the aspect of the control to its parent. The default value for this property is ParentAspect_None (0). For details about obtaining the bottom and right offsets of the control from its parent, see the Control class parentBottomOffset and parentRightOffset properties.
The parentAspect property provides the following features for any control other than a Sheet, StatusLine, JadeDockBar, or JadeDockContainer control, to enable you to define resize and reposition actions that take effect without having to write any logic.
-
Determines whether the control stretches horizontally, vertically, or both horizontally and vertically with the parent as the parent size changes.
For horizontal stretching, the left position remains fixed and the control width is changed so that the distance from the right edge of the control to the right of the client area of the parent remains constant. For vertical stretching, the top position remains fixed and the control height is changed so that the distance from the bottom edge of the control to the bottom of the client area of the parent remains constant.
-
Determines whether the control is anchored to the right, bottom, or both to the right and bottom of the parent as the size of the parent changes.
For horizontal anchoring, the left position of the control is changed so that the distance from the right edge of the control to the right of the client area of the parent remains constant. For vertical anchoring, the top position of the control is changed so that the distance from the bottom edge of the control to the bottom of the client area of the parent remains constant.
-
Determines whether the control is centered horizontally, vertically, or both horizontally and vertically within the client area of the parent as the size of the parent changes.
When the value of the StatusLine control autoSize property is true:
-
If a child control left property value position is less than zero, the control is moved to be zero (0) when the parentAspect, relativeLeft, and relativeWidth property values of the child do not affect the horizontal position (not stretch horizontal, anchor right, and centered horizontal, and the relativeLeft and relativeWidth property values are false).
-
If a child control is not fully visible horizontally, the child is right‑aligned in the status line control if it can be fully displayed or positioned at zero (0) if it cannot when the parentAspect, relativeLeft, and relativeWidth property values of the child do not affect the horizontal position (not stretch horizontal, anchor right, and centered horizontal, and the relativeLeft and relativeWidth property values are false).
-
If a child control top position is less than zero (0), the control is moved to be zero when the parentAspect property value of the child does not affect the vertical position (not stretch vertical, anchor bottom, or centered vertical).
-
If a child control is not fully visible vertically, the child is bottom‑aligned in the StatusLine control when the parentAspect property value of the child does not affect the vertical position (not stretch vertical, anchor bottom and centered vertically).
-
The values of the relativeTop and relativeHeight properties of child controls are always set to false, as their functionality is not compatible with auto‑sizing the height of the StatusLine control (as has always been the case).
-
All parentAspect flag values and relativeLeft and relativeWidth values are applied.
The height of the StatusLine control is then determined by analyzing the child control as follows, to determine the maximum height required. For a child control that does not have a fixed height and has the parentAspect property with the:
-
ParentAspect_StretchBottom flag set, the height required is the top position, height, and parentBottomOffset property values of the child.
-
ParentAspect_AnchorBottom flag set, the height required is the height and parentBottomOffset property values of the child; otherwise, the height of the child control.
The Control class constants are listed in the following table.
Constant | Integer Value |
---|---|
ParentAspect_None | 0 |
ParentAspect_StretchRight | #1 |
ParentAspect_StretchBottom | #2 |
ParentAspect_StretchBoth | #3 |
ParentAspect_AnchorRight | #4 |
ParentAspect_AnchorBottom | #8 |
ParentAspect_AnchorBoth | #c |
ParentAspect_CenterHorz | #10 |
ParentAspect_CenterVert | #20 |
ParentAspect_CenterBoth | #30 |
The property values are a bit mask of valid combinations. For example, you can anchor a control to the bottom of its parent and also have it stretch horizontally as the parent width varies, by setting the property value to ParentAspect_StretchRight + ParentAspect_AnchorBottom.
Similarly, you can center a control vertically and have it stretch horizontally as the parent width varies, by setting the property value to ParentAspect_CenterVert + ParentAspect_StretchRight. However, not all combinations are compatible, and an invalid combination results in an exception being raised at run time.
The following values for parentAspect are mutually incompatible and you can include only one.
-
ParentAspect_StretchRight
-
ParentAspect_AnchorRight
-
ParentAspect_CenterHorz
The following values for parentAspect are mutually incompatible and you can include only one.
-
ParentAspect_StretchBottom
-
ParentAspect_AnchorBottom
-
ParentAspect_CenterVert
When using the parentAspect property, note the following points.
-
The property is ignored:
-
If the alignment of the control is already specified by using the alignContainer or alignChildren property of a Frame, JadeDockBar, or JadeDockContainer control; for example, a frame that has the alignContainer property set to AlignContainer_Width (3).
-
For direct children of a JadeDockContainer control, which always automatically positions its children. Children that have no specific alignment are positioned in rows or columns so that they do not overlap.
The JadeDockContainer also adjusts the position of the children to minimize the height or width of the container, when appropriate.
-
For a JadeDockBar control except when the container has the alignChildren property set to AlignChildren_None (0). This setting means that it is your responsibility to position the children.
All other settings cause the children to be automatically positioned.
-
-
Some controls have fixed heights and widths. Any stretching is ignored for those cases, as follows.
-
Height
-
A Button control that is automatically sized to its picture property
-
Any fixed height CheckBox control
-
Any fixed height ComboBox control
-
A Label control that is automatically sized
-
Any fixed height OptionButton control
-
A Picture control that automatically sizes to its picture property; that is, Stretch_ControlTo (2) and Stretch_Proportional (3)
-
An automatically positioned Sheet or StatusLine control
-
-
Width
-
-
The parentAspect property values can conflict with the relative property requirements. Where they do, the relative property setting is ignored, as follows.
-
If ParentAspect_StretchRight applies, the relativeLeft and relativeWidth properties are ignored
-
If ParentAspect_StretchBottom applies, the relativeTop and relativeHeight properties are ignored
-
If ParentAspect_AnchorRight applies, the relativeLeft property is ignored
-
If ParentAspect_AnchorBottom applies, the relativeTop property is ignored
-
-
For a ListBox or TextBox control with the integralHeight property set to true, the actual distance between the bottom edge of the control and the bottom of the client edge of the parent varies, as the height of the control is rounded to the nearest integral line height.
-
If logic changes the position or size of the control, the distances to the edges of the parent of the control are re-evaluated and used from then on.
You can also use the Form class minimumHeight and minimumWidth properties to prevent the user resizing the form and causing controls to overlap or the form to have no effective height or width.