GUI ScreenIO for Windows

 ScreenIO.com


GUI ScreenIO programming

The GUI ScreenIO runtime does everything necessary to display your panels in Windows. 

Windows programming doesn't need to be difficult

Because GUI ScreenIO handles all of the low-level details of Windows programming, you don't need to deal with them; in fact, you can develop true Windows applications without knowing anything about the technical side of the Windows programming interface, other than being familiar with how Windows applications should look and feel to the end-user. 

Furthermore, a large percentage of the GUI ScreenIO development effort was directed toward making the programming interface for GUI ScreenIO simple, intuitive, and very COBOL-friendly (which was easier because GUI ScreenIO itself is entirely written in COBOL).

Consistent programming interface

Regardless of whether you're displaying a main panel, a base panel, a popup, a property sheet, or a wizard, the programming is identical.  To display your panel, simply call the GUI ScreenIO runtime subroutine, like this:

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

...where panel-1 through panel-4 are the four arguments of your panel definition, created by the panel editor. 

All panels have four arguments in their definition, and all panels, regardless of type, are handled the same way in your program.  Everything needed to handle a panel resides in the panel's copybook.  And we mean, everything

Events

When something of interest to your program (an event) occurs, GUI ScreenIO returns to your program.  Events are caused when the user presses a button, selects an item from a menu, or does something else that your program wants to know about.

The data from the fields on your panel will be updated in the panel's copybook, along with information about why GUI ScreenIO returned to your program. 

You'll find that using GUI ScreenIO is conceptually similar to performing record-oriented I/O to a file, except it's simpler.

88-level based programming interface

All of the data needed to run your panel is contained in the panel copybook; you don't need to copy any other data or tables into your program, nor do you need to memorize values you need to use to cause the behavior you want.

You shouldn't need a manual to use most features of GUI ScreenIO

Even though our original character-mode ScreenIO (released in 1985) was extremely easy to use, you still needed to refer to the manual occasionally to see how to do some things.  This inevitably led to unnecessary calls for technical support when a customer lost or misplaced the programming manual.  Some of the questions were so common that we even knew the page number of the manual! 

The most common one was, "How do I display a panel and cause the screen manager to immediately return to my program without user interaction?" 

You did it like this:

     MOVE "O" to panel-DISPLAY-OPTION

Of course, the problem was that you needed to know which value ("O") to move to panel-DISPLAY-OPTION.  If you didn't have the manual, you were out of luck and had to give us a call.  This wasted everyone's time.

We were determined to eliminate this problem when we designed GUI ScreenIO.  So, we defined all of the values you need for controlling GUI ScreenIO as COBOL 88-level items.  To cause GUI ScreenIO to display a panel and immediately return to your program, you just set the (obviously named) 88-level item to TRUE, like this:

     SET panel-DO-DISPLAY-AND-RETURN TO TRUE

Besides making programming simpler and more readable, this saves memory because your compiler doesn't generate code for 88-level definitions if your program doesn't refer to them!

88-level example

Here's an example from a panel copybook.  The names assigned to events are always prefaced by the panel name so that they are unique; this eliminates problems if a program contains more than one panel.

In this portion of code, you can see that all of the possible conditions that can cause GUI ScreenIO to return to your program are explicitly defined as 88-level values in your copybook. 

*                         :---------------------------------------
* ------------------------: Events returned in response to menu
*                         : or toolbar selections, buttons, etc.
*                         :---------------------------------------

       10  panel-EVENT-ID                 PIC S9(4) COMP-5.
         88  panel-EVENT-AUTO-RETURN      VALUE 0.
         88  panel-EVENT-INACTIVATED      VALUE 8901.
         88  panel-EVENT-ACTIVATED        VALUE 8900.
         88  panel-EVENT-CLOSE-WINDOW     VALUE 8003.
         88  panel-EVENT-CLOSE-AND-STOP   VALUE 8010.
         88  panel-MY-PUSHBUTTON          VALUE 1.

Likewise, switches that cause GUI ScreenIO to behave in a certain way are also coded as 88-level items in the panel copybook, as shown below:

*                        :---------------------------------------
*                        : Instructions for panel display:
*                        :---------------------------------------

       10 panel-DISPLAY-OPTION PIC S9(4) COMP-5 VALUE 0.

*                        : This will display & await user input.

         88 panel-DO-DISPLAY              VALUE 0.

*                        : All of the following immediately
*                        : return with an EVENT-AUTO-RETURN.

         88 panel-DO-DISPLAY-AND-RETURN   VALUE 1.
         88 panel-DO-CLOSE                VALUE 2.
         88 panel-DO-MINIMIZE             VALUE 3.
         88 panel-DO-MAXIMIZE             VALUE 4.
         88 panel-DO-RESTORE              VALUE 5.
         88 panel-DO-ACTIVATE             VALUE 6.
         88 panel-DO-UPDATE-MENU-ITEMS    VALUE 08.
         88 panel-DO-CHANGE-LANGUAGE      VALUE 30.

If you want to display your panel and have it return immediately to your program without the need for user interaction (as, for example, when you're updating a record count or progress bar showing that your program is working on a long task), you'd do it like this:

     SET panel-DO-DISPLAY-AND-RETURN TO TRUE

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

It seems so obvious now, you have to wonder why more COBOL applications aren't designed around 88-level items.  It sure makes them easier to use.


© 2000-2019 Norcom, all rights reserved 

TOC

Send feedback to Norcom