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