The following example from the "View Groups" application makes use of three layout types: VStackLayout, FlowLayout and HStackLayout. The vertical StackLayout is the outermost layout. The first nested layout is a FlowLayout for the dialog's IconCmd buttons. The FLOWLAYOUTID_IconButtons FlowLayout definition is in ustation.rsc . A ListBox is next in the vertical stack and has a stretch factor of 1 so it gets more space vertically as the dialog is resized larger. The next nested layout is a horizontal StackLayout that contains a Stretch item and two PushButtons. The Stretch item is given a stretch factor of 1 so it gets more space horizontally as the dialog is resized larger. The HSTACKLAYOUTID_DialogButtons HStackLayout definition is also in ustation.rsc . For standardization of margins and spacing, layouts defined in MicroStation should be used when possible.
The following example from the "Place Line" command is placing two rows in a GridLayout. The items on the row are surrounded by the GridRow and EndRow items. Each item is automatically assigned a sequential column number. Each row contains a ToggleButton, Label and Text field. The ToggleButton actually contains the label string. But for layout purposes, a Label item is added and specifies the "LABEL_LINKPREV" itemArg value in order to link to the previous item (the ToggleButton). Using this technique, the label string is pulled over to the Label item and the two items are "linked" for the focus model. This allows the ToggleButton to keep the label in its resource definition in case it is used outside a layout, and also allows the Label item to "link" to it and specify an independent column and size policy for layout purposes. In this case, the default "left alignment" is applied to the Label item. The "LABEL_LINKNEXT" itemArg value would pull the label string from the following item.
The following example is an excerpt from the Configuration Variables dialog application. The CfgVars dialog was a fixed size in V8i. By creating and setting up the GuiLayoutHelper and adding all the dialog items to various nested layouts, we were quickly and easily able to improve the layout of the dialog and make it resizable.