home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 8 Other / 08-Other.zip / vse-esa.zip / WINDOW3.VRX < prev    next >
Text File  |  1994-04-22  |  5KB  |  187 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_4", "Value", InitArgs.2)
  85.     ok = VRSet( "EF_2", "Value", InitArgs.3)
  86.     ok = VRSet( "EF_5", "Value", InitArgs.3)
  87.     ok = VRSet( "EF_3", "Value", InitArgs.5)
  88.     ok = VRSet( "EF_6", "Value", InitArgs.6)
  89.  
  90.   /*  if InitArgs.1 = "LIB" then do
  91.     ok = VRSet( "EF_2", "Enabled", 0)
  92.     ok = VRSet( "EF_2", "Visible", 0)
  93.     ok = VRSet( "EF_3", "Enabled", 0)
  94.     ok = VRSet( "EF_3", "Visible", 0)
  95.     end */
  96.     if InitArgs.1 = "RENSUB" then do
  97.     ok = VRSet( "Window3", "Caption", "RENAME SUBLIBRARY INPUT")
  98.     ok = VRSet( "EF_2", "Enabled", 1)
  99.     ok = VRSet( "EF_2", "Visible", 1)
  100.     ok = VRSet( "EF_5", "Enabled", 1)
  101.     ok = VRSet( "EF_5", "Visible", 1)
  102.     ok = VRSet( "EF_3", "Enabled", 0)
  103.     ok = VRSet( "EF_3", "Visible", 0)
  104.     ok = VRSet( "EF_4", "Enabled", 0)
  105.     ok = VRSet( "EF_4", "Visible", 0)
  106.     ok = VRSet( "EF_6", "Enabled", 0)
  107.     ok = VRSet( "EF_6", "Visible", 0)    
  108.     end
  109.      if InitArgs.1 = "COPY" then do
  110.     ok = VRSet( "Window3", "Caption", "COPY MEMBER(S) INPUT")
  111.     ok = VRSet( "EF_2", "Enabled", 1)
  112.     ok = VRSet( "EF_2", "Visible", 1)
  113.     ok = VRSet( "EF_5", "Enabled", 1)
  114.     ok = VRSet( "EF_5", "Visible", 1)
  115.     ok = VRSet( "EF_3", "Enabled", 3)
  116.     ok = VRSet( "EF_3", "Visible", 3)
  117.     ok = VRSet( "EF_4", "Enabled", 4)
  118.     ok = VRSet( "EF_4", "Visible", 4)
  119.     ok = VRSet( "EF_6", "Enabled", 0)
  120.     ok = VRSet( "EF_6", "Visible", 0)    
  121.     end
  122.     if InitArgs.1 = "RENMEM" then do
  123.     ok = VRSet( "Window3", "Caption", "RENAME MEMBER INPUT")
  124.     ok = VRSet( "EF_2", "Enabled", 1)
  125.     ok = VRSet( "EF_2", "Visible", 1)
  126.     ok = VRSet( "EF_3", "Enabled", 1)
  127.     ok = VRSet( "EF_3", "Visible", 1)
  128.     ok = VRSet( "EF_4", "Enabled", 0)
  129.     ok = VRSet( "EF_4", "Visible", 0)
  130.     ok = VRSet( "EF_5", "Enabled", 0)
  131.     ok = VRSet( "EF_5", "Visible", 0)
  132.     ok = VRSet( "EF_6", "Enabled", 1)
  133.     ok = VRSet( "EF_6", "Visible", 1)    
  134.     end
  135.  
  136.  /*    if InitArgs.1 = "MEM" then do
  137.     ok = VRSet( "EF_2", "Enabled", 1)
  138.     ok = VRSet( "EF_2", "Visible", 1)
  139.     ok = VRSet( "EF_3", "Enabled", 1)
  140.     ok = VRSet( "EF_3", "Visible", 1)
  141.     end */
  142.     Retcode = ""
  143.  
  144.     window = VRWindow()
  145.     call VRMethod window, "CenterWindow"
  146.     call VRSet window, "Visible", 1
  147.     call VRMethod window, "Activate"
  148.     drop window
  149. return
  150.  
  151. /*:VRX         PB_1_Click
  152. */
  153. PB_1_Click:
  154.     LIBNAME = VRGet( "EF_1", "Value")
  155.     SUBNAME = VRGet( "EF_2", "Value")
  156.     MEMNAME = VRGet( "EF_3", "Value")
  157.     NEWSUB = VRGet( "EF_5", "Value")
  158.     NEWMEM = VRGet( "EF_6", "Value")
  159.     NEWLIB = VRGet( "EF_4", "Value")
  160.     LIBFILE = VRGet( "EF_7", "Value")
  161.     CHKVIEW = VRGet( "CB_1", "Set")
  162.     CHKPRT = VRGet( "CB_2", "Set")
  163.     Retcode = CHKPRT||","||CHKVIEW||","||LIBFILE||","||LIBNAME||","||SUBNAME||","||MEMNAME||","||NEWSUB|| ","||NEWMEM|| ","||NEWLIB
  164.     call Quit
  165. return
  166.  
  167. /*:VRX         PB_2_Click
  168. */
  169. PB_2_Click:
  170.     call Quit
  171. return
  172.  
  173. /*:VRX         Quit
  174. */
  175. Quit:
  176.     window = VRWindow()
  177.     call VRSet window, "Shutdown", 1
  178.     drop window
  179. return
  180.  
  181. /*:VRX         Window3_Close
  182. */
  183. Window3_Close:
  184.     call Quit
  185. return
  186.  
  187.