Highlighted
Absent Member.
Absent Member.
1577 views

[archive] Using the Layout Manager

[Migrated content. Thread originally posted on 09 October 2009]

I have an issue with trying to use the Layout Manager.

I downloaded AcuCorp's sample, and ran it, it worked fine. I tried to incorporate this into one of my programs, and the Layout Manager did not work. I then tried to copy AcuCorps window into my program and then the sample window did not work.

I contacted technical support, they agreed it did not work, but suggested I post here, unless I want to pay an engineer to look at my program and tell me why it doesn't work. 🙂

Basically, I have three problems.

1. My current window is 25 lines and 70 columns. This is the smallest I want the window to be. When I add the RESIZABLE clause to the window, it automatically comes up full screen and totally ignores the size and lines, maximized and you cannot "resize" until you "restore" it.

2. So, in order to have the window come up the small size I want it to be, I added the ACTION ACTION-RESTORE to my window, which makes it almost the size I want it to be by default -- it is two lines shorter than it is supposed to be, but if you click on it to move it or resize it, it makes it the right size.

I understand from reading the documentation that when you use RESIZABLE, your window should be a maximum size. But, we have over 400 programs and all our controls are designed to fit and look nice on the current window sizes, which is what I want to make the minimum size. The ACTION ACTION-RESTORE is fine and it works for me, but the window is two lines too small. But, when you click on the window, it makes it the right size, but it doesn't trigger any kind of even. It's a little strange.

Whether I use the ACTION to restore my window, or just click on it myself to restore down, when I drag the window to resize it, the LAYOUT MANAGER is not working. The fields do not change.

If I change the window to a FLOATING window, it does.

I can probably work around issues 1 and 2, although, if anyone has any ideas on dealing with displaying windows that are really displayed up-front in the minimum size, that would be great. But, I really need to figure out what is different in my window that the LAYOUT MANAGER does not work.

This is the program I sent to Tech Support that they agreed does not work, they didn't know why though.

IDENTIFICATION DIVISION.
PROGRAM-ID. DMOE100N.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. DG-ICOBOL.
OBJECT-COMPUTER. RYAN-MCFARLAND.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
DATA DIVISION.
FILE SECTION.
WORKING-STORAGE SECTION.
78 ACTION-MINIMIZE VALUE 20.
78 ACTION-MAXIMIZE VALUE 21.
78 ACTION-RESTORE VALUE 22.
77 LM-RESIZE HANDLE OF LAYOUT-MANAGER, LM-RESIZE.
78 RLM-RESIZE-X VALUE 1.
78 RLM-RESIZE-Y VALUE 16.
78 RLM-RESIZE-BOTH VALUE 17.
01 WL-CODE-DATA.
03 WL-CODE-NO PIC X(6).
03 WL-CODE-DESC PIC X(30).
03 WL-DUE-CODE PIC X.
77 DEFAULT-FONT HANDLE OF FONT.
77 SMALL-FONT HANDLE OF FONT.
77 TOOLBAR-1 HANDLE OF WINDOW.
77 PROG-WIN-HANDLE HANDLE OF WINDOW.
77 KEY-STATUS IS SPECIAL-NAMES CRT STATUS PIC 9(4) VALUE 0.
88 Exit-Pushed VALUE 27.
LINKAGE SECTION.
SCREEN SECTION.
01 SCRN-G1.
03 SCRN-FRAME FRAME RAISED HEAVY
LINE 4 COL 2 LINES 2 SIZE 67 CELLS
MIN-HEIGHT = 2
MIN-WIDTH = 67
LAYOUT-DATA = RLM-RESIZE-BOTH.
03 LABEL LINE + 0.5 COL 2.4 "Code" FONT DEFAULT-FONT.
03 LABEL COL 9.5 "Description" FONT DEFAULT-FONT.
03 SCRN-CODE-LIST LIST-BOX USING WL-CODE-DATA 3-D ID 2
NOTIFY-DBLCLICK NOTIFY-SELCHANGE
LINE + 1.5 COL 2 LINES 18 CELLS SIZE 67 CELLS
DATA-COLUMNS = (1,7,37,38,41,42,45)
DISPLAY-COLUMNS = (1,8,47,50,54,57,61)
ALIGNMENT = ("L","L","C","R","C","R","R")
LAYOUT-DATA = RLM-RESIZE-BOTH.
01 TOOLS-REC.
03 PUSH-BUTTON SELF-ACT "Exit Program"
BITMAP FLAT
SIZE 16 LINES 15 COL 2
EXCEPTION-VALUE 27.
03 TB-ADD-BUTTON PUSH-BUTTON SELF-ACT
TITLE "Add a New Code"
BITMAP FLAT BITMAP-NUMBER = 13
SIZE 16 LINES 15 OVERLAP-LEFT
EXCEPTION-VALUE 01.
03 TB-CHG-BUTTON PUSH-BUTTON SELF-ACT
TITLE "Change Code"
BITMAP FLAT BITMAP-NUMBER = 18
SIZE 16 LINES 15 OVERLAP-LEFT
TERMINATION-VALUE = 13.
03 TB-DEL-BUTTON PUSH-BUTTON SELF-ACT "Delete Code"
BITMAP FLAT BITMAP-NUMBER = 6
SIZE 16 LINES 15 OVERLAP-LEFT
EXCEPTION-VALUE 02.
03 PUSH-BUTTON SELF-ACT "Print Codes File Listing"
BITMAP FLAT BITMAP-NUMBER = 12
SIZE 16 LINES 15 OVERLAP-LEFT
EXCEPTION-VALUE 03.
03 PUSH-BUTTON SELF-ACT "Help On Codes File Maintenance"
BITMAP FLAT BITMAP-NUMBER = 11
SIZE 16 LINES 15 OVERLAP-LEFT
EXCEPTION-VALUE 951.
PROCEDURE DIVISION USING RM-LINKAGE-AREA.
DECLARATIVES.
END DECLARATIVES.
MAIN SECTION.
OPEN-SHOPPE.
2000-GUI-MAINT.
ACCEPT SMALL-FONT FROM STANDARD OBJECT "SMALL-FONT".
ACCEPT DEFAULT-FONT FROM STANDARD OBJECT "DEFAULT-FONT".
DISPLAY STANDARD GRAPHICAL WINDOW
HANDLE IN PROG-WIN-HANDLE
MODELESS BIND TO THREAD
CELL SIZE = LABEL FONT SMALL-FONT
CONTROL FONT SMALL-FONT
TITLE "Codes File Maintenance"
LINES 25
SIZE 70
BACKGROUND-LOW
SYSTEM MENU
MIN-SIZE 70
MIN-LINES 25
RESIZABLE
ACTION ACTION-RESTORE
LAYOUT-MANAGER = LM-RESIZE.
DISPLAY TOOL-BAR LINES 2 HANDLE IN TOOLBAR-1.
DISPLAY TOOLS-REC UPON TOOLBAR-1.
DISPLAY SCRN-G1.
PERFORM UNTIL Exit-Pushed
ACCEPT SCRN-G1
END-PERFORM.
CLOSE WINDOW PROG-WIN-HANDLE.
STOP RUN.

Thanks for any help,
Rebekah
0 Likes
5 Replies
Highlighted
Absent Member.
Absent Member.

RE: [archive] Using the Layout Manager

Hi, Rebekah.

I compiled the program and am running it wil version 8.1.1. I see the initial window display being 2 lines to small and correcting when you click on but I am not seeing the problem with the controls not changing size when dragging the window larger and then smaller or using the restore up and restore down.

The toolbar and listbox both enlarge and shrink as the window does. Were the fields referred to something other than the toolbar and listbox?
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Using the Layout Manager

I think the 2 lines too short issue has to do with the window being resizable and a resiazable window expecting a status bar on the bottom (for the little grab thing that windows have in the lower right corner).

Add a status bar to the window and see if that solves your problem...

The Layout Manager works (we use 6.1.0), it just requires some tweaking to each window in the After create procedure... I use it on several windows with no troubles other than tweaking each one a little bit before it opens. And really this is only because users can save the size of the window, so I have to adjust controls slightly when it opens.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Using the Layout Manager

I ran your program and it is your tool bar that is causing the issue with the window being 2 lines too small (comment out the display for the tool bar and you will see it works as expected). You can fix this by compensating and adding 2 more lines to your window display.

DISPLAY STANDARD GRAPHICAL WINDOW
HANDLE IN PROG-WIN-HANDLE
MODELESS BIND TO THREAD
CELL SIZE = LABEL FONT SMALL-FONT
CONTROL FONT SMALL-FONT
TITLE "Codes File Maintenance"
[B]LINES 27[/B]
SIZE 70
BACKGROUND-LOW
SYSTEM MENU
MIN-SIZE 70
MIN-LINES 25
RESIZABLE
ACTION ACTION-RESTORE
LAYOUT-MANAGER = LM-RESIZE.


I do not see the issue of the window starting out maximized (with or without the action-restore). I would check your environment settings I know this one caused me a great deal of grief with maximized windows when I switched to some resizable windows.

SCREEN WINDOW=999,999
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Using the Layout Manager

Toolbar and menu affect the window size, statusbar does not. Historical reasons. 🙂
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Using the Layout Manager


I do not see the issue of the window starting out maximized (with or without the action-restore). I would check your environment settings I know this one caused me a great deal of grief with maximized windows when I switched to some resizable windows.

SCREEN WINDOW=999,999


This was it. I would never have thought to look at this configuration setting. Thank you so much. I knew I could work around the two line thing, but I could not figure out why the full size part of it was such a problem. Again, thank you.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.