Understanding layouting with the HTML5 theme / Layout markup and data structures |
Layout policy elements are descendants of layout items that carry size policy constraints.
A layout item can have one (and only one) layout policy element. A layout item does not have to have any layout policy element (for layout items that do not have any size policy constraints). The layout policy element may be a layout container if the sub-tree of the layout container item has more than one size policy constrained element, or needs a layout container to be laid out. In other words, if several items have a layout policy element, they should have an ascendant that is a container that will collect and re-compute the policy.
Property | Default Value | Description |
---|---|---|
widthHint | A hint for the desired width. See How to specify desired sizes. | |
widthPolicy | All | The width policy. See Table 3. |
minWidth | The minimum width in pixels. By default, the minimum width is equal to the desired width. To give a specific minimum width, set the minWidth property. See How to specify desired sizes. | |
heightHint | A hint for the desired height. See How to specify desired sizes. | |
heightPolicy | All | The height policy. See Table 3 |
minHeight | The minimum height in pixels. By default, the minimum height is equal to the desired height. To give a specific minimum height, set the minHeight property. See How to specify desired sizes. | |
horizontalStretching | false | Stretch the policy element horizontally so that it fills its parent. |
verticalStretching | false | Stretch the policy element vertically so that it fills its parent. |
isScrollView | false | A value indicating whether the policy-constrained element is also a scroll view. |
deferSizing | false | If true the computing of the desired size by the parent item will be deferred until the InvalidLayout function is called with the value true as the third parameter. Typically used by image widgets for which the computing of the size must be deferred until the image has been loaded. |
[N['px']]['*']
The minWidth and minHeight properties expect a number of pixels.
Example | Description |
---|---|
10 | Specify a desired size of 10 cells. |
* | Specify a desired size of zero (0) cells, with a stretch capacity. |
7* | Specify a desired size of seven (7) cells, with a stretch capacity. |
50px | Specify a desired size of 50 pixels. |
50px* | Specify a desired size of 50 pixels, with a stretch capacity. |
Value | Description |
---|---|
All | The size of an element depends on its content only. |
AllInitial (the words All + Initial) | The size of the element is the size of its initial content. |
CanShrink | According to its content, the size of the element can shrink compared to the size given by the form definition file. |
CanShrinkInitial | According to its initial content, the size of the element can shrink compared to the size given by the form definition file. |
CanGrow | According to its content, the size of the element can grow compared to the size given by the form definition file. |
CanGrowInitial | According to its initial content, the size of the element can grow compared to the size given by the form definition file. |
Fixed | The size of the element depends on the size given by the form definition file only. |
Container | The size of the element is merged with the information provided by the container. |
By default, the layout is invalidated when the markup of the page changes. It may also be invalidated on custom events.