The Resize Layout Manager

The resize layout manager is designed to assist with the process of handling resizable windows (a resizable window is a floating window created with the RESIZABLE phrase. It implements some basic rules that automate what happens to controls when a window changes size. While the resize manager handles only some fairly simple cases, the cases are common ones. This frees the programmer to concentrate on more complex cases. See Format 11 DISPLAY FLOATING WINDOW in the ACUCOBOL-GT Reference Manual for more information.

The standard object name of the resize manager is LMRESIZE.

What the resize manager does affects only controls that have non-zero LAYOUT-DATA. Thus, by default, the resize manager has no effect on a window. If you want the resize manager to act on a control, you assign that control a LAYOUT-DATA value that indicates the kind of action you want it to take.

When the resize manager is first attached to a window, it does two things:

  1. It automatically applies the CONTROLS-UNCROPPED style to the window. This is necessary for the resize manager to function properly
  2. It records the current dimensions of the window. These are called the design dimensions. The resize manager uses the design dimensions when deciding how to size and position controls

The essential concept with the resize manager is that the size of the window when it is attached is the "natural" or "design" size of the window. It assumes that all controls placed on the window look right when placed on a window of this size.

For example:

   DISPLAY STANDARD GRAPHICAL WINDOW
      BACKGROUND-LOW
      LINES 25, SIZE 80
      LAYOUT-MANAGER = LAYOUT-1

The resize manager takes effect anytime the window is resized or a control is added to the window. The resize manager acts on any control that has a non-zero LAYOUT-DATA value. The exact value determines what actions the resize manager takes. The resize manager assumes that it has complete control over the size and placement of controls that have LAYOUT-DATA. After such a control has been displayed, the program should not modify it in a way that changes its size or position (that is the job of the resize manager). Doing so may result in improper resizing or repositioning by the resize manager.

Note that a Screen Section control that is subject to the resize manager has its design values set when the control is created.

There is a COPY file that can be helpful when working with the resize manager. It contains a pre-declared layout manager handle (called LM-RESIZE) and constants for the most common combinations of LAYOUT-DATA settings. This COPY library is called lmresize.def.

Tip: The resize layout manager facility is demonstrated in an AcuBench sample project located in the Support area of the Micro Focus Web site. To download the program, go to: https://supportline.microfocus.com/examplesandutilities/index.aspx, and select ACUCOBOL-GTĀ® Samples > Graphical User Interface (GUI) Sample Programs > layoutmgr.zip.
Note: .NET controls cannot be managed by the resize layout manager.