skip to main content
OpenEdge Development: AppBuilder
Multiple Layouts : What is a layout?
 
What is a layout?
A layout can be thought of as a collection of objects and associated property settings. These property settings determine how the objects appear when you run the application. Each layout has a name and an associated run‑time expression. Run‑time expressions evaluate to TRUE or FALSE, and determine which layout is presented during a specific session. Typically the same set of run‑time expressions will appear for all procedure files in an application. For SmartObjects, layouts are typically associated with values of the ObjectLayout instance property.
When you run a procedure file, it evaluates the run‑time expressions (if any) for the available layouts and, if a layout’s expression evaluates to TRUE, uses that layout. For a SmartObject, this run‑time expression determines the setting of the DefaultLayout property. If the SmartObject has no ObjectLayout property setting, it uses the DefaultLayout property setting to determine the layout. When the procedure file determines that it will use a particular layout, the procedure file executes for that layout a CASE statement that contains all of the property settings assigned for the layout.
The AppBuilder generates a CASE statement that contains an entry for each layout in the procedure file. The CASE statement is contained within the internal procedure named {&LAYOUT-VARIABLE} variables. This procedure name resolves to the name of the procedure file’s window, with “-Layouts” appended. For example, if the window name is WINDOW-1, the name of this procedure is WINDOW-1-Layouts. For more information about how layouts are implemented within a procedure file, see the “How multiple layouts work: a look at the code” section.
At design time, a layout is visually manifested in the design window. When you switch between layouts in the design window, the AppBuilder alters the appearance of the design window to match the characteristics of the new layout.