home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / ku.zip / CINFO.VRM < prev    next >
Text File  |  1993-10-26  |  3KB  |  122 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 VRSet "DT_2", "Caption", "Total bytes are" VrDiskInfo(t,"c:") 
  45. call VRSet "DT_3", "Caption", "There are" VrDiskInfo(F,"c:") "bytes free"
  46. call VRSet "DT_4", "Caption", VRDir( "c:*.*", "NS", "d")
  47.  
  48.     call Init
  49.     signal on halt
  50.     do while( \ VRGet( _VREPrimaryWindow, "Shutdown" ) )
  51.         _VREEvent = VREvent()
  52.         interpret _VREEvent
  53.     end
  54. _VREHalt:
  55.     _VREReturnValue = Fini()
  56.     call VRDestroy _VREPrimaryWindow
  57. _VRELeaveMain:
  58.     call VRFini
  59. exit _VREReturnValue
  60.  
  61. VRLoadSecondary: procedure
  62.     name = arg( 1 )
  63.  
  64.     window = VRLoad( VRWindow(), VRWindowPath(), name )
  65.     call VRMethod window, "CenterWindow"
  66.     call VRSet window, "Visible", 1
  67.     call VRMethod window, "Activate"
  68. return window
  69.  
  70. /*:VRX         Fini
  71. */
  72. Fini:
  73.     window = VRWindow()
  74.     call VRSet window, "Visible", 0
  75.     drop window
  76. return 0
  77.  
  78. /*:VRX         Halt
  79. */
  80. Halt:
  81.     signal _VREHalt
  82. return
  83.  
  84. /*:VRX         Init
  85. */
  86. Init:
  87.     window = VRWindow()
  88.     call VRMethod window, "CenterWindow"
  89.     call VRSet window, "Visible", 1
  90.     call VRMethod window, "Activate"
  91.     drop window
  92. return
  93.  
  94. /*:VRX         PB_1_Click
  95. */
  96. PB_1_Click:
  97. exit
  98.  
  99.  
  100. /*:VRX         PB_2_Click
  101. */
  102. PB_2_Click:
  103. "cinfo.bat"
  104. ok = VRMessage( ainfo, "Disk function has been run, the disk is OK!", "Check Disk", Warning)
  105.  
  106. return
  107.  
  108. /*:VRX         Quit
  109. */
  110. Quit:
  111.     window = VRWindow()
  112.     call VRSet window, "Shutdown", 1
  113.     drop window
  114. return
  115.  
  116. /*:VRX         Window1_Close
  117. */
  118. Window1_Close:
  119.     call Quit
  120. return
  121.  
  122.