GUI ScreenIO for Windows

 ScreenIO.com


How to Use Selector Controls in Your Program

A selector control acts like a combination of an edit control and a pushbutton.

When the user presses a selector control, GUI ScreenIO will return to your program, and the reason for the return will be found in the event ID field. 

You test this by evaluating the 88 level items beneath the event ID field, same as for any other event.

The name of the 88 level item for your selector event is its COBOL field name with a suffix of -S.

Here's a portion of the panel copybook showing how the event ID field is defined for the selector control named SELECTOR1.

  01  panel-1.
        .
        .
*                  :---------------------------------------
*                  : Events returned in response to menu
*                  : or toolbar selections, buttons, etc.
*                  :---------------------------------------
        10 panel-EVENT-ID       PIC S9(4) COMP-5 VALUE 0.
           .
           .
          88 SELECTOR1-S        VALUE 6001.

The label of the selector control is the data you load to it in its definition in the panel-4 area.  Note that it includes the VALUE clause we specified when we created this control:

 01 panel-4.
      .
      .
     05 SELECTOR1     PIC X(10) VALUE 'Push Me!'.

To load data to the control for display is simple:

     MOVE mydata TO SELECTOR1.

Here's how you test for the event returned by pressing SELECTOR1.  It's done exactly as you would for any other event. 

        PERFORM WITH TEST AFTER
            UNTIL panel-EVENT-CLOSE-WINDOW 
            OR panel-EVENT-CLOSE-AND-STOP
   * ------------------------: Display the test panel.
            CALL 'GS' USING panel-1 
                            panel-2
                            panel-3
                            panel-4
          EVALUATE TRUE
   *                         : User pressed SELECTOR1
            WHEN SELECTOR1-S
              PERFORM SELECTOR-1-ROUTINE

          END-EVALUATE
        END-PERFORM.

Related topics:


© 2000-2019 Norcom, all rights reserved 

TOC

Send feedback to Norcom