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

  1. /* Trap ERROR and FAILURE */
  2. SIGNAL ON ERROR
  3. SIGNAL ON FAILURE
  4.  
  5. /* Let's make a window containing 5 different Groups. There will be a
  6.     TEXT group containing a few lines of text. There will be a SLIDER
  7.     group containing 2 sliders. There will be a DROP group containing
  8.     one dropbox. Finally there will be a RESULTBUTTON group
  9.     containing OK and CANCEL buttons. Let's say that we want a
  10.     groupbox around the whole thing. Normally, each group of controls
  11.     has its own groupbox, but by not specifying those, and instead using
  12.     a GROUP control, you can contain different group types inside of a
  13.     single groupbox. Note that the GROUP must precede the other groups
  14.     that it contains, or it will draw over them.
  15. */
  16.  
  17. /* ====================== 'Main Window' ======================= */
  18. /* First Group is GROUP */
  19. RXTYPE.1 = 'GROUP'
  20.  
  21. /* Default */
  22. RXFLAGS.1 = ''
  23.  
  24. /* Label */
  25. RXLABEL.1 = 'Everything'
  26.  
  27. /* Width, Height */
  28. RXINFO.1 = '240 220'
  29.  
  30. /* Position */
  31. RXX.1 = 6
  32. RXY.1 = 6
  33.  
  34.  
  35.  
  36.  
  37.  
  38. /* Second group = SLIDER */
  39. RXTYPE.2 = 'SLIDER'
  40.  
  41. /* Print out value of slider knob as it moves */
  42. RXFLAGS.2 = 'VALUE'
  43.  
  44. /* Range/Detent/Label for each slider. No Groupbox */
  45. RXLABEL.2 = '128 128 Range 1:| 64 0 Range 2:'
  46.  
  47. /* Initial values for slider knobs */
  48. RXVAL.2 = '64 32'
  49.  
  50. /* TotalControls, ControlsPerLine, SizeOfControl */
  51. RXINFO.2 = '2 1 142'
  52.  
  53. /* Position */
  54. RXX.2 = 74
  55. RXY.2 = 18
  56.  
  57.  
  58.  
  59.  
  60.  
  61. /* Third Group is DROP */
  62. RXTYPE.3 = 'DROP'
  63.  
  64. /* Give me index rather than the text for the selected item. If I typed
  65.     in something, not in the droplist, then that text is returned. Also,
  66.     cause RXDLG to return when a control in this Group is used */
  67. RXFLAGS.3 = 'INDEX'
  68.  
  69. /* Labels for each dropbox, and Groupbox. No Groupbox */
  70. RXLABEL.3 = 'Type Here:'
  71.  
  72. /* Stem variable names to fetch the strings for each dropbox in the group */
  73. RXVAL.3 = 'BLORT'
  74.  
  75. /* TotalControls, ControlsPerLine, WidthOfControls */
  76. RXINFO.3 = '1 1 100'
  77.  
  78. /* First List items */
  79. BLORT.1 = 'This is 1'
  80. BLORT.2 = 'This is 2'
  81. BLORT.3 = 'This is 3'
  82. BLORT.4 = 'This is 4'
  83. BLORT.5 = 'This is 5'
  84. BLORT.6 = 'This is 6'
  85. BLORT.7 = 'This is 7'
  86. BLORT.8 = ' '  /* Marks the end of the list */
  87.  
  88. /* Position */
  89. RXX.3 = 85
  90. RXY.3 = 78
  91.  
  92.  
  93.  
  94.  
  95.  
  96. /* Fourth Group is TEXT */
  97. RXTYPE.4 = 'TEXT'
  98.  
  99. /* Center the text */
  100. RXFLAGS.4 = 'CENTER'
  101.  
  102. /* 3 lines of text, no group box */
  103. RXLABEL.4 = 'PLEASE READ!|This is a REXX example of|centered text.'
  104.  
  105. /* TotalPhrases, PhrasesPerLine, WidthOfPhrase, BetweenPhrases */
  106. RXINFO.4 = '3 1 0 0'
  107.  
  108. /* Position */
  109. RXX.4 = 40
  110. RXY.4 = 110
  111.  
  112.  
  113.  
  114.  
  115. /* Fifth group is RESULT */
  116. RXTYPE.5 = 'RESULT'
  117.  
  118. /* Return a 1 for OK, YES, RETRY, ENTER, etc. Return a 1 for
  119.     CANCEL, NO, IGNORE, etc. No need to set 'END' since
  120.     RESULTBUTTON group always causes RXDLG to return */
  121. RXFLAGS.5 = 'BOOL'
  122.  
  123. /* No groupbox */
  124. RXLABEL.5 = ' '
  125.  
  126. /* Give me "Ok" and "Cancel" */
  127. RXINFO.5 = '1 2'
  128.  
  129. /* RXVAL is Irrelevant for RESULTBUTTON */
  130.  
  131. /* Position */
  132. RXX.5 = 60
  133. RXY.5 = 178
  134.  
  135.  
  136.  
  137.  
  138. /* Default size and position (also gives us sizing and max button) */
  139. RXWINMAIN = ' '
  140. /* Present the window. RESULT Flag so that ESC or ENTER causes
  141.   RXDLG to return */
  142. RXDLG 5 '"Main Window"' 'RXWINMAIN' 'RESULT'
  143.  
  144.  
  145.  
  146.  
  147. /* Do user interaction. We sleep until RXDLG returns (ie, when user
  148.     presses ENTER or ESC. We didn't specify 'END' for any
  149.     of the groups, so those won't cause RXDLG to return) */
  150. RXDLG
  151.  
  152.  
  153.  
  154.  
  155. /* We could go through all 5 groups RXVAL strings. For example, here's the
  156.     SLIDER code. Note RXVAL.2 because it's the second group. You get the idea */
  157. /*
  158. DO i = 1 TO 2
  159.    PARSE VAR RXVAL.2 knob RXVAL.2
  160.    RXSAY 'Slider #'i' = 'knob
  161. END
  162. */
  163.  
  164.  
  165.  
  166. /* ========================== Done ========================== */
  167. EXIT
  168.  
  169. FAILURE:
  170.     /* NOTE: the variable RC contains the returned error message (not a number,
  171.     unless we use RXERR to set up Rexx Dialog to return error numbers instead).
  172.     Because we used the default severity level, Rexx Dialog has already displayed
  173.     this error message to the enduser */
  174.     EXIT
  175. ERROR:
  176.     /* NOTE: the variable RC contains the returned error message (not a number,
  177.     unless we use RXERR to set up Rexx Dialog to return error numbers instead).
  178.     Because we used the default severity level, Rexx Dialog has already displayed
  179.     this error message to the enduser */
  180.     EXIT
  181.