home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / rxdlg11.zip / rexxset6.cmd < prev    next >
OS/2 REXX Batch file  |  1995-03-01  |  3KB  |  94 lines

  1. /* This creates a Main Window with a Group of 1 multiple-select LIST with the
  2.    END flag set.  Whenever the user makes a selection in the LIST, RXDLG
  3.    returns, and if the user selected the 'all' item, we force all items to be
  4.    selected.  If the user selected the 'none' item, we force all items to be
  5.    deselected.
  6. */
  7.  
  8. /* Trap ERROR and FAILURE */
  9. SIGNAL ON ERROR
  10. SIGNAL ON FAILURE
  11.  
  12. /* =============== Create "Main Window" ================= */
  13. /* First Group is LIST */
  14. RXTYPE.1 = 'LIST'
  15.  
  16. /* Use of a control in this group causes RXDLG to return */
  17. RXFLAGS.1 = 'END|MULTIPLE'
  18.  
  19. /* Label for control. No Groupbox */
  20. RXLABEL.1 = ' '
  21.  
  22. /* TotalControls, ControlsPerLine, WidthOfControls */
  23. RXINFO.1 = '1 1 90 6'
  24.  
  25. /* REXX variable where initial text stored */
  26. RXVAL.1 = 'STRS'
  27.  
  28. /* Position */
  29. RXX.1 = 10
  30. RXY.1 = 10
  31.  
  32. /* Text */
  33. STRS.1 = 'all'
  34. STRS.2 = 'none'
  35. STRS.3 = 'something'
  36. STRS.4 = 'more'
  37. STRS.5 = 'more stuff'
  38. STRS.6 = ' '
  39.  
  40. /* Default size and position (also gives us sizing and max button) */
  41. RXWIN1 = ''
  42.  
  43. /* NOCLOSE since we want to close the window ourselves.
  44.     No RESULT Flag, so the ESC and ENTER keys do nothing, and we don't
  45.     have to bother checking for those */
  46. RXDLG 1 '"Main Window"' 'RXWIN1'  'NOCLOSE'
  47.  
  48. more:
  49.  
  50. /* Do user interaction */
  51. RXDLG
  52.  
  53. /* Did user click upon the CLOSE ICON? If so, then exit */
  54. IF RXID < 0 THEN EXIT
  55.  
  56. /* Since there is only 1 group and 1 control, we know that the LISTBOX caused
  57.    RXDLG to return. Check the selections for the list. If the user selected
  58.    the 'all' item, force all items to be selected.  If the user selected the
  59.    'none' item, then force all items to be deselected.  We placed 'all'
  60.    and 'none' as the first and second items in the list.  So, if either one is
  61.    selected, then it must be the first item returned (ie, first selection).
  62. */
  63.  
  64. /* Did he select at least one item? */
  65. IF STRS.0 > 0 THEN DO
  66.    /* If 'all' or 'none' were selected, then either one must be the first
  67.      selected item. So, just check the first returned item */
  68.    IF STRS.0.1 = 'all' THEN DO
  69.        RXSAY 'Selecting all...'
  70.        RXSET '""' 1 1 'VAL' '|' 1
  71.    END
  72.  
  73.    IF STRS.0.1 = 'none' THEN DO
  74.        RXSAY 'Deselecting all...'
  75.        RXSET '""' 1 1 'VAL' '|' 0
  76.    END
  77. END
  78.  
  79. SIGNAL more
  80.  
  81. /* ==================================================== */
  82. FAILURE:
  83.     /* NOTE: the variable RC contains the returned error message (not a number,
  84.     unless we use RXERR to set up Rexx Dialog to return error numbers instead).
  85.     Because we used the default severity level, Rexx Dialog has already displayed
  86.     this error message to the enduser */
  87.     EXIT
  88. ERROR:
  89.     /* NOTE: the variable RC contains the returned error message (not a number,
  90.     unless we use RXERR to set up Rexx Dialog to return error numbers instead).
  91.     Because we used the default severity level, Rexx Dialog has already displayed
  92.     this error message to the enduser */
  93.     EXIT
  94.