home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / mtchprps.zip / MtchPrps.VRM < prev    next >
Text File  |  1995-10-04  |  5KB  |  201 lines

  1. /* Custom mainline for macro */
  2.  
  3.     call RXFuncAdd "VRLoadFuncs", "VROBJ", "VRLoadFuncs"
  4.     call VRLoadFuncs
  5.  
  6.     _VREVersion = SubWord( VRVersion( "VRObj" ), 1, 1 )
  7.     if( _VREVersion < 2.13 )then do
  8.         call VRMessage "", "This program requires VX-REXX version 2.1c to run.", "Error!"
  9.         return 32000
  10.     end
  11.  
  12.  
  13.     signal on SYNTAX name _VRESyntax
  14.     signal _VREMain
  15.  
  16. _VRESyntax:
  17.     parse source . . _VRESourceSpec
  18.     call VRMessage "", "Syntax error in" _VRESourceSpec "line" SIGL":" ErrorText(rc), "Error!"
  19.     call VRFini
  20.     exit 32000
  21.  
  22. _VREMain:
  23. /*:VRX         Main
  24. */
  25. /*  Main
  26. */
  27. Main:
  28. /*  Process the arguments.
  29.     Get the parent window.
  30. */
  31.     parse source . calledAs .
  32.     parse arg , obj, editwin
  33.     call VRMethod editwin, "GetSelectedRoots", "stem."
  34.     parent = ""
  35.     argCount = arg()
  36.     argOff = 0
  37.     if( calledAs \= "COMMAND" )then do
  38.         if argCount >= 1 then do
  39.             parent = arg(1)
  40.             argCount = argCount - 1
  41.             argOff = 1
  42.         end
  43.     end; else do
  44.         call VROptions 'ImplicitNames'
  45.         call VROptions 'NoEchoQuit'
  46.     end
  47.     InitArgs.0 = argCount
  48.     if( argCount > 0 )then do i = 1 to argCount
  49.         InitArgs.i = arg( i + argOff )
  50.     end
  51.     drop calledAs argCount argOff
  52.  
  53. /*  Load the windows
  54. */
  55.     call VRInit
  56.     parse source . . spec
  57.     _VREPrimaryWindowPath = ,
  58.         VRParseFileName( spec, "dpn" ) || ".VRW"
  59.     _VREPrimaryWindow = ,
  60.         VRLoad( parent, _VREPrimaryWindowPath )
  61.     drop parent spec
  62.     if( _VREPrimaryWindow == "" )then do
  63.         call VRMessage "", "Cannot load window:" VRError(), ,
  64.             "Error!"
  65.         _VREReturnValue = 32000
  66.         signal _VRELeaveMain
  67.     end
  68.  
  69. /*  Process events
  70. */
  71.     call Init
  72.     signal on halt
  73.     do while( \ VRGet( _VREPrimaryWindow, "Shutdown" ) )
  74.         _VREEvent = VREvent()
  75.         interpret _VREEvent
  76.     end
  77. _VREHalt:
  78.     _VREReturnValue = Fini()
  79.     call VRDestroy _VREPrimaryWindow
  80. _VRELeaveMain:
  81.     call VRFini
  82. exit _VREReturnValue
  83.  
  84. VRLoadSecondary:
  85.     __vrlsWait = abbrev( 'WAIT', translate(arg(2)), 1 )
  86.     if __vrlsWait then do
  87.         call VRFlush
  88.     end
  89.     __vrlsHWnd = VRLoad( VRWindow(), VRWindowPath(), arg(1) )
  90.     if __vrlsHWnd = '' then signal __vrlsDone
  91.     if __vrlsWait \= 1 then signal __vrlsDone
  92.     call VRSet __vrlsHWnd, 'WindowMode', 'Modal' 
  93.     __vrlsTmp = __vrlsWindows.0
  94.     if( DataType(__vrlsTmp) \= 'NUM' ) then do
  95.         __vrlsTmp = 1
  96.     end
  97.     else do
  98.         __vrlsTmp = __vrlsTmp + 1
  99.     end
  100.     __vrlsWindows.__vrlsTmp = VRWindow( __vrlsHWnd )
  101.     __vrlsWindows.0 = __vrlsTmp
  102.     do while( VRIsValidObject( VRWindow() ) = 1 )
  103.         __vrlsEvent = VREvent()
  104.         interpret __vrlsEvent
  105.     end
  106.     __vrlsTmp = __vrlsWindows.0
  107.     __vrlsWindows.0 = __vrlsTmp - 1
  108.     call VRWindow __vrlsWindows.__vrlsTmp 
  109.     __vrlsHWnd = ''
  110. __vrlsDone:
  111. return __vrlsHWnd
  112.  
  113. /*:VRX         Fini
  114. */
  115. Fini:
  116.     window = VRWindow()
  117.     call VRSet window, "Visible", 0
  118.     drop window
  119. return 0
  120.  
  121. /*:VRX         Halt
  122. */
  123. Halt:
  124.     signal _VREHalt
  125. return
  126.  
  127. /*:VRX         Init
  128. */
  129. Init:
  130.     window = VRWindow()
  131.     call VRMethod window, "CenterWindow"
  132.     call VRSet window, "Visible", 1
  133.     call VRMethod window, "Activate"
  134.     drop window
  135. return
  136.  
  137. /*:VRX         MtchPrps_Close
  138. */
  139. MtchPrps_Close:
  140.     call Quit
  141. return
  142.  
  143. /*:VRX         PB_1_Click
  144. */
  145. PB_1_Click: 
  146.  set = VRGet( "CB_1", "Set" )
  147.  If set = 1 Then
  148.   do i = 1 to stem.0
  149.    call VRSet stem.i, "ForeColor", VRGet( obj, "ForeColor" ), "BackColor", VRGet( obj, "BackColor" )
  150.   end
  151.  
  152.  set = VRGet( "CB_2", "Set" )
  153.  If set = 1 Then
  154.   do i = 1 to stem.0
  155.    call VRSet stem.i, "Height", VRGet( obj, "Height" ), "Width", VRGet( obj, "Width" )
  156.   end
  157.  
  158.  set = VRGet( "CB_3", "Set" )
  159.  If set = 1 Then
  160.   do i = 1 to stem.0
  161.    call VRSet stem.i, "Caption", VRGet( obj, "Caption" )
  162.   end
  163.  
  164.  set = VRGet( "CB_4", "Set" )
  165.   do i = 1 to stem.0
  166.    call VRSet stem.i, "HelpText", VRGet( obj, "HelpText" )
  167.   end
  168.  
  169.  set = VRGet( "CB_5", "Set" )
  170.   do i = 1 to stem.0
  171.    call VRSet stem.i, "HintText", VRGet( obj, "HintText" )
  172.   end
  173.  
  174.  set = VRGet( "CB_6", "Set" )
  175.   do i = 1 to stem.0
  176.    call VRSet stem.i, "HelpTag", VRGet( obj, "HelpTag" )
  177.   end
  178.  
  179.  set = VRGet( "CB_7", "Set" )
  180.   do i = 1 to stem.0
  181.    call VRSet stem.i, "Font", VRGet( obj, "Font" )
  182.   end
  183.  
  184.  Call Quit
  185. return
  186.  
  187. /*:VRX         PB_2_Click
  188. */
  189. PB_2_Click: 
  190.  Call Quit
  191. return
  192.  
  193. /*:VRX         Quit
  194. */
  195. Quit:
  196.     window = VRWindow()
  197.     call VRSet window, "Shutdown", 1
  198.     drop window
  199. return
  200.  
  201.