8.1 Locating & Sizing Pop-up Windows
One of the most time consuming aspects of setting up a pop-up window is deciding upon the location and size of the window required.
If you follow these simple techniques, the amount of time involved can be significantly reduced.
- Always think of where you want the upper left hand corner of the window to be.
- Code this into the command like this:
POP_UP FIELDS(#A #B #C #D) AT_LOC(5 22) WITH_SIZE(*AUTO)
The WITH_SIZE(*AUTO) option tells LANSA to size the window to fill all the rest of the screen to the right of and below the AT_LOC row and column positions specified.
- If you then invoke the screen painter, the result would look something like this - which may be considerably larger than you actually need.
row 5 .......................................... col 22 ----> POP01 Pop-up demo : : : : Field A .... IIIIIIII Field B .... II : : Field C .... IIIIIIIIIIIII : : Field D .... III : : : : : : : : : : : : Enter F15=Exit F12=Cancel F14=Msgs : : : :........................................:
|
|
row 5 .......................................... col 22 ----> POP01 Pop-up demo : : : : Field A .... IIIIIIII Field B .... II : : Field C .... IIIIIIIIIIIII : : Field D .... III : : : : : : : : : : : : Enter F15=Exit F12=Cancel F14=Msgs : : : :........................................:
|
|
- By using the screen painter, you can reorganize the fields in the window into the form you want like this:
row 5 .......................................... col 22 ----> POP01 Pop-up demo : : : : Field A .... IIIIIIII : : Field B .... II : : Field C .... IIIIIIIIIIIII : : Field D .... III : : : : : : : : : : Enter F15=Exit F12=Cancel F14=Msgs : :........................................:
|
|
Now before exiting from the screen painter, and aided by the "G" (screen grid) painter action, observe that relative to the upper left hand corner of the window you can reduce the window width by about 6 characters and its length by about 5 lines.
- After exiting from the screen painter, the actual AT_LOC and WITH_SIZE parameters are re-written like this (figures shown are approximate and not actual):
AT_LOC(05 22) WITH_SIZE(55 19)
so you can quickly change them to be like this:
AT_LOC(05 22) WITH_SIZE(51 14)
- Now, if the screen painter was run again, the result should be a nicely proportioned window with its upper left hand corner at row 5 position 22:
row 5 ............................... col 22 ----> POP01 Pop-up demo : : : : Field A .... IIIIIIII : : Field B .... II : : Field C .... IIIIIIIIIIIII : : Field D .... III : : : : Enter F15=Exit F12=Cancel : : F14=Msgs : :.............................:
|
|