home *** CD-ROM | disk | FTP | other *** search
/ Delphi 2.0 - Programmer's Utilities Power Pack / Delphi 2.0 Programmer's Utilities Power Pack.iso / e_to_l / itgraph / vb30 / process / process.bas < prev    next >
Encoding:
BASIC Source File  |  1996-09-15  |  2.0 KB  |  90 lines

  1. Option Explicit
  2.  
  3. Global Const BLACK = &H0&
  4. Global Const WHITE = &HFFFFFF
  5. Global Const LTBLUE = &HFFFF00
  6. Global Const YELLOW = &HFFFF&
  7. Global Const RED = &HFF&
  8.  
  9. Sub CenterForm (TGT As Form)
  10.   
  11.   TGT.Left = (Screen.Width - TGT.Width) / 2
  12.   TGT.Top = (Screen.Height - TGT.Height) / 2
  13.   
  14. End Sub
  15.  
  16. Sub DrawChart (TGT As Form)
  17.  
  18.   TGT.ScaleTop = 0
  19.   TGT.ScaleHeight = 100
  20.   TGT.ScaleLeft = 0
  21.   TGT.ScaleWidth = 100
  22.  
  23.   TGT!itgProcess.Top = 0
  24.   TGT!itgProcess.Height = 80
  25.   TGT!itgProcess.Left = 0
  26.   TGT!itgProcess.Width = 100
  27.   
  28.   TGT!itgSubProcess.Top = 0
  29.   TGT!itgSubProcess.Height = 80
  30.   TGT!itgSubProcess.Left = 0
  31.   TGT!itgSubProcess.Width = 100
  32.  
  33.   TGT!lblMessage.Top = 80
  34.   TGT!lblMessage.Height = 20
  35.   TGT!lblMessage.Left = 0
  36.   TGT!lblMessage.Width = 100
  37.  
  38. End Sub
  39.  
  40. Sub Main ()
  41.   On Error GoTo NoFile
  42.   Dim FRM As Form
  43.   Dim Msg$, Cap$, filenum%, temp&
  44.  
  45.   Set FRM = New frmProcess
  46.  
  47.   filenum = 1
  48.   temp = FileLen(App.Path & "\process.itg")
  49.   FRM!itgProcess.LoadFrom = App.Path & "\process.itg"
  50.   
  51.   filenum = 2
  52.   temp = FileLen(App.Path & "\subproc.itg")
  53.   FRM!itgSubProcess.LoadFrom = App.Path & "\subproc.itg"
  54.  
  55.   FRM.Width = 640 * Screen.TwipsPerPixelX
  56.   FRM.Height = 480 * Screen.TwipsPerPixelY
  57.  
  58.   FRM!Pause.Caption = "&Pause"
  59.  
  60.   FRM!timTimer1.Interval = 1000
  61.   FRM!Interval_onesec.Checked = True
  62.   FRM!Interval_twosec.Checked = False
  63.   FRM!Interval_foursec.Checked = False
  64.   
  65.   FRM!lblMessage = ""
  66.   FRM!timTimer1.Enabled = False
  67.   FRM!itgSubProcess.Visible = False
  68.  
  69.   Call CenterForm(FRM)
  70.   Call DrawChart(FRM)
  71.   
  72.   FRM.Show
  73.   Exit Sub
  74.  
  75. NoFile:
  76.   Cap = "MISSING GRAPH FILE"
  77.   Msg = "Unable to locate the file"
  78.   If filenum = 1 Then
  79.     Msg = Msg & " ""process.itg,"" "
  80.   Else
  81.     Msg = Msg & " ""subproc.itg,"" "
  82.   End If
  83.   Msg = Msg & "which is required for this demonstration program.  Please load this file "
  84.   Msg = Msg & "into the same directory as this demonstration program's ""*.exe"" file."
  85.   MsgBox Msg, 48, Cap
  86.   End
  87.  
  88. End Sub
  89.  
  90.