Creating a Resizable Screen

If you plan to allow your users to resize screens at run-time, you can simplify the process of handling that screen with a layout manager. A layout manager is a tool that, given a certain set of rules, determines how the size and placement of screen controls change as the size of the screen shifts. The exact rules vary by layout manager; you can write your own or use the one provided as part of your ACUCOBOL-GT installation, called LM_RESIZE.

This topic describes how to use built-in AcuBench support for LM_RESIZE to create a resizable screen. For information about layout managers in general, as well as detailed information about the ACUCOBOL-GT resize layout manager, see Layout Managers.

To create a resizable screen that uses LM_RESIZE as its layout manager, do the following:

  1. Click the screen form in the Screen Designer.
  2. In the Alphabetic tab of the Property window, scroll to the Auto Resize property. This property must be disabled in order to use a layout manager, so verify that its value is FALSE.

    If Auto Resize has been set to TRUE, click in the Value column and use the drop-down list to change its value.

  3. Still in the Property window, scroll to the Resizable property and set its value to TRUE.
  4. Finally, to specify a layout manager, scroll up to the Layout Manager property and change its value to LM_RESIZE.

    When you generate your program, AcuBench automatically creates a COPY file called lmresize.def to support layout manager functions within your program.

    AcuBench also assigns a unique Layout Manager Handle property to the screen. You can change the name of the handle, but keep in mind that if you have multiple resizable screens in your application, each layout manager handle must be unique.

When you generate your program, AcuBench automatically creates a COPY file called lmresize.def to support layout manager functions within your program.

Note that AcuBench also assigns a unique Layout Manager Handle property to the screen. You can change the name of the handle, but keep in mind that if you have multiple resizable screens in your application, each layout manager handle must be unique.

Later, as you add controls to your screen, you can use the Layout Data property to determine exactly how the resize manager handles that control when the screen size changes. The Layout Data property is discussed in Layout Data Control Property.

Note that in order for the layout manager to function properly, you must also change the screen's Auto Resize property to FALSE.

The resize layout manager facility is demonstrated in an AcuBench sample project located in the Support area of the Micro Focus Web site.