home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / vsecom3.zip / WINDOW11.VRX < prev    next >
Text File  |  1994-12-21  |  5KB  |  191 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
  20.     InitArgs.0 = argCount
  21.     if( argCount > 0 )then do i = 1 to argCount
  22.         InitArgs.i = arg( i + argOff )
  23.     end
  24.     drop calledAs argCount argOff
  25.  
  26. /*  Load the windows
  27. */
  28.     call VRInit
  29.     parse source . . spec
  30.     _VREPrimaryWindowPath = ,
  31.         VRParseFileName( spec, "dpn" ) || ".VRW"
  32.     _VREPrimaryWindow = ,
  33.         VRLoad( parent, _VREPrimaryWindowPath )
  34.     drop parent spec
  35.     if( _VREPrimaryWindow == "" )then do
  36.         call VRMessage "", "Cannot load window:" VRError(), ,
  37.             "Error!"
  38.         _VREReturnValue = 32000
  39.         signal _VRELeaveMain
  40.     end
  41.  
  42. /*  Process events
  43. */
  44.     call Init
  45.     signal on halt
  46.     do while( \ VRGet( _VREPrimaryWindow, "Shutdown" ) )
  47.         _VREEvent = VREvent()
  48.         interpret _VREEvent
  49.     end
  50. _VREHalt:
  51.     _VREReturnValue = Fini()
  52.     call VRDestroy _VREPrimaryWindow
  53. _VRELeaveMain:
  54.     call VRFini
  55. exit _VREReturnValue
  56.  
  57. VRLoadSecondary: procedure
  58.     name = arg( 1 )
  59.  
  60.     window = VRLoad( VRWindow(), VRWindowPath(), name )
  61.     call VRMethod window, "CenterWindow"
  62.     call VRSet window, "Visible", 1
  63.     call VRMethod window, "Activate"
  64. return window
  65.  
  66. /*:VRX         Fini
  67. */
  68. Fini:
  69.     window = VRWindow()
  70.     call VRSet window, "Visible", 0
  71.     drop window
  72. return Retcode
  73.  
  74. /*:VRX         Halt
  75. */
  76. Halt:
  77.     signal _VREHalt
  78. return
  79.  
  80. /*:VRX         Init
  81. */
  82. Init:
  83.     ok = VRSet( "EF_1", "Value", InitArgs.2)
  84.     ok = VRSet( "EF_2", "Value", InitArgs.4)
  85.  /*   ok = VRSet( "EF_2", "Value", InitArgs.4)
  86.     ok = VRSet( "EF_7", "Value", InitArgs.3)
  87.     ok = VRSet( "EF_3", "Value", InitArgs.5)
  88.     ok = VRSet( "EF_6", "Value", InitArgs.6) */
  89.  
  90.     if InitArgs.1 = "RENSUB" then do
  91.     ok = VRSet( "Window3", "Caption", "LIBR RENAME SUBLIBRARY")
  92.     ok = VRSet( "EF_2", "Enabled", 1)
  93.     ok = VRSet( "EF_2", "Visible", 1) 
  94.     ok = VRSet( "EF_5", "Value", "NEWSUB") 
  95.     ok = VRSet( "EF_5", "Enabled", 1)
  96.     ok = VRSet( "EF_5", "Visible", 1)    
  97.     ok = VRSet( "EF_3", "Enabled", 0)
  98.     ok = VRSet( "EF_3", "Visible", 0)
  99.     ok = VRSet( "EF_4", "Enabled", 0)
  100.     ok = VRSet( "EF_4", "Visible", 0)
  101.     ok = VRSet( "EF_6", "Enabled", 0)
  102.     ok = VRSet( "EF_6", "Visible", 0)   
  103.     ok = VRSet( "EF_7", "Value", InitArgs.3||"\NEWSUB") 
  104.     end
  105.      if InitArgs.1 = "COPY" then do
  106.     ok = VRSet( "Window3", "Caption", "COPY MEMBER(S) INPUT")
  107.     ok = VRSet( "EF_2", "Enabled", 1)
  108.     ok = VRSet( "EF_2", "Visible", 1)
  109.     ok = VRSet( "EF_5", "Value", "NEWSUB?")
  110.     ok = VRSet( "EF_5", "Enabled", 1)
  111.     ok = VRSet( "EF_5", "Visible", 1)
  112.     ok = VRSet( "EF_3", "Value", "COPYNME?")
  113.     ok = VRSet( "EF_3", "Enabled", 3)
  114.     ok = VRSet( "EF_3", "Visible", 3)
  115.     ok = VRSet( "EF_4", "Value", InitArgs.2)
  116.     ok = VRSet( "EF_4", "Enabled", 4)
  117.     ok = VRSet( "EF_4", "Visible", 4)
  118.     ok = VRSet( "EF_6", "Enabled", 0)
  119.     ok = VRSet( "EF_6", "Visible", 0) 
  120.     ok = VRSet( "EF_7", "Value", InitArgs.3||"\COPYLIST")   
  121.     end
  122.  
  123.     if InitArgs.1 = "RENMEM" then do
  124.     ok = VRSet( "Window3", "Caption", "LIBR RENAME MEMBER")
  125.     ok = VRSet( "EF_2", "Enabled", 1)
  126.     ok = VRSet( "EF_2", "Visible", 1)
  127.     ok = VRSet( "EF_3", "Value", "OLDNAME")
  128.     ok = VRSet( "EF_3", "Enabled", 1)
  129.     ok = VRSet( "EF_3", "Visible", 1)
  130.     ok = VRSet( "EF_4", "Enabled", 0)
  131.     ok = VRSet( "EF_4", "Visible", 0)
  132.     ok = VRSet( "EF_5", "Enabled", 0)
  133.     ok = VRSet( "EF_5", "Visible", 0)
  134.     ok = VRSet( "EF_6", "Value", "NEWNAME")
  135.     ok = VRSet( "EF_6", "Enabled", 1)
  136.     ok = VRSet( "EF_6", "Visible", 1) 
  137.     ok = VRSet( "EF_7", "Value", InitArgs.3||"\NEWMEM")   
  138.     end
  139.  
  140.  /*    if InitArgs.1 = "MEM" then do
  141.     ok = VRSet( "EF_2", "Enabled", 1)
  142.     ok = VRSet( "EF_2", "Visible", 1)
  143.     ok = VRSet( "EF_3", "Enabled", 1)
  144.     ok = VRSet( "EF_3", "Visible", 1)
  145.     end */
  146.     Retcode = ""
  147.  
  148.     window = VRWindow()
  149.     call VRMethod window, "CenterWindow"
  150.     call VRSet window, "Visible", 1
  151.     call VRMethod window, "Activate"
  152.     drop window
  153. return
  154.  
  155. /*:VRX         PB_1_Click
  156. */
  157. PB_1_Click:
  158.     LIBNAME = VRGet( "EF_1", "Value")
  159.     SUBNAME = VRGet( "EF_2", "Value")
  160.     MEMNAME = VRGet( "EF_3", "Value")
  161.     NEWSUB = VRGet( "EF_5", "Value")
  162.     NEWMEM = VRGet( "EF_6", "Value")
  163.     NEWLIB = VRGet( "EF_4", "Value")
  164.     LIBFILE = VRGet( "EF_7", "Value")
  165.     CHKVIEW = VRGet( "CB_1", "Set")
  166.     CHKPRT = VRGet( "CB_2", "Set")
  167.     Retcode = CHKPRT||","||CHKVIEW||","||LIBFILE||","||LIBNAME||","||SUBNAME||","||MEMNAME||","||NEWSUB|| ","||NEWMEM|| ","||NEWLIB
  168.     call Quit
  169. return
  170.  
  171. /*:VRX         PB_2_Click
  172. */
  173. PB_2_Click:
  174.     call Quit
  175. return
  176.  
  177. /*:VRX         Quit
  178. */
  179. Quit:
  180.     window = VRWindow()
  181.     call VRSet window, "Shutdown", 1
  182.     drop window
  183. return
  184.  
  185. /*:VRX         Window3_Close
  186. */
  187. Window3_Close:
  188.     call Quit
  189. return
  190.  
  191.