home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / ticker.zip / SAMPLE / TICKER.VRX < prev    next >
Text File  |  1995-07-01  |  3KB  |  124 lines

  1. /*:VRX */
  2. /* Custom mainline for EXE */
  3.     call VRMethod "Application", "LoadClassFile", "TICKER"
  4.     call VRMethod "Application", "LoadClassFile", "TICKER.DLL"
  5. /*:VRX Main */
  6. /*  Main
  7. */
  8. Main:
  9. /*  Process the arguments.
  10.     Get the parent window.
  11. */
  12.     parse source . calledAs .
  13.     parent = ""
  14.     argCount = arg()
  15.     argOff = 0
  16.     if( calledAs \= "COMMAND" )then do
  17.         if argCount >= 1 then do
  18.             parent = arg(1)
  19.             argCount = argCount - 1
  20.             argOff = 1
  21.         end
  22.     end; else do
  23.         call VROptions 'ImplicitNames'
  24.     end
  25.     InitArgs.0 = argCount
  26.     if( argCount > 0 )then do i = 1 to argCount
  27.         InitArgs.i = arg( i + argOff )
  28.     end
  29.     drop calledAs argCount argOff
  30.  
  31. /*  Load the windows
  32. */
  33.     call VRInit
  34.     parse source . . spec
  35.     _VREPrimaryWindowPath = ,
  36.         VRParseFileName( spec, "dpn" ) || ".VRW"
  37.     _VREPrimaryWindow = ,
  38.         VRLoad( parent, _VREPrimaryWindowPath )
  39.     drop parent spec
  40.     if( _VREPrimaryWindow == "" )then do
  41.         call VRMessage "", "Cannot load window:" VRError(), ,
  42.             "Error!"
  43.         _VREReturnValue = 32000
  44.         signal _VRELeaveMain
  45.     end
  46.  
  47. /*  Process events
  48. */
  49.     call Init
  50.     signal on halt
  51.     do while( \ VRGet( _VREPrimaryWindow, "Shutdown" ) )
  52.         _VREEvent = VREvent()
  53.         interpret _VREEvent
  54.     end
  55. _VREHalt:
  56.     _VREReturnValue = Fini()
  57.     call VRDestroy _VREPrimaryWindow
  58. _VRELeaveMain:
  59.     call VRFini
  60. exit _VREReturnValue
  61.  
  62. VRLoadSecondary:
  63.     __vrlsWait = abbrev( 'WAIT', translate(arg(2)), 1 )
  64.     if __vrlsWait then do
  65.         call VRFlush
  66.     end
  67.     __vrlsHWnd = VRLoad( VRWindow(), VRWindowPath(), arg(1) )
  68.     if __vrlsHWnd = '' then signal __vrlsDone
  69.     if __vrlsWait \= 1 then signal __vrlsDone
  70.     call VRSet __vrlsHWnd, 'WindowMode', 'Modal' 
  71.     __vrlsTmp = __vrlsWindows.0
  72.     if( DataType(__vrlsTmp) \= 'NUM' ) then do
  73.         __vrlsTmp = 1
  74.     end
  75.     else do
  76.         __vrlsTmp = __vrlsTmp + 1
  77.     end
  78.     __vrlsWindows.__vrlsTmp = VRWindow( __vrlsHWnd )
  79.     __vrlsWindows.0 = __vrlsTmp
  80.     do while( VRIsValidObject( VRWindow() ) = 1 )
  81.         __vrlsEvent = VREvent()
  82.         interpret __vrlsEvent
  83.     end
  84.     __vrlsTmp = __vrlsWindows.0
  85.     __vrlsWindows.0 = __vrlsTmp - 1
  86.     call VRWindow __vrlsWindows.__vrlsTmp 
  87.     __vrlsHWnd = ''
  88. __vrlsDone:
  89. return __vrlsHWnd
  90.  
  91. /*:VRX Halt */
  92. Halt:
  93.     signal _VREHalt
  94. return
  95.  
  96. /*:VRX Init */
  97. Init:
  98.     window = VRWindow()
  99.     call VRMethod window, "CenterWindow"
  100.     call VRSet window, "Visible", 1
  101.     call VRMethod window, "Activate"
  102.     drop window
  103. return
  104.  
  105. /*:VRX Quit */
  106. Quit:
  107.     window = VRWindow()
  108.     call VRSet window, "Shutdown", 1
  109.     drop window
  110. return
  111.  
  112. /*:VRX Fini */
  113. Fini:
  114.     window = VRWindow()
  115.     call VRSet window, "Visible", 0
  116.     drop window
  117. return 0
  118.  
  119. /*:VRX Window1_Close */
  120. Window1_Close:
  121.     call Quit
  122. return
  123.  
  124.