skip to main content
OpenEdge Development: AppBuilder
Multiple Layouts : Modifying layouts with layout inheritance
 
Modifying layouts with layout inheritance
In general, if you make a change to the master layout, such as adding a button, the AppBuilder automatically adds the same button to all of the other layouts in the application. Similarly, if you change the size (or other property) of a widget in the master layout, that change is also reflected in the other layouts in the application. This process of automatically passing on the master layout’s characteristics to alternate layouts is called layout inheritance.
Within each alternate layout, you can explicitly override inheritance on a property‑by‑property basis for each widget. You can do this by manipulating the widgets or by changing their properties. For example, if you change the color of a button in an alternate layout, it disinherits that property from the master. No matter how you change the color of the button in the master, the alternate layout is unaffected, and vice versa.
Note: Not all properties can be disinherited. Some properties can only have one value for all layouts. Such properties are insensitive in the widget’s property sheet and cannot be changed.
You can also override layout inheritance on a widget‑by‑widget basis by inserting a widget into an alternate layout or by removing a widget from the alternate layout.
You can re‑establish layout inheritance for a widget on a property‑by‑property basis. To do this, access the widget’s advanced property sheet and choose the Sync with Master button. For more information, see the “Re-establishing layout inheritance” section.
Layout inheritance behavior at run time
At run time, inheritance always occurs from the master layout to all other layouts in the procedure file. However, inheritance is conditional in that a character layout does not inherit all of the widgets or properties in a graphical layout, and inheritance can be explicitly overridden.
Character layout inheritance
If the character-mode AVM does not support a particular widget, a character layout cannot inherit the widget even if it appears in the master layout. Similarly, if the character-mode AVM does not support a particular property for a widget, the character layout cannot inherit the property. For example, the height of fill‑ins, combo boxes, toggle boxes, buttons, and text widgets is always 1 in a character interface.
When you create a character alternate layout, the AppBuilder changes the appearance of the design window and the widgets within the design window to fit within the limitations of a character environment. Thus, buttons can only be one line high, and the character window has a default width of 80 character units and a height of 21 character units. For more information, see the “Simulating character applications” section.
Overriding layout inheritance
If you change a property of a widget in an alternate layout, that layout no longer inherits the property from the master layout unless you explicitly re‑establish layout inheritance. Also, if you insert a widget into an alternate layout, or delete a widget from an alternate layout, you disinherit the widget from the master layout.
There are two special cases:
*If you change either coordinate of a widget’s position, the other coordinate is disinherited as well. You must synchronize both coordinates with the master layout to re‑establish layout inheritance.
*If you change either dimension of a widget, the other dimension is disinherited as well. You must synchronize both dimensions to re‑establish layout inheritance.
Layout inheritance behavior at design time
When you create a new layout at design time, it inherits the characteristics of the current layout, even if the current layout is not the master layout. The new layout also disinherits each property that the current layout disinherits from the master. However, at run time, layout inheritance occurs between the new alternate layout and the master layout.
Re-establishing layout inheritance
The Sync with Master function lets you reapply inheritance.
To re-establish layout inheritance:
1. While in an alternate layout, open the advanced property sheet for the widget whose layout inheritance is to be re‑established, then click Sync With Master. The Sync With Master dialog box appears:
This dialog box displays, for the current widget, all of the property discrepancies between the master and alternate layout. You can re‑establish layout inheritance in two ways:
*Have the master adopt the properties of the alternate layout. This changes the widget’s definition in the master layout.
*Have the alternate layout adopt the properties of the master layout. This changes the properties of the alternate layout to match those of the master layout.
2. Select the property to synchronize.
3. Click the button that indicates how to synchronize the property:
*If you click Alternate Reverts to Master Value, a greater than symbol (>) appears to the right of the Master Layout Column. This indicates that the alternate layout adopts the property setting from the master layout.
*If you click Master Updates to Alternate Value, a less than symbol (<) appears to the right of the Master Layout Column. This indicates that the master layout adopts the property setting from the alternate layout.
*To remove any synchronization choice, click the center button between Alternate Reverts to Master Value and Master Updates to Alternate Value.
If neither symbol appears, the properties will not be synchronized.
An alternate technique to indicate property synchronization is to repeatedly double‑click on the property in the selection list. As you double‑click on the property, the AppBuilder rotates among the greater than (>) symbol, the less than (<) symbol, and no symbol.
4. When you finish specifying how to synchronize the properties, click OK.
The AppBuilder synchronizes the properties according to the button you choose. The AppBuilder also re‑establishes inheritance for the property, with two exceptions:
*If you change either coordinate of a widget’s position, the other coordinate is disinherited as well. You must synchronize both coordinates with the master layout to re‑establish layout inheritance.
*If you change either dimension of a widget, the other dimension is disinherited as well. You must synchronize both dimensions with the master layout to re‑establish layout inheritance.