GUI ScreenIO for Windows

 ScreenIO.com


Sample Multiple Working-set Application

Subordinate subroutines for sets 2-4

The first subroutine of each working-set does the flow-control for the entire set, so it's the most complex program of each working-set.  

The rest of the subroutines in the working set simply worry about themselves.

Switching working-sets

When the user changes from this set to a different one (that was opened previously), you receive the event panel-EVENT-INACTIVATED.  panel-ACTIVATED-PANEL-NAME will contain the name of the panel that is to be activated (the one that the user clicked), and panel-ACTIVATED-WORKING-SET contains the working-set of the panel which is to become active. 

This routine simply moves the content of these fields to ACTIVE-PANEL and ACTIVE-SET, respectively, and then returns to the calling program. 

Again, the main program will examines ACTIVE-SET to determine which subroutine needs to be called to activate the desired panel.

Closing subordinate panels in a working-set

As we've said countless times before, don't do it.  Calling GUI ScreenIO to redisplay a previously-displayed panel in the set will cause this one to be closed automatically.  As you can see in the code below, you don't need to worry about it.

End of job

If the user clicks on the X box in the upper-right corner of the main panel, you will receive a panel-EVENT-CLOSE-AND-STOP.

The correct response is simply to set END-OF-JOB to TRUE, and return to the calling program. 

 IDENTIFICATION DIVISION.
 PROGRAM-ID. SET2A.
 DATE-COMPILED.
 ENVIRONMENT DIVISION.
 CONFIGURATION SECTION.
 SOURCE-COMPUTER. IBM-PC.
 OBJECT-COMPUTER. IBM-PC.
 DATA DIVISION.
 WORKING-STORAGE SECTION.
* ------------------------: Panel copybook:
     COPY PSET2A.
 LINKAGE SECTION.
 01  WORKING-SET-DATA.
     05 ACTIVE-PANEL        PIC X(8).
     05 ACTIVE-SET          PIC S9(4) COMP-5.
       88 END-OF-JOB        VALUE 0.
 PROCEDURE DIVISION USING WORKING-SET-DATA.
 FLOW-CONTROL.
     MOVE ACTIVE-SET TO PSET2A-WORKING-SET.

     PERFORM WITH TEST AFTER
         UNTIL ACTIVE-SET NOT = PSET2A-WORKING-SET
            OR PSET2A-EVENT-CLOSE-WINDOW
            OR PSET2A-FINISHED

       CALL 'GS' USING PSET2A-1
                       PSET2A-2
                       PSET2A-3
                       PSET2A-4

       EVALUATE TRUE
* ------------------------: Flow control:
*                         : User clicked a panel in another
*                         : working set.
*
         WHEN PSET2A-EVENT-INACTIVATED
           MOVE PSET2A-ACTIVATED-PANEL-NAME TO ACTIVE-PANEL
           MOVE PSET2A-ACTIVATED-WORKING-SET TO ACTIVE-SET

* ------------------------: Flow control:
*                         : User clicked the CONTAINER's "X" box
*                         : (Close the application)
*
         WHEN PSET2A-EVENT-CLOSE-AND-STOP
           SET END-OF-JOB TO TRUE

* ------------------------: Call a subroutine to display another
*                         : popup in this working-set.

         WHEN PSET2A-DISPLAY-MODAL-POPUP
           CALL 'SETX' USING WORKING-SET-DATA

* ------------------------: User pressed the FINISHED button:

         WHEN PSET2A-FINISHED
           CONTINUE

       END-EVALUATE
     END-PERFORM.

     GOBACK.


© 2000-2019 Norcom, all rights reserved 

TOC

Send feedback to Norcom