home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / vsecom3.zip / WINDOW1.VRX < prev    next >
Text File  |  1994-12-23  |  4KB  |  168 lines

  1. /*:VRX         Main
  2. */
  3. /*  Main
  4. */
  5. Main:
  6. /*  Process the arguments.
  7.     Get the parent window.
  8. */
  9.     parse source . calledAs .
  10.     parent = ""
  11.     argCount = arg()
  12.     argOff = 0
  13.     if( calledAs \= "COMMAND" )then do
  14.         if argCount >= 1 then do
  15.             parent = arg(1)
  16.             argCount = argCount - 1
  17.             argOff = 1
  18.         end
  19.     end; else do
  20.         call VROptions 'ImplicitNames'
  21.     end
  22.     InitArgs.0 = argCount
  23.     if( argCount > 0 )then do i = 1 to argCount
  24.         InitArgs.i = arg( i + argOff )
  25.     end
  26.     drop calledAs argCount argOff
  27.  
  28. /*  Load the windows
  29. */
  30.     call VRInit
  31.     parse source . . spec
  32.     _VREPrimaryWindowPath = ,
  33.         VRParseFileName( spec, "dpn" ) || ".VRW"
  34.     _VREPrimaryWindow = ,
  35.         VRLoad( parent, _VREPrimaryWindowPath )
  36.     drop parent spec
  37.     if( _VREPrimaryWindow == "" )then do
  38.         call VRMessage "", "Cannot load window:" VRError(), ,
  39.             "Error!"
  40.         _VREReturnValue = 32000
  41.         signal _VRELeaveMain
  42.     end
  43.  
  44. /*  Process events
  45. */
  46.     call Init
  47.     signal on halt
  48.     do while( \ VRGet( _VREPrimaryWindow, "Shutdown" ) )
  49.         _VREEvent = VREvent()
  50.         interpret _VREEvent
  51.     end
  52. _VREHalt:
  53.     _VREReturnValue = Fini()
  54.     call VRDestroy _VREPrimaryWindow
  55. _VRELeaveMain:
  56.     call VRFini
  57. exit _VREReturnValue
  58.  
  59. VRLoadSecondary:
  60.     __vrlsWait = abbrev( 'WAIT', translate(arg(2)), 1 )
  61.     if __vrlsWait then do
  62.         call VRFlush
  63.     end
  64.     __vrlsHWnd = VRLoad( VRWindow(), VRWindowPath(), arg(1) )
  65.     if __vrlsHWnd = '' then signal __vrlsDone
  66.     if __vrlsWait \= 1 then signal __vrlsDone
  67.     call VRSet __vrlsHWnd, 'WindowMode', 'Modal' 
  68.     __vrlsTmp = __vrlsWindows.0
  69.     if( DataType(__vrlsTmp) \= 'NUM' ) then do
  70.         __vrlsTmp = 1
  71.     end
  72.     else do
  73.         __vrlsTmp = __vrlsTmp + 1
  74.     end
  75.     __vrlsWindows.__vrlsTmp = VRWindow( __vrlsHWnd )
  76.     __vrlsWindows.0 = __vrlsTmp
  77.     do while( VRIsValidObject( VRWindow() ) = 1 )
  78.         __vrlsEvent = VREvent()
  79.         interpret __vrlsEvent
  80.     end
  81.     __vrlsTmp = __vrlsWindows.0
  82.     __vrlsWindows.0 = __vrlsTmp - 1
  83.     call VRWindow __vrlsWindows.__vrlsTmp 
  84.     __vrlsHWnd = ''
  85. __vrlsDone:
  86. return __vrlsHWnd
  87.  
  88. /*:VRX         Fini
  89. */
  90. Fini:
  91.     window = VRWindow()
  92.     call VRSet window, "Visible", 0
  93.     drop window
  94. return 0
  95.  
  96. /*:VRX         Halt
  97. */
  98. Halt:
  99.     signal _VREHalt
  100. return
  101.  
  102. /*:VRX         Init
  103. */
  104. Init:
  105.  /* THIS PICKS UP THE DEFAULT VALUES AT STARTUP   */
  106. Myfile = "C:\vsecom\vsecom.ini"
  107.        LINEIN(Myfile,1,0)
  108.     TOSS=LINEIN(Myfile)
  109.     LIBO=LINEIN(Myfile)
  110.     JCLS=LINEIN(Myfile)
  111.     SOUS=LINEIN(Myfile)
  112.     JOBS=LINEIN(Myfile)
  113.     PWRO=LINEIN(Myfile)
  114.     LIB=LINEIN(Myfile)
  115.     SUB=LINEIN(Myfile)
  116.     PRTO=LINEIN(Myfile)
  117.         x = stream(Myfile,'c','close')
  118.  
  119.     call RxFuncAdd 'SysSleep' , 'RexxUtil' , 'SysSleep' 
  120.     window = VRWindow()
  121.    /* call VRMethod window, "CenterWindow" */
  122.     call VRSet window, "LEFT", 100
  123.     call VRSet window, "TOP", 100
  124.     call VRSet window, "Visible", 1
  125.     call VRMethod window, "Activate"
  126.     drop window
  127.     return
  128.  
  129. /*:VRX         PB_1_Click
  130. */
  131. PB_1_Click: 
  132. values = Window2( VRWindow(),LIBO,LIB,SUB,PRTO)
  133. return
  134.  
  135. /*:VRX         PB_2_Click
  136. */
  137. PB_2_Click: 
  138. values = Window3( VRWindow(),JCLS,JOBS,PRTO)
  139. return
  140.  
  141. /*:VRX         PB_4_Click
  142. */
  143. PB_4_Click: 
  144. values = Window5( VRWindow(),PWRO,PRTO)
  145. return
  146.  
  147. /*:VRX         PB_6_Click
  148. */
  149. PB_6_Click: 
  150. values = Window7( VRWindow(),LIBO,JCLS,JOBS,SOUS,PWRO,LIB,SUB,PRTO)
  151. parse var values LIBO "," JCLS "," JOBS "," SOUS "," PWRO "," LIB "," SUB "," PRTO
  152. return
  153.  
  154. /*:VRX         Quit
  155. */
  156. Quit:
  157.     window = VRWindow()
  158.     call VRSet window, "Shutdown", 1
  159.     drop window
  160. return
  161.  
  162. /*:VRX         Window1_Close
  163. */
  164. Window1_Close:
  165.     call Quit
  166. return
  167.  
  168.