home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / vbalyz / frmmain.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-01-05  |  18.3 KB  |  580 lines

  1. VERSION 2.00
  2. Begin Form frmMain 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "VB*Alyzer"
  6.    ClientHeight    =   5865
  7.    ClientLeft      =   1095
  8.    ClientTop       =   8130
  9.    ClientWidth     =   7350
  10.    Height          =   6555
  11.    Icon            =   FRMMAIN.FRX:0000
  12.    Left            =   1035
  13.    LinkTopic       =   "Form1"
  14.    MaxButton       =   0   'False
  15.    ScaleHeight     =   5865
  16.    ScaleWidth      =   7350
  17.    Top             =   7500
  18.    Width           =   7470
  19.    Begin CommonDialog dlg 
  20.       Left            =   7320
  21.       Top             =   5280
  22.    End
  23.    Begin SSFrame frmTab 
  24.       Caption         =   "Metric Options"
  25.       Font3D          =   1  'Raised w/light shading
  26.       ForeColor       =   &H00000000&
  27.       Height          =   5655
  28.       Index           =   2
  29.       Left            =   120
  30.       TabIndex        =   12
  31.       Top             =   120
  32.       Width           =   7095
  33.       Begin SSCommand cmdOptOK 
  34.          Caption         =   "&OK"
  35.          Font3D          =   1  'Raised w/light shading
  36.          ForeColor       =   &H00000000&
  37.          Height          =   495
  38.          Left            =   3960
  39.          RoundedCorners  =   0   'False
  40.          TabIndex        =   35
  41.          Top             =   5040
  42.          Width           =   1455
  43.       End
  44.       Begin SSCheck chkOpt 
  45.          Caption         =   "Check3D1"
  46.          Font3D          =   0  'None
  47.          ForeColor       =   &H00000000&
  48.          Height          =   255
  49.          Index           =   1
  50.          Left            =   240
  51.          TabIndex        =   34
  52.          Top             =   360
  53.          Value           =   -1  'True
  54.          Width           =   3135
  55.       End
  56.       Begin SSCheck chkOpt 
  57.          Caption         =   "Check3D1"
  58.          Font3D          =   0  'None
  59.          ForeColor       =   &H00000000&
  60.          Height          =   255
  61.          Index           =   2
  62.          Left            =   240
  63.          TabIndex        =   33
  64.          Top             =   720
  65.          Value           =   -1  'True
  66.          Width           =   3135
  67.       End
  68.       Begin SSCheck chkOpt 
  69.          Caption         =   "Check3D1"
  70.          Font3D          =   0  'None
  71.          ForeColor       =   &H00000000&
  72.          Height          =   255
  73.          Index           =   3
  74.          Left            =   240
  75.          TabIndex        =   32
  76.          Top             =   1080
  77.          Value           =   -1  'True
  78.          Width           =   3135
  79.       End
  80.       Begin SSCheck chkOpt 
  81.          Caption         =   "Check3D1"
  82.          Font3D          =   0  'None
  83.          ForeColor       =   &H00000000&
  84.          Height          =   255
  85.          Index           =   4
  86.          Left            =   240
  87.          TabIndex        =   31
  88.          Top             =   1440
  89.          Value           =   -1  'True
  90.          Width           =   3135
  91.       End
  92.       Begin SSCheck chkOpt 
  93.          Caption         =   "Check3D1"
  94.          Font3D          =   0  'None
  95.          ForeColor       =   &H00000000&
  96.          Height          =   255
  97.          Index           =   5
  98.          Left            =   240
  99.          TabIndex        =   30
  100.          Top             =   1800
  101.          Value           =   -1  'True
  102.          Width           =   3135
  103.       End
  104.       Begin SSCheck chkOpt 
  105.          Caption         =   "Check3D1"
  106.          Font3D          =   0  'None
  107.          ForeColor       =   &H00000000&
  108.          Height          =   255
  109.          Index           =   6
  110.          Left            =   240
  111.          TabIndex        =   29
  112.          Top             =   2160
  113.          Value           =   -1  'True
  114.          Width           =   3135
  115.       End
  116.       Begin SSCheck chkOpt 
  117.          Caption         =   "Check3D1"
  118.          Font3D          =   0  'None
  119.          ForeColor       =   &H00000000&
  120.          Height          =   255
  121.          Index           =   7
  122.          Left            =   240
  123.          TabIndex        =   28
  124.          Top             =   2520
  125.          Value           =   -1  'True
  126.          Width           =   3135
  127.       End
  128.       Begin SSCheck chkOpt 
  129.          Caption         =   "Check3D1"
  130.          Font3D          =   0  'None
  131.          ForeColor       =   &H00000000&
  132.          Height          =   255
  133.          Index           =   8
  134.          Left            =   240
  135.          TabIndex        =   27
  136.          Top             =   2880
  137.          Value           =   -1  'True
  138.          Width           =   3135
  139.       End
  140.       Begin SSCheck chkOpt 
  141.          Caption         =   "Check3D1"
  142.          Font3D          =   0  'None
  143.          ForeColor       =   &H00000000&
  144.          Height          =   255
  145.          Index           =   9
  146.          Left            =   240
  147.          TabIndex        =   26
  148.          Top             =   3240
  149.          Value           =   -1  'True
  150.          Width           =   3135
  151.       End
  152.       Begin SSCheck chkOpt 
  153.          Caption         =   "Check3D1"
  154.          Font3D          =   0  'None
  155.          ForeColor       =   &H00000000&
  156.          Height          =   255
  157.          Index           =   10
  158.          Left            =   240
  159.          TabIndex        =   25
  160.          Top             =   3600
  161.          Value           =   -1  'True
  162.          Width           =   3135
  163.       End
  164.       Begin SSCheck chkOpt 
  165.          Caption         =   "Check3D1"
  166.          Font3D          =   0  'None
  167.          ForeColor       =   &H00000000&
  168.          Height          =   255
  169.          Index           =   11
  170.          Left            =   3720
  171.          TabIndex        =   24
  172.          Top             =   360
  173.          Value           =   -1  'True
  174.          Width           =   3135
  175.       End
  176.       Begin SSCheck chkOpt 
  177.          Caption         =   "Check3D1"
  178.          Font3D          =   0  'None
  179.          ForeColor       =   &H00000000&
  180.          Height          =   255
  181.          Index           =   12
  182.          Left            =   3720
  183.          TabIndex        =   23
  184.          Top             =   720
  185.          Value           =   -1  'True
  186.          Width           =   3135
  187.       End
  188.       Begin SSCheck chkOpt 
  189.          Caption         =   "Check3D1"
  190.          Font3D          =   0  'None
  191.          ForeColor       =   &H00000000&
  192.          Height          =   255
  193.          Index           =   13
  194.          Left            =   3720
  195.          TabIndex        =   22
  196.          Top             =   1080
  197.          Value           =   -1  'True
  198.          Width           =   3135
  199.       End
  200.       Begin SSCheck chkOpt 
  201.          Caption         =   "Check3D1"
  202.          Font3D          =   0  'None
  203.          ForeColor       =   &H00000000&
  204.          Height          =   255
  205.          Index           =   14
  206.          Left            =   3720
  207.          TabIndex        =   21
  208.          Top             =   1440
  209.          Value           =   -1  'True
  210.          Width           =   3135
  211.       End
  212.       Begin SSCheck chkOpt 
  213.          Caption         =   "Check3D1"
  214.          Font3D          =   0  'None
  215.          ForeColor       =   &H00000000&
  216.          Height          =   255
  217.          Index           =   15
  218.          Left            =   3720
  219.          TabIndex        =   20
  220.          Top             =   1800
  221.          Value           =   -1  'True
  222.          Width           =   3135
  223.       End
  224.       Begin SSCheck chkOpt 
  225.          Caption         =   "Index 0 - DO NOT USE"
  226.          Enabled         =   0   'False
  227.          Font3D          =   0  'None
  228.          ForeColor       =   &H00000000&
  229.          Height          =   255
  230.          Index           =   0
  231.          Left            =   1560
  232.          TabIndex        =   19
  233.          Top             =   3960
  234.          Value           =   -1  'True
  235.          Visible         =   0   'False
  236.          Width           =   3135
  237.       End
  238.       Begin SSCheck chkOpt 
  239.          Caption         =   "Check3D1"
  240.          Font3D          =   0  'None
  241.          ForeColor       =   &H00000000&
  242.          Height          =   255
  243.          Index           =   16
  244.          Left            =   3720
  245.          TabIndex        =   18
  246.          Top             =   2160
  247.          Value           =   -1  'True
  248.          Width           =   3135
  249.       End
  250.       Begin SSCheck chkOpt 
  251.          Caption         =   "Check3D1"
  252.          Font3D          =   0  'None
  253.          ForeColor       =   &H00000000&
  254.          Height          =   255
  255.          Index           =   17
  256.          Left            =   3720
  257.          TabIndex        =   17
  258.          Top             =   2880
  259.          Value           =   -1  'True
  260.          Width           =   3135
  261.       End
  262.       Begin SSCheck chkOpt 
  263.          Caption         =   "Check3D1"
  264.          Font3D          =   0  'None
  265.          ForeColor       =   &H00000000&
  266.          Height          =   255
  267.          Index           =   18
  268.          Left            =   3720
  269.          TabIndex        =   16
  270.          Top             =   2520
  271.          Value           =   -1  'True
  272.          Width           =   3135
  273.       End
  274.       Begin SSCheck chkOpt 
  275.          Caption         =   "Check3D1"
  276.          Font3D          =   0  'None
  277.          ForeColor       =   &H00000000&
  278.          Height          =   255
  279.          Index           =   19
  280.          Left            =   3720
  281.          TabIndex        =   15
  282.          Top             =   3240
  283.          Value           =   -1  'True
  284.          Width           =   3135
  285.       End
  286.       Begin SSCheck chkOpt 
  287.          Caption         =   "Check3D1"
  288.          Font3D          =   0  'None
  289.          ForeColor       =   &H00000000&
  290.          Height          =   255
  291.          Index           =   20
  292.          Left            =   3720
  293.          TabIndex        =   14
  294.          Top             =   3600
  295.          Value           =   -1  'True
  296.          Width           =   3135
  297.       End
  298.       Begin SSCommand cmdExit 
  299.          Caption         =   "E&xit"
  300.          Font3D          =   1  'Raised w/light shading
  301.          ForeColor       =   &H00000000&
  302.          Height          =   495
  303.          Index           =   2
  304.          Left            =   5520
  305.          RoundedCorners  =   0   'False
  306.          TabIndex        =   13
  307.          Top             =   5040
  308.          Width           =   1455
  309.       End
  310.    End
  311.    Begin SSFrame frmTab 
  312.       Caption         =   "Analysis"
  313.       Font3D          =   1  'Raised w/light shading
  314.       ForeColor       =   &H00000000&
  315.       Height          =   5655
  316.       Index           =   1
  317.       Left            =   120
  318.       TabIndex        =   8
  319.       Top             =   120
  320.       Visible         =   0   'False
  321.       Width           =   7095
  322.       Begin SSCommand cmdPrint 
  323.          Caption         =   "&Print"
  324.          Font3D          =   1  'Raised w/light shading
  325.          ForeColor       =   &H00000000&
  326.          Height          =   495
  327.          Left            =   3960
  328.          RoundedCorners  =   0   'False
  329.          TabIndex        =   11
  330.          Top             =   5040
  331.          Width           =   1455
  332.       End
  333.       Begin Grid grdAnal 
  334.          FixedCols       =   0
  335.          FontBold        =   0   'False
  336.          FontItalic      =   0   'False
  337.          FontName        =   "MS Sans Serif"
  338.          FontSize        =   8.25
  339.          FontStrikethru  =   0   'False
  340.          FontUnderline   =   0   'False
  341.          Height          =   4575
  342.          Left            =   240
  343.          TabIndex        =   10
  344.          Top             =   360
  345.          Width           =   6735
  346.       End
  347.       Begin SSCommand cmdExit 
  348.          Caption         =   "E&xit"
  349.          Font3D          =   1  'Raised w/light shading
  350.          ForeColor       =   &H00000000&
  351.          Height          =   495
  352.          Index           =   1
  353.          Left            =   5520
  354.          RoundedCorners  =   0   'False
  355.          TabIndex        =   9
  356.          Top             =   5040
  357.          Width           =   1455
  358.       End
  359.    End
  360.    Begin SSFrame frmTab 
  361.       Caption         =   "Files For Analysis"
  362.       Font3D          =   1  'Raised w/light shading
  363.       ForeColor       =   &H00000000&
  364.       Height          =   5655
  365.       Index           =   0
  366.       Left            =   120
  367.       TabIndex        =   0
  368.       Top             =   120
  369.       Visible         =   0   'False
  370.       Width           =   7095
  371.       Begin ListBox lstFiles 
  372.          Height          =   5100
  373.          Left            =   120
  374.          Sorted          =   -1  'True
  375.          TabIndex        =   7
  376.          Top             =   360
  377.          Width           =   5175
  378.       End
  379.       Begin SSCommand cmdRemove 
  380.          Caption         =   "Remove"
  381.          Font3D          =   1  'Raised w/light shading
  382.          ForeColor       =   &H00000000&
  383.          Height          =   495
  384.          Left            =   5520
  385.          RoundedCorners  =   0   'False
  386.          TabIndex        =   6
  387.          Top             =   3360
  388.          Width           =   1455
  389.       End
  390.       Begin SSCommand cmdReopen 
  391.          Caption         =   "Re-open"
  392.          Enabled         =   0   'False
  393.          Font3D          =   1  'Raised w/light shading
  394.          ForeColor       =   &H00000000&
  395.          Height          =   495
  396.          Left            =   5520
  397.          RoundedCorners  =   0   'False
  398.          TabIndex        =   5
  399.          Top             =   960
  400.          Width           =   1455
  401.       End
  402.       Begin SSCommand cmdOpen 
  403.          Caption         =   "Open..."
  404.          Font3D          =   1  'Raised w/light shading
  405.          ForeColor       =   &H00000000&
  406.          Height          =   495
  407.          Left            =   5520
  408.          RoundedCorners  =   0   'False
  409.          TabIndex        =   4
  410.          Top             =   360
  411.          Width           =   1455
  412.       End
  413.       Begin SSCommand cmdAnalyze 
  414.          Caption         =   "Analyze"
  415.          Enabled         =   0   'False
  416.          Font3D          =   1  'Raised w/light shading
  417.          ForeColor       =   &H00000000&
  418.          Height          =   495
  419.          Left            =   5520
  420.          RoundedCorners  =   0   'False
  421.          TabIndex        =   3
  422.          Top             =   4080
  423.          Width           =   1455
  424.       End
  425.       Begin SSCommand cmdExit 
  426.          Caption         =   "E&xit"
  427.          Font3D          =   1  'Raised w/light shading
  428.          ForeColor       =   &H00000000&
  429.          Height          =   495
  430.          Index           =   0
  431.          Left            =   5520
  432.          RoundedCorners  =   0   'False
  433.          TabIndex        =   2
  434.          Top             =   5040
  435.          Width           =   1455
  436.       End
  437.       Begin SSCommand cmdLocalsOnly 
  438.          Caption         =   "Locals &Only"
  439.          Font3D          =   1  'Raised w/light shading
  440.          ForeColor       =   &H00000000&
  441.          Height          =   495
  442.          Left            =   5520
  443.          RoundedCorners  =   0   'False
  444.          TabIndex        =   1
  445.          Top             =   2160
  446.          Width           =   1455
  447.       End
  448.    End
  449.    Begin Menu mnuFile 
  450.       Caption         =   "&File"
  451.       Begin Menu mnuFileExit 
  452.          Caption         =   "E&xit"
  453.          Shortcut        =   ^X
  454.       End
  455.    End
  456.    Begin Menu mnuFrame 
  457.       Caption         =   "F&rame"
  458.       Begin Menu mnuFrameEntry 
  459.          Caption         =   "&1: Files"
  460.          Index           =   0
  461.          Shortcut        =   ^F
  462.       End
  463.       Begin Menu mnuFrameEntry 
  464.          Caption         =   "&2: Analysis"
  465.          Index           =   1
  466.          Shortcut        =   ^A
  467.       End
  468.       Begin Menu mnuFrameEntry 
  469.          Caption         =   "&3: Options"
  470.          Index           =   2
  471.          Shortcut        =   ^O
  472.       End
  473.    End
  474. Option Explicit
  475. Const FRM_FILES = 0
  476. Const FRM_ANALYSIS = 1
  477. Const FRM_OPTIONS = 2
  478. Sub cmdAnalyze_Click ()
  479.     AnalyzeCurrentProject lstFiles, grdAnal
  480.     SwitchFrameTo FRM_ANALYSIS
  481. End Sub
  482. Sub cmdExit_Click (Index As Integer)
  483.     Terminate
  484.     Unload frmMain
  485.     End
  486. End Sub
  487. Sub cmdLocalsOnly_Click ()
  488. Dim intIdx As Integer
  489.     ' Work through the list, removing anything with a \
  490.     ' Start at the end, because removing items causes the
  491.     ' ListCount to be reduced.
  492.     For intIdx = lstFiles.ListCount - 1 To 0 Step -1
  493.         If InStr(lstFiles.List(intIdx), "\") Then
  494.             lstFiles.RemoveItem intIdx
  495.         End If
  496.     Next
  497. End Sub
  498. Sub cmdOpen_Click ()
  499.     OpenProject lstFiles, dlg
  500.     cmdReopen.Enabled = True
  501.     cmdAnalyze.Enabled = True
  502. End Sub
  503. Sub cmdOptOK_Click ()
  504. Dim i As Integer
  505.     ' Store option values
  506.     For i = 1 To NumMetrics()
  507.         SetMetricDisplay i, chkOpt(i).Value
  508.     Next
  509.     ' Switch to Files tab
  510.     SwitchFrameTo FRM_FILES
  511. End Sub
  512. Sub cmdPrint_Click ()
  513.     PrintResults grdAnal
  514. End Sub
  515. Sub cmdRemove_Click ()
  516.     If lstFiles.ListIndex >= 0 Then
  517.         lstFiles.RemoveItem lstFiles.ListIndex
  518.     End If
  519. End Sub
  520. Sub cmdReopen_Click ()
  521.     ReopenProject lstFiles
  522. End Sub
  523. Sub Form_Load ()
  524.     Initialise
  525.     grdAnal.Rows = 1
  526.     grdAnal.FixedCols = 0
  527.     Me.Show
  528.     DoEvents
  529.     SwitchFrameTo VisibleFrame()
  530.     SetOptions
  531. End Sub
  532. Sub Form_Unload (Cancel As Integer)
  533.     Terminate
  534.     End
  535. End Sub
  536. Sub lstFiles_DblClick ()
  537.     lstFiles.RemoveItem lstFiles.ListIndex
  538. End Sub
  539. Sub mnuFileExit_Click ()
  540.     Unload Me
  541. End Sub
  542. Sub mnuFrameEntry_Click (Index As Integer)
  543.     SwitchFrameTo Index
  544. End Sub
  545. Sub SetOptions ()
  546. Dim intNumOpts As Integer
  547. Dim i As Integer
  548.     intNumOpts = NumMetrics()
  549.     For i = 1 To intNumOpts
  550.         chkOpt(i).Caption = MetricLongName(i)
  551.         chkOpt(i).Value = DisplayMetric(i)
  552.     Next
  553. End Sub
  554. Sub SwitchFrameTo (intNewFrame As Integer)
  555. Static intOldFrame As Integer
  556. Dim i As Integer
  557.     ' handle changes to display options when switching into and
  558.     ' out of the options page...
  559.     If intOldFrame = 2 Then
  560.         For i = 1 To NumMetrics()
  561.             SetMetricDisplay i, chkOpt(i).Value
  562.         Next
  563.     Else
  564.         If intNewFrame = 2 Then
  565.             SetOptions
  566.         End If
  567.     End If
  568.     frmTab(intOldFrame).Visible = False
  569.     intOldFrame = intNewFrame
  570.     frmTab(intNewFrame).Visible = True
  571. End Sub
  572. Function VisibleFrame () As Integer
  573. Dim i
  574.     For i = 0 To 2
  575.         If frmTab(i).Visible Then
  576.             VisibleFrame = i
  577.         End If
  578.     Next
  579. End Function
  580.