Skip to main content

Problem:

This demo shows the use of the Dialog System extension DSMOVSZ to query and restore the window's position and size.

Resolution:

INTRODUCTION

==========

This demo shows the use of the Dialog System extension DSMOVSZ to query and restore the window's position and size.

First, the COBOL program verifies if SaveWinSize.ini exists. If it does, it will read in the window size and position and will use DSMOVSZ to restore the window. Each time the user is exiting the screenset, the window's position and size are queried using DSMOVSZ, and the Cobol program will write them to SaveWinSize.ini.

SOURCE FILES:

=========

Program Files                     Description

----------------------------     -----------------------------------------------------------

SaveWinSizeNX31.APP      Net Express v3.1 project file using \\DEBUG

SaveWinSizeNX40.APP      Net Express v4.0 project file using \\RELEASE

SaveWinSize.CBL               COBOL Program

SaveWinSize.GS                 Dialog System Screenset

Copy Files:

----------------------------     -----------------------------------------------------------

SaveWinSize.CPB              COBOL copybook

REQUIREMENTS:

==========

Net Express v3.1 or v4.0

OPERATION:

========

Please consider the following steps:

1. Load the project file into Net Express

2. Click on Project > Update All Dependencies

3. Click on Project > Rebuild All

4. Animate or Run the program

NOTE:

====

Due to a lack of communication between DSMOVSZ and DSGRUN, it is necessary to enable the dynamic window sizing upon SHOW-WINDOW. Otherwise, the objects within the window will not be resized. The steps that need to be taken in this case is as follows:

a. call DSRTCFG with CONFIG-FLAG set to 22 and CONFIG-VALUE set to 1 - this enables the

     dynamic window sizing upon SHOW-WINDOW.

b. unshow the window (UNSHOW-WINDOW)

c. use DSMOVSZ to set window size and position

d. show the window (SHOW-WINDOW)

*** Please bear in mind that dynamic window sizing will move text labels according to the position of the first letter, not the position of the the last letter. For example, you may have text labels RIGHT justified as follows:

                Screenset Name: XXXXXXXXXXXXXXXXXXXXXXXXX

                                  Date: xxxx/xx/xx

Once the window is resized, the entry fields above will still be aligned, not the text labels since the position of 'S' in Screenset Name and 'D' in Date are not aligned. They are aligned with ':' or right justified. To align them, you will need to:

a. change the font to MONOSPACED

b. pad spaces in front of Date, i.e

                Screenset Name: XXXXXXXXXXXXXXXXXXXXXXXXX

                bbbbbbbbbDate: xxxx/xx/xx        

    where b represents one space

==========================================================

Keywords: demonstration, sample, example, demo, Dialog System, SaveWinSize.zip

demo.ex

demo.ne

Attachments:

SaveWinSize.zip

Old KB# 4237