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

  1. /* This demos how Rexx Dialog updates a window's dimensions string when the
  2.  window is closed. Therefore, if a window is reopened using the same
  3.  dimensions string, it reopens with the same size and position as when it was
  4.  closed. This also demos how you can reopen a window with the same values for
  5.  its Groups if you don't alter the returned RXVAL strings */
  6.  
  7. /* Trap ERROR and FAILURE */
  8. SIGNAL ON ERROR
  9. SIGNAL ON FAILURE
  10.  
  11. /* ================ Create "Spin Group" Dialog ================= */
  12. /* First Group is SPIN */
  13. RXTYPE.1 = 'SPIN'
  14.  
  15. /* Default */
  16. RXFLAGS.1 = ''
  17.  
  18. /* Max, Min, Label for each slider, and groupbox */
  19. RXLABEL.1 = '255 0 Range 1:| 20 10 Range 2:|Try us'
  20.  
  21. /* Values for each slider */
  22. RXVAL.1 = '64 19'
  23.  
  24. /* TotalControls, ControlsPerLine, WidthOfControls */
  25. RXINFO.1 = '2 1 70'
  26.  
  27. /* Position */
  28. RXX.1 = 80
  29. RXY.1 = 18
  30.  
  31. RXWIN1 = '190 104 20 20'
  32.  
  33. RXDLG 1 '"Spin Group"' 'RXWIN1'  'RESULT'
  34.  
  35. /* Do user interaction */
  36. RXDLG
  37.  
  38. /* Display "Spin Group" values */
  39. values = RXVAL.1   /* Copy it so that we don't alter what was returned to us */
  40. DO i = 1 TO 2
  41.    PARSE VAR values knob values
  42.    RXSAY 'Spin #'i' = 'knob
  43. END
  44.  
  45.  
  46.  
  47.  
  48.  
  49. /* ================ Create "Spin Group" Dialog ================= */
  50. /* Create the same dialog again. Leave the dialog's RXWIN1, and the Spin
  51.     Group's RXVAL.1 strings, the same as the previous RXDLG returned. Note
  52.     that the same location and spin values as used as what were returned the
  53.     last time we created this dialog are used now */
  54. RXDLG 1 '"Spin Group"' 'RXWIN1'
  55.  
  56. /* Do user interaction */
  57. RXDLG
  58.  
  59. /* Display "Spin Group" values */
  60. values = RXVAL.1
  61. DO i = 1 TO 2
  62.    PARSE VAR values knob values
  63.    RXSAY 'Spin #'i' = 'knob
  64. END
  65.  
  66.  
  67.  
  68.  
  69.  
  70. /* ========================== Done ========================== */
  71. EXIT
  72.  
  73. FAILURE:
  74.     /* NOTE: the variable RC contains the returned error message (not a number,
  75.     unless we use RXERR to set up Rexx Dialog to return error numbers instead).
  76.     Because we used the default severity level, Rexx Dialog has already displayed
  77.     this error message to the enduser */
  78.     EXIT
  79. ERROR:
  80.     /* NOTE: the variable RC contains the returned error message (not a number,
  81.     unless we use RXERR to set up Rexx Dialog to return error numbers instead).
  82.     Because we used the default severity level, Rexx Dialog has already displayed
  83.     this error message to the enduser */
  84.     EXIT
  85.