home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / vxcliser.zip / VRCS.3 / CHTSAMP / MINICLIK / MINICLIK.VRX < prev    next >
Text File  |  1994-12-23  |  4KB  |  177 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.     /* Destroy the window
  70.     */
  71.  
  72.     window = VRWindow()
  73.     call VRSet window, "Visible", 0
  74.     drop window
  75. return 0
  76.  
  77. /*:VRX         Halt
  78. */
  79. Halt:
  80.     signal _VREHalt
  81. return
  82.  
  83. /*:VRX         Init
  84. */
  85. Init:
  86.     /* Create the window
  87.     */
  88.  
  89.     window = VRWindow()
  90.     call VRMethod window, "CenterWindow"
  91.     call VRSet window, "Visible", 1
  92.     call VRMethod window, "Activate"
  93.     drop window
  94. return
  95.  
  96. /*:VRX         MI_ProdInfo_Click
  97. */
  98. MI_ProdInfo_Click:
  99.     /* The product information is displayed with a multi-line 
  100.        message dialog.
  101.     */
  102.  
  103.     buttons.0 = 1
  104.     buttons.1 = "Ok"
  105.     
  106.     message.0 = 4
  107.     message.1 = "Chart Mini Click Sample"
  108.     message.2 = ""
  109.     message.3 = "This sample application shows a simple"
  110.     message.4 = "way to handle chart events."
  111.  
  112.     call VRMessageStem VRWindow(), "message.", ,
  113.         "Product Information", "I", "buttons.", 1, 1    
  114. return
  115.  
  116. /*:VRX         ParseEvent
  117. */
  118. ParseEvent:
  119.     /* Update the event information
  120.     */
  121.  
  122.     event = VRInfo( "E" )
  123.     item = VRInfo( "Item" )
  124.  
  125.     parse var item region'.'group'.'row'.'col
  126.     call VRSet "DT_Event", "Caption", event
  127.     call VRSet "DT_Region", "Caption", region
  128.     call VRSet "DT_Group", "Caption", group
  129.     call VRSet "DT_Row", "Caption", row
  130.     call VRSet "DT_Column", "Caption", col
  131. return
  132.  
  133. /*:VRX         Quit
  134. */
  135. Quit:
  136.     /* Close the application    
  137.     */
  138.  
  139.     window = VRWindow()
  140.     call VRSet window, "Shutdown", 1
  141.     drop window
  142. return
  143.  
  144. /*:VRX         WC_1_Click
  145. */
  146. WC_1_Click:
  147.     /* Update the event information
  148.     */
  149.  
  150.     call ParseEvent
  151. return
  152.  
  153. /*:VRX         WC_1_ContextMenu
  154. */
  155. WC_1_ContextMenu:
  156.     /* Update the event information
  157.     */
  158.  
  159.     call ParseEvent
  160. return
  161.  
  162. /*:VRX         WC_1_DoubleClick
  163. */
  164. WC_1_DoubleClick:
  165.     /* Update the event information
  166.     */
  167.  
  168.     call ParseEvent
  169. return
  170.  
  171. /*:VRX         Window1_Close
  172. */
  173. Window1_Close:
  174.     call Quit
  175. return
  176.  
  177.