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

  1. /* This creates a Main Window with a Group of radio buttons with the END
  2.     flag set.  Whenever the user clicks upon a button, RXDLG returns, and
  3.     we force the next radio button (after the selected button) to be selected.
  4. */
  5.  
  6. /* Trap ERROR and FAILURE */
  7. SIGNAL ON ERROR
  8. SIGNAL ON FAILURE
  9.  
  10. /* =============== Create "Main Window" ================= */
  11. /* First Group is RADIO */
  12. RXTYPE.1 = 'RADIO'
  13.  
  14. /* Use of a control in this group causes RXDLG to return. Also let RXDLG
  15.     label the controls with numbers */
  16. RXFLAGS.1 = 'END|NUMBERED'
  17.  
  18. /* Only need to specify Groupbox (or null string if none) because of NUMBERED */
  19. RXLABEL.1 = 'Pick one'
  20.  
  21. /* TotalControls, ControlsPerLine, WidthOfControls */
  22. RXINFO.1 = '16 4 0'
  23.  
  24. /* Initially select button 1 */
  25. RXVAL.1 = '1'
  26.  
  27. /* Position */
  28. RXX.1 = 7
  29. RXY.1 = 6
  30.  
  31. /* Default size and position (also gives us sizing and max button) */
  32. RXWIN1 = ''
  33.  
  34. /* NOCLOSE since we want to close the window ourselves.
  35.     No RESULT Flag, so the ESC and ENTER keys do nothing, and we don't
  36.     have to bother checking for those */
  37. RXDLG 1 '"Main Window"' 'RXWIN1'  'NOCLOSE'
  38.  
  39. more:
  40.  
  41. /* Do user interaction */
  42. RXDLG
  43.  
  44. /* Did user click upon the CLOSE ICON? If so, then exit */
  45. IF RXID < 0 THEN EXIT
  46.  
  47. /* Since there is only 1 group, we only need to pay attention to RXSUBID.
  48.    It's the number of the selected button.  Since we didn't skip buttons, we
  49.    simply increment this to get the next button #, but check that it isn't over
  50.    16, because we only have 16 buttons
  51. */
  52.  
  53. IF RXSUBID = 16 THEN RXSUBID = 0
  54. RXSET '""' 1 RXSUBID+1 'VAL' 1
  55. SIGNAL more
  56.  
  57. /* ==================================================== */
  58. FAILURE:
  59.     /* NOTE: the variable RC contains the returned error message (not a number,
  60.     unless we use RXERR to set up Rexx Dialog to return error numbers instead).
  61.     Because we used the default severity level, Rexx Dialog has already displayed
  62.     this error message to the enduser */
  63.     EXIT
  64. ERROR:
  65.     /* NOTE: the variable RC contains the returned error message (not a number,
  66.     unless we use RXERR to set up Rexx Dialog to return error numbers instead).
  67.     Because we used the default severity level, Rexx Dialog has already displayed
  68.     this error message to the enduser */
  69.     EXIT
  70.