THIS PAGE IS PRINTED FROM www.revasoft.com |
USING THE ULC VISUAL PARTS (BOX LAYOUT) |
When working with the ULC visual parts, you will work with three different kinds of parts:
Note: when dealing with ULC visual parts, the cells keep track of the alignment of their widgets and not the widget's themselves. Defining the Layout
When you create a ULC container part like a ULCShell, a Notebook page, or a GroupBox part it contains a single Cell. To define layout your first step is to insert a box part which defines the grid. The ULC parts category provides three Box part variations:
The layout of your part is then defined by either nesting box parts or by spanning the cells of a box part. Refer to the Managing Layout chapterfor a description of how to use Boxes to define layouts. In a nested box and cells structure you need to be able to distinguish boxes from cells. To make this distinction more explicit the bounds of a box are indicated by a solid blue line and bounds of a cell by a dashed line. Adding widgets
Widgets are added by dropping them into cells. A cell can contain a single widget. Once dropped into a cell the widget is immediately resized according to the cell's alignment. When you add a widget to an already filled cell you replace its existing contents. To reserve some fixed amount of white space in a layout drop a Filler part into a cell. A Filler has properties to define the minimum amount of white space it should take in both directions. Setting the properties
Box, Cell, and Widget parts have different properties which you set in their setting views. You open the box settings view as usual by selecting 'Open Settings' from the pop-up menu of the box or by the part's default action. If you have a small margin it is easier to use the 'Open Box Settings' menu of the cell's pop-up menu. A Box part has the following properties:
All cells have two properties to define the alignmentof their contained widget: horizontalAlignment: the horizontal alignment of the contained widget: Expand, Center, Left, Right.
You can change the alignment property of a cell in the following ways:
Cells contained in a Grid Layout part have additional spanning properties which you can use to define cells which span over other cells.
The following figure shows how the parts and properties are presented in the Composition Editor. ![]() Figure 1: Box Parts and Properties in the Composition Editor The figure above shows a box which defines as three by three grid. There is both a cell which spans vertically and a cell which spans horizontally. The arrows in an empty cell indicate how it will align its contents. An arrow is shown at every attachment point. For example, the top left cell has the alignment set to expand in both dimensions. If there is no attachment point then the cell will center the widget in the corresponding dimension. In addition to changing the spanning with the spanning properties you can change it by direct manipulation with the blue grid handles. The grid handles are shown in the figure below. You can drag the grid handles either horizontally or vertically to span a cell. ![]() Figure 2: Spanning Handles Changing the grid
|
The End |