home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 1998 October / DPPCPRO1098.ISO / Ocx / VCFIMP / VCIMPRES.Z / chartfrm.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-11-01  |  34.1 KB  |  1,099 lines

  1. VERSION 4.00
  2. Begin VB.Form frmMain 
  3.    Caption         =   "First Impression Chart Type Examples"
  4.    ClientHeight    =   5655
  5.    ClientLeft      =   1110
  6.    ClientTop       =   1725
  7.    ClientWidth     =   9495
  8.    Height          =   6405
  9.    Icon            =   "chartfrm.frx":0000
  10.    Left            =   1020
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   5655
  13.    ScaleWidth      =   9495
  14.    Top             =   1065
  15.    Width           =   9675
  16.    Begin VB.Frame fraControls 
  17.       Height          =   735
  18.       Left            =   0
  19.       TabIndex        =   1
  20.       Top             =   0
  21.       Width           =   9495
  22.       Begin VB.ComboBox cboChartType 
  23.          BeginProperty Font 
  24.             name            =   "MS Sans Serif"
  25.             charset         =   0
  26.             weight          =   700
  27.             size            =   9.75
  28.             underline       =   0   'False
  29.             italic          =   0   'False
  30.             strikethrough   =   0   'False
  31.          EndProperty
  32.          ForeColor       =   &H00FF0000&
  33.          Height          =   360
  34.          Left            =   6480
  35.          Style           =   2  'Dropdown List
  36.          TabIndex        =   2
  37.          Top             =   240
  38.          Width           =   2895
  39.       End
  40.       Begin Threed.SSCommand SSCommand5 
  41.          Height          =   375
  42.          Left            =   5160
  43.          TabIndex        =   19
  44.          Top             =   240
  45.          Width           =   375
  46.          _Version        =   65536
  47.          _ExtentX        =   661
  48.          _ExtentY        =   661
  49.          _StockProps     =   78
  50.          Picture         =   "chartfrm.frx":030A
  51.       End
  52.       Begin Threed.SSCommand SSCommand17 
  53.          Height          =   375
  54.          Left            =   1560
  55.          TabIndex        =   7
  56.          Top             =   240
  57.          Width           =   375
  58.          _Version        =   65536
  59.          _ExtentX        =   661
  60.          _ExtentY        =   661
  61.          _StockProps     =   78
  62.          Picture         =   "chartfrm.frx":0A1C
  63.       End
  64.       Begin Threed.SSCommand SSCommand16 
  65.          Height          =   375
  66.          Left            =   6000
  67.          TabIndex        =   18
  68.          Top             =   240
  69.          Width           =   375
  70.          _Version        =   65536
  71.          _ExtentX        =   661
  72.          _ExtentY        =   661
  73.          _StockProps     =   78
  74.          Caption         =   "nD"
  75.          ForeColor       =   16711680
  76.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  77.             name            =   "MS Sans Serif"
  78.             charset         =   0
  79.             weight          =   700
  80.             size            =   8.25
  81.             underline       =   0   'False
  82.             italic          =   0   'False
  83.             strikethrough   =   0   'False
  84.          EndProperty
  85.       End
  86.       Begin Threed.SSCommand SSCommand15 
  87.          Height          =   375
  88.          Left            =   5640
  89.          TabIndex        =   17
  90.          Top             =   240
  91.          Width           =   375
  92.          _Version        =   65536
  93.          _ExtentX        =   661
  94.          _ExtentY        =   661
  95.          _StockProps     =   78
  96.          Caption         =   "!"
  97.          ForeColor       =   16711680
  98.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  99.             name            =   "MS Sans Serif"
  100.             charset         =   0
  101.             weight          =   700
  102.             size            =   8.25
  103.             underline       =   0   'False
  104.             italic          =   0   'False
  105.             strikethrough   =   0   'False
  106.          EndProperty
  107.       End
  108.       Begin Threed.SSCommand SSCommand14 
  109.          Height          =   375
  110.          Left            =   4800
  111.          TabIndex        =   16
  112.          Top             =   240
  113.          Width           =   375
  114.          _Version        =   65536
  115.          _ExtentX        =   661
  116.          _ExtentY        =   661
  117.          _StockProps     =   78
  118.          Picture         =   "chartfrm.frx":0BCE
  119.       End
  120.       Begin Threed.SSCommand SSCommand13 
  121.          Height          =   375
  122.          Left            =   4440
  123.          TabIndex        =   15
  124.          Top             =   240
  125.          Width           =   375
  126.          _Version        =   65536
  127.          _ExtentX        =   661
  128.          _ExtentY        =   661
  129.          _StockProps     =   78
  130.          Picture         =   "chartfrm.frx":0D80
  131.       End
  132.       Begin Threed.SSCommand SSCommand12 
  133.          Height          =   375
  134.          Left            =   4080
  135.          TabIndex        =   14
  136.          Top             =   240
  137.          Width           =   375
  138.          _Version        =   65536
  139.          _ExtentX        =   661
  140.          _ExtentY        =   661
  141.          _StockProps     =   78
  142.          Picture         =   "chartfrm.frx":0F32
  143.       End
  144.       Begin Threed.SSCommand SSCommand11 
  145.          Height          =   375
  146.          Left            =   3720
  147.          TabIndex        =   13
  148.          Top             =   240
  149.          Width           =   375
  150.          _Version        =   65536
  151.          _ExtentX        =   661
  152.          _ExtentY        =   661
  153.          _StockProps     =   78
  154.          Picture         =   "chartfrm.frx":10E4
  155.       End
  156.       Begin Threed.SSCommand SSCommand10 
  157.          Height          =   375
  158.          Left            =   3360
  159.          TabIndex        =   12
  160.          Top             =   240
  161.          Width           =   375
  162.          _Version        =   65536
  163.          _ExtentX        =   661
  164.          _ExtentY        =   661
  165.          _StockProps     =   78
  166.          Picture         =   "chartfrm.frx":1296
  167.       End
  168.       Begin Threed.SSCommand SSCommand9 
  169.          Height          =   375
  170.          Left            =   3000
  171.          TabIndex        =   11
  172.          Top             =   240
  173.          Width           =   375
  174.          _Version        =   65536
  175.          _ExtentX        =   661
  176.          _ExtentY        =   661
  177.          _StockProps     =   78
  178.          Picture         =   "chartfrm.frx":1448
  179.       End
  180.       Begin Threed.SSCommand SSCommand8 
  181.          Height          =   375
  182.          Left            =   2640
  183.          TabIndex        =   10
  184.          Top             =   240
  185.          Width           =   375
  186.          _Version        =   65536
  187.          _ExtentX        =   661
  188.          _ExtentY        =   661
  189.          _StockProps     =   78
  190.          Picture         =   "chartfrm.frx":15FA
  191.       End
  192.       Begin Threed.SSCommand SSCommand7 
  193.          Height          =   375
  194.          Left            =   2280
  195.          TabIndex        =   9
  196.          Top             =   240
  197.          Width           =   375
  198.          _Version        =   65536
  199.          _ExtentX        =   661
  200.          _ExtentY        =   661
  201.          _StockProps     =   78
  202.          Picture         =   "chartfrm.frx":17AC
  203.       End
  204.       Begin Threed.SSCommand SSCommand6 
  205.          Height          =   375
  206.          Left            =   1920
  207.          TabIndex        =   8
  208.          Top             =   240
  209.          Width           =   375
  210.          _Version        =   65536
  211.          _ExtentX        =   661
  212.          _ExtentY        =   661
  213.          _StockProps     =   78
  214.          Picture         =   "chartfrm.frx":195E
  215.       End
  216.       Begin Threed.SSCommand SSCommand4 
  217.          Height          =   375
  218.          Left            =   1200
  219.          TabIndex        =   6
  220.          Top             =   240
  221.          Width           =   375
  222.          _Version        =   65536
  223.          _ExtentX        =   661
  224.          _ExtentY        =   661
  225.          _StockProps     =   78
  226.          Picture         =   "chartfrm.frx":1B10
  227.       End
  228.       Begin Threed.SSCommand SSCommand3 
  229.          Height          =   375
  230.          Left            =   840
  231.          TabIndex        =   5
  232.          Top             =   240
  233.          Width           =   375
  234.          _Version        =   65536
  235.          _ExtentX        =   661
  236.          _ExtentY        =   661
  237.          _StockProps     =   78
  238.          Picture         =   "chartfrm.frx":1CC2
  239.       End
  240.       Begin Threed.SSCommand SSCommand2 
  241.          Height          =   375
  242.          Left            =   480
  243.          TabIndex        =   4
  244.          Top             =   240
  245.          Width           =   375
  246.          _Version        =   65536
  247.          _ExtentX        =   661
  248.          _ExtentY        =   661
  249.          _StockProps     =   78
  250.          Picture         =   "chartfrm.frx":1E74
  251.       End
  252.       Begin Threed.SSCommand SSCommand1 
  253.          Height          =   375
  254.          Left            =   120
  255.          TabIndex        =   3
  256.          Top             =   240
  257.          Width           =   375
  258.          _Version        =   65536
  259.          _ExtentX        =   661
  260.          _ExtentY        =   661
  261.          _StockProps     =   78
  262.          Picture         =   "chartfrm.frx":2026
  263.       End
  264.    End
  265.    Begin MSComDlg.CommonDialog CommonDialog1 
  266.       Left            =   8160
  267.       Top             =   840
  268.       _Version        =   65536
  269.       _ExtentX        =   847
  270.       _ExtentY        =   847
  271.       _StockProps     =   0
  272.    End
  273.    Begin VCIFiLib.VtChart VtChart1 
  274.       Height          =   3975
  275.       Left            =   240
  276.       TabIndex        =   0
  277.       Top             =   1020
  278.       Width           =   4215
  279.       _version        =   65536
  280.       _extentx        =   7435
  281.       _extenty        =   7011
  282.       _stockprops     =   96
  283.       filename        =   "chartfrm.frx":21D8
  284.    End
  285.    Begin VB.Menu File 
  286.       Caption         =   "&File"
  287.       Begin VB.Menu FileRead 
  288.          Caption         =   "Read Chart (VTC)..."
  289.       End
  290.       Begin VB.Menu FileWrite 
  291.          Caption         =   "WriteChart (VTC)..."
  292.          WindowList      =   -1  'True
  293.       End
  294.       Begin VB.Menu FileSep0 
  295.          Caption         =   "-"
  296.       End
  297.       Begin VB.Menu FileMeta 
  298.          Caption         =   "Write Metafile"
  299.       End
  300.       Begin VB.Menu WriteBMP 
  301.          Caption         =   "Write Bitmap File..."
  302.       End
  303.       Begin VB.Menu FileSep1 
  304.          Caption         =   "-"
  305.       End
  306.       Begin VB.Menu FilePrinterSetup 
  307.          Caption         =   "Printer Setup..."
  308.       End
  309.       Begin VB.Menu FilePrint 
  310.          Caption         =   "&Print"
  311.       End
  312.       Begin VB.Menu FileSep2 
  313.          Caption         =   "-"
  314.       End
  315.       Begin VB.Menu FileExit 
  316.          Caption         =   "E&xit"
  317.       End
  318.    End
  319.    Begin VB.Menu Edit 
  320.       Caption         =   "&Edit"
  321.       Begin VB.Menu EditCopy 
  322.          Caption         =   "&Copy"
  323.       End
  324.       Begin VB.Menu EditPaste 
  325.          Caption         =   "&Paste"
  326.       End
  327.    End
  328.    Begin VB.Menu Data 
  329.       Caption         =   "&Data"
  330.       Begin VB.Menu DataShow 
  331.          Caption         =   "Show Data"
  332.       End
  333.    End
  334.    Begin VB.Menu Test 
  335.       Caption         =   "Test"
  336.       Begin VB.Menu TestOne 
  337.          Caption         =   "Test One"
  338.       End
  339.       Begin VB.Menu TestAll 
  340.          Caption         =   "Test All"
  341.       End
  342.       Begin VB.Menu TestLights 
  343.          Caption         =   "View Lights"
  344.       End
  345.    End
  346.    Begin VB.Menu About 
  347.       Caption         =   "About"
  348.       Begin VB.Menu ATD 
  349.          Caption         =   "About This Demo"
  350.       End
  351.    End
  352. Attribute VB_Name = "frmMain"
  353. Attribute VB_Creatable = False
  354. Attribute VB_Exposed = False
  355. Option Explicit
  356. Private Sub ATD_Click()
  357.     Dim LF$
  358.     LF = Chr$(10)
  359.     MsgBox "Click on the chart pieces to select or drag " & _
  360.       "them (including dragging pie pieces)." & LF & LF & _
  361.       "Double Click on the chart pieces to invoke " & _
  362.       "the user interface." & LF & LF & _
  363.       "Select a data series and Shift-Double Click " & _
  364.       "to display the series number." & LF & LF & _
  365.       "Select a data point and Shift-Double Click " & _
  366.       "to display the data point value." & LF & LF & _
  367.       "Hold down the control key and drag the mouse " & _
  368.       "to rotate 3D charts."
  369. End Sub
  370. Private Sub cboChartType_Click()
  371.    With cboChartType
  372.       Select Case LastChartType
  373.       
  374.          Case ButtonVBar   ' Vertical Bar Charts
  375.             VBarIndex = .ListIndex
  376.             Call VBarChart
  377.       
  378.          Case ButtonHBar
  379.             HBarIndex = .ListIndex
  380.             Call HBarChart
  381.       
  382.          Case ButtonLine
  383.             LineIndex = .ListIndex
  384.             Call LineChart
  385.       
  386.          Case ButtonArea
  387.             AreaIndex = .ListIndex
  388.             Call AreaChart
  389.       
  390.          Case ButtonStep
  391.             StepIndex = .ListIndex
  392.             Call StepChart
  393.       
  394.          Case ButtonCombo
  395.             ComboIndex = .ListIndex
  396.             Call ComboChart
  397.       
  398.          Case ButtonPie
  399.             PieIndex = .ListIndex
  400.             Call PieChart
  401.       
  402.          Case ButtonXY
  403.             XYIndex = .ListIndex
  404.             Call XYChart
  405.       
  406.          Case ButtonPolar
  407.             PolarIndex = .ListIndex
  408.             Call PolarChart
  409.       
  410.          Case ButtonRadar
  411.             RadarIndex = .ListIndex
  412.             Call RadarChart
  413.       
  414.          Case ButtonBubble
  415.             BubbleIndex = .ListIndex
  416.             Call BubbleChart
  417.       
  418.          Case ButtonDoughnut
  419.             DoughnutIndex = .ListIndex
  420.             Call DoughnutChart
  421.       
  422.          Case ButtonHiLow
  423.             HilowIndex = .ListIndex
  424.             Call HiLowChart
  425.       
  426.          Case ButtonGantt
  427.             GanttIndex = .ListIndex
  428.             Call GanttChart
  429.       
  430.          Case ButtonOption
  431.             OptionIndex = .ListIndex
  432.             Call OptionChart
  433.       
  434.          Case ButtonMulti
  435.             MultiIndex = .ListIndex
  436.             Call MultiChart
  437.             
  438.         Case ButtonSChart
  439.             SChartIndex = .ListIndex
  440.             Call SurfaceChart
  441.       
  442.          Case Else
  443.             MsgBox "Add case to listbox event"
  444.       End Select
  445.    End With
  446. End Sub
  447. Private Sub Command1_Click()
  448. End Sub
  449. Private Sub DataRead_Click()
  450. End Sub
  451. Private Sub DataWrite_Click()
  452. End Sub
  453. Private Sub SSCommand1_Click()
  454.    ' Fill the chart list drop down box
  455.    With cboChartType
  456.       .Clear
  457.       
  458.       .AddItem "2D Bar"
  459.       .AddItem "2D Labeled"
  460.       .AddItem "2D +/- Data"
  461.       .AddItem "2D Picture Bars Tiled"
  462.       .AddItem "2D Picture Bars Stretch"
  463.       .AddItem "2D Stacked"
  464.       .AddItem "2D Stacked Percent"
  465.       
  466.       .AddItem "3D Bar"
  467.       .AddItem "3D Labeled"
  468.       .AddItem "3D Bar Styles"
  469.       .AddItem "3D Bar Walls"
  470.       .AddItem "3D Clustered"
  471.       .AddItem "3D +/- Floating"
  472.       
  473.       'cboChartType.AddItem "2D Skip Labels"
  474.       
  475.       ' If the chart type changes then start at the top of the list
  476.       ' If the chart type is the same then increment the chart
  477.       If LastChartType = ButtonVBar Then
  478.           VBarIndex = VBarIndex + 1
  479.           If VBarIndex = .ListCount Then VBarIndex = 0
  480.       Else
  481.           VBarIndex = 0
  482.       End If
  483.       LastChartType = ButtonVBar
  484.       .ListIndex = VBarIndex
  485.    End With
  486.    ' Display the new chart
  487. End Sub
  488. Private Sub SSCommand10_Click()
  489.    ' Fill the chart list drop down box
  490.    With cboChartType
  491.       .Clear
  492.       .AddItem "2D Radar"
  493.       .AddItem "2D No Axis"
  494.       .AddItem "2D Area"
  495.       ' If the chart type changes then start at the top of the list
  496.       ' If the chart type is the same then increment the chart
  497.       If LastChartType = ButtonRadar Then
  498.          RadarIndex = RadarIndex + 1
  499.          If RadarIndex = .ListCount Then RadarIndex = 0
  500.       Else
  501.          RadarIndex = 0
  502.       End If
  503.       LastChartType = ButtonRadar
  504.       .ListIndex = RadarIndex
  505.    End With
  506.    ' Display the new chart
  507. End Sub
  508. Private Sub SSCommand11_Click()
  509.    ' Fill the chart list drop down box
  510.    With cboChartType
  511.       .Clear
  512.       .AddItem "Bubble"
  513.       .AddItem "Bubble Ratio"
  514.       .AddItem "Bubble Labels"
  515.       ' If the chart type changes then start at the top of the list
  516.       ' If the chart type is the same then increment the chart
  517.       If LastChartType = ButtonBubble Then
  518.          BubbleIndex = BubbleIndex + 1
  519.          If BubbleIndex = .ListCount Then BubbleIndex = 0
  520.       Else
  521.          BubbleIndex = 0
  522.       End If
  523.       LastChartType = ButtonBubble
  524.       .ListIndex = BubbleIndex
  525.    End With
  526.    ' Display the new chart
  527. End Sub
  528. Private Sub SSCommand16_Click()
  529.    ' Fill the chart list drop down box
  530.    With cboChartType
  531.       .Clear
  532.       .AddItem "2D Multi-Dimensional"
  533.       .AddItem "3D Multi-Dimensional"
  534.       .AddItem "3D Multi-Dimensional Pie"
  535.       ' If the chart type changes then start at the top of the list
  536.       ' If the chart type is the same then increment the chart
  537.       If LastChartType = ButtonMulti Then
  538.           MultiIndex = MultiIndex + 1
  539.           If MultiIndex = .ListCount Then MultiIndex = 0
  540.       Else
  541.           MultiIndex = 0
  542.       End If
  543.       LastChartType = ButtonMulti
  544.       .ListIndex = MultiIndex
  545.    End With
  546. End Sub
  547. Private Sub SSCommand15_Click()
  548.    ' Fill the chart list drop down box
  549.    With cboChartType
  550.       .Clear
  551.       .AddItem "Title Fill Backdrop"
  552.       .AddItem "Title Gradient Backdrop"
  553.       .AddItem "Title Picture Backdrop"
  554.       .AddItem "BD Gradient Rectangle"
  555.       .AddItem "BD Gradient Oval"
  556.       .AddItem "BD Gradient Horizontal"
  557.       .AddItem "BD Gradient Vertical"
  558.       .AddItem "BD Picture Tiled"
  559.       .AddItem "Plot Gradient"
  560.       .AddItem "Plot BMP Picture"
  561.       .AddItem "Plot WMF Picture"
  562.       .AddItem "Projection Oblique"
  563.       .AddItem "Projection Perspective"
  564.       .AddItem "Highlighted Area"
  565.       .AddItem "Stick Chart"
  566.       .AddItem "Bar (Surface)"
  567.       .AddItem "Area Background"
  568.       ' If the chart type changes then start at the top of the list
  569.       ' If the chart type is the same then increment the chart
  570.       If LastChartType = ButtonOption Then
  571.           OptionIndex = OptionIndex + 1
  572.           If OptionIndex = .ListCount Then OptionIndex = 0
  573.       Else
  574.           OptionIndex = 0
  575.       End If
  576.       LastChartType = ButtonOption
  577.       .ListIndex = OptionIndex
  578.    End With
  579. End Sub
  580. Private Sub SSCommand13_Click()
  581.    ' Fill the chart list drop down box
  582.    With cboChartType
  583.       .Clear
  584.       .AddItem "Hi-Low"
  585.       .AddItem "Hi-Low-Close"
  586.       .AddItem "Open-Hi-Low-Close"
  587.       .AddItem "Hi-Low-Close Sidebar"
  588.       .AddItem "Hi-Low-Close Filled"
  589.       ' If the chart type changes then start at the top of the list
  590.       ' If the chart type is the same then increment the chart
  591.       If LastChartType = ButtonHiLow Then
  592.           HilowIndex = HilowIndex + 1
  593.           If HilowIndex = .ListCount Then HilowIndex = 0
  594.       Else
  595.           HilowIndex = 0
  596.       End If
  597.       LastChartType = ButtonHiLow
  598.       .ListIndex = HilowIndex
  599.    End With
  600.    ' Display the new chart
  601. End Sub
  602. Private Sub SSCommand14_Click()
  603.    ' Fill the chart list drop down box
  604.    With cboChartType
  605.       .Clear
  606.       .AddItem "2D Gantt"
  607.       .AddItem "2D Labeled"
  608.       .AddItem "2D Multiple Series"
  609.       .AddItem "2D Picture Bars"
  610.       .AddItem "3D Gantt"
  611.       .AddItem "3D Labeled"
  612.       ' If the chart type changes then start at the top of the list
  613.       ' If the chart type is the same then increment the chart
  614.       If LastChartType = ButtonGantt Then
  615.           GanttIndex = GanttIndex + 1
  616.           If GanttIndex = .ListCount Then GanttIndex = 0
  617.       Else
  618.           GanttIndex = 0
  619.       End If
  620.       LastChartType = ButtonGantt
  621.       .ListIndex = GanttIndex
  622.    End With
  623.    ' Display the new chart
  624. End Sub
  625. Private Sub SSCommand2_Click()
  626.    ' Fill the chart list drop down box
  627.    With cboChartType
  628.       .Clear
  629.       .AddItem "2D Horizontal Bar"
  630.       .AddItem "2D Labeled"
  631.       .AddItem "2D +/- Data"
  632.       .AddItem "2D Picture Bars"
  633.       .AddItem "2D Stacked"
  634.       .AddItem "2D Stacked Percent"
  635.       .AddItem "3D Horizontal Bar"
  636.       .AddItem "3D Labeled"
  637.       .AddItem "3D Thick Walls"
  638.       ' If the chart type changes then start at the top of the list
  639.       ' If the chart type is the same then increment the chart
  640.       If LastChartType = ButtonHBar Then
  641.           HBarIndex = HBarIndex + 1
  642.           If HBarIndex = .ListCount Then HBarIndex = 0
  643.       Else
  644.           HBarIndex = 0
  645.       End If
  646.       LastChartType = ButtonHBar
  647.       .ListIndex = HBarIndex
  648.    End With
  649.    ' Display the new chart
  650. End Sub
  651. Private Sub SSCommand3_Click()
  652.    ' Fill the chart list drop down box
  653.    With cboChartType
  654.       .Clear
  655.       .AddItem "2D Line"
  656.       .AddItem "2D Point Labels"
  657.       .AddItem "2D Series Labels"
  658.       .AddItem "2D +/- Data"
  659.       .AddItem "2D Smoothed"
  660.       .AddItem "2D Markers"
  661.       .AddItem "2D Line Styles"
  662.       .AddItem "2D Thick Lines"
  663.       .AddItem "2D Log Axis"
  664.       .AddItem "2D 2nd Y Axis"
  665.       .AddItem "2D Missing Data"
  666.       .AddItem "2D Statistics"
  667.       .AddItem "2D Guidelines"
  668.       .AddItem "3D Line"
  669.       .AddItem "3D Labeled"
  670.       .AddItem "3D Smoothed"
  671.       .AddItem "3D Line Styles"
  672.       'cboChartType.AddItem "3D Guidelines"
  673.       ' If the chart type changes then start at the top of the list
  674.       ' If the chart type is the same then increment the chart
  675.       If LastChartType = ButtonLine Then
  676.           LineIndex = LineIndex + 1
  677.           If LineIndex = .ListCount Then LineIndex = 0
  678.       Else
  679.           LineIndex = 0
  680.       End If
  681.       LastChartType = ButtonLine
  682.       .ListIndex = LineIndex
  683.    End With
  684.    ' Display the new chart
  685. End Sub
  686. Private Sub SSCommand12_Click()
  687.    ' Fill the chart list drop down box
  688.    With cboChartType
  689.       .Clear
  690.       .AddItem "3D Doughnut"
  691.       .AddItem "3D Multiple Doughnuts"
  692.       .AddItem "3D Exploded Pieces"
  693.       .AddItem "3D Labels"
  694.       .AddItem "3D Weighting"
  695.       .AddItem "3D Interior"
  696.       .AddItem "3D Thickness"
  697.       .AddItem "3D Shapes 5 Sides"
  698.       .AddItem "3D Shapes Cylinder"
  699.       ' If the chart type changes then start at the top of the list
  700.       ' If the chart type is the same then increment the chart
  701.       If LastChartType = ButtonDoughnut Then
  702.           DoughnutIndex = DoughnutIndex + 1
  703.           If DoughnutIndex = .ListCount Then DoughnutIndex = 0
  704.       Else
  705.           DoughnutIndex = 0
  706.       End If
  707.       LastChartType = ButtonDoughnut
  708.       .ListIndex = DoughnutIndex
  709.    End With
  710.    ' Display the new chart
  711. End Sub
  712. Private Sub SSCommand4_Click()
  713.    ' Fill the chart list drop down box
  714.    With cboChartType
  715.       .Clear
  716.       .AddItem "2D Area"
  717.       .AddItem "2D Stacked"
  718.       .AddItem "2D Smoothed"
  719.       .AddItem "2D Guide Lines"
  720.       .AddItem "3D Area"
  721.       .AddItem "3D Labeled"
  722.       .AddItem "3D Wide"
  723.       .AddItem "3D Smoothed"
  724.       ' If the chart type changes then start at the top of the list
  725.       ' If the chart type is the same then increment the chart
  726.       If LastChartType = ButtonArea Then
  727.           AreaIndex = AreaIndex + 1
  728.           If AreaIndex = .ListCount Then AreaIndex = 0
  729.       Else
  730.           AreaIndex = 0
  731.       End If
  732.       LastChartType = ButtonArea
  733.       .ListIndex = AreaIndex
  734.    End With
  735.    ' Display the new chart
  736. End Sub
  737. Private Sub SSCommand17_Click()
  738.    ' Fill the chart list drop down box
  739.    With cboChartType
  740.       .Clear
  741.       .AddItem "2D Step"
  742.       .AddItem "2D Stacked"
  743.       'cboChartType.AddItem "2D Guide Lines"
  744.       .AddItem "3D Step"
  745.       .AddItem "3D Labeled"
  746.       .AddItem "3D Wide"
  747.       ' If the chart type changes then start at the top of the list
  748.       ' If the chart type is the same then increment the chart
  749.       If LastChartType = ButtonStep Then
  750.           StepIndex = StepIndex + 1
  751.           If StepIndex = .ListCount Then StepIndex = 0
  752.       Else
  753.           StepIndex = 0
  754.       End If
  755.       LastChartType = ButtonStep
  756.       .ListIndex = StepIndex
  757.    End With
  758.    ' Display the new chart
  759. End Sub
  760. Private Sub SSCommand5_Click()
  761.    ' Fill the chart list drop down box
  762.    With cboChartType
  763.       .Clear
  764.       
  765.       .AddItem "2D Countour Lines"
  766.       .AddItem "2D Countour Bands"
  767.       .AddItem "3D Surface"
  768.       .AddItem "3D Surface (Pedestal)"
  769.       .AddItem "3D Surface (Gradients)"
  770.       .AddItem "3D Surface (Wireframe)"
  771.             
  772.       ' If the chart type changes then start at the top of the list
  773.       ' If the chart type is the same then increment the chart
  774.       If LastChartType = ButtonSChart Then
  775.           SChartIndex = SChartIndex + 1
  776.           If SChartIndex = .ListCount Then SChartIndex = 0
  777.       Else
  778.           SChartIndex = 0
  779.       End If
  780.       LastChartType = ButtonSChart
  781.       .ListIndex = SChartIndex
  782.    End With
  783.    ' Display the new chart
  784. End Sub
  785. Private Sub SSCommand6_Click()
  786.    ' Fill the chart list drop down box
  787.    With cboChartType
  788.       .Clear
  789.       .AddItem "2D Line/Bar"
  790.       .AddItem "2D Hi-Low/Bar"
  791.       .AddItem "3D Line/Bar"
  792.       .AddItem "3D Line/Bar/Area"
  793.       .AddItem "3D Step/Area"
  794.       ' If the chart type changes then start at the top of the list
  795.       ' If the chart type is the same then increment the chart
  796.       If LastChartType = ButtonCombo Then
  797.           ComboIndex = ComboIndex + 1
  798.           If ComboIndex = .ListCount Then ComboIndex = 0
  799.       Else
  800.           ComboIndex = 0
  801.       End If
  802.       LastChartType = ButtonCombo
  803.       .ListIndex = ComboIndex
  804.    End With
  805.    ' Display the new chart
  806. End Sub
  807. Private Sub SSCommand7_Click()
  808.    ' Fill the chart list drop down box
  809.    With cboChartType
  810.       .Clear
  811.       .AddItem "2D Pie Chart"
  812.       .AddItem "2D Multiple Pies"
  813.       .AddItem "2D Exploded Pieces"
  814.       .AddItem "2D Labels"
  815.       .AddItem "2D Weighting"
  816.       .AddItem "2D Start Angle"
  817.       .AddItem "2D Sorting"
  818.       .AddItem "3D Pie Chart"
  819.       .AddItem "3D Multiple Pies"
  820.       .AddItem "3D Exploded Pieces"
  821.       .AddItem "3D Labels"
  822.       .AddItem "3D Thick"
  823.       .AddItem "3D Thin"
  824.       .AddItem "3D Top Radius"
  825.       ' If the chart type changes then start at the top of the list
  826.       ' If the chart type is the same then increment the chart
  827.       If LastChartType = ButtonPie Then
  828.           PieIndex = PieIndex + 1
  829.           If PieIndex = .ListCount Then PieIndex = 0
  830.       Else
  831.           PieIndex = 0
  832.       End If
  833.       LastChartType = ButtonPie
  834.       .ListIndex = PieIndex
  835.    End With
  836.    ' Display the new chart
  837. End Sub
  838. Private Sub SSCommand8_Click()
  839.    ' Fill the chart list drop down box
  840.    With cboChartType
  841.       .Clear
  842.       .AddItem "2D XY"
  843.       .AddItem "2D Markers"
  844.       .AddItem "2D Picture Markers"
  845.       ' If the chart type changes then start at the top of the list
  846.       ' If the chart type is the same then increment the chart
  847.       If LastChartType = ButtonXY Then
  848.           XYIndex = XYIndex + 1
  849.           If XYIndex = .ListCount Then XYIndex = 0
  850.       Else
  851.           XYIndex = 0
  852.       End If
  853.       LastChartType = ButtonXY
  854.       .ListIndex = XYIndex
  855.    End With
  856.    ' Display the new chart
  857. End Sub
  858. Private Sub SSCommand9_Click()
  859.    ' Fill the chart list drop down box
  860.    With cboChartType
  861.       .Clear
  862.       .AddItem "2D Polar"
  863.       .AddItem "2D No Axis"
  864.       .AddItem "2D Start Angle"
  865.       .AddItem "2D Line Styles"
  866.       ' If the chart type changes then start at the top of the list
  867.       ' If the chart type is the same then increment the chart
  868.       If LastChartType = ButtonPolar Then
  869.           PolarIndex = PolarIndex + 1
  870.           If PolarIndex = .ListCount Then PolarIndex = 0
  871.       Else
  872.           PolarIndex = 0
  873.       End If
  874.       LastChartType = ButtonPolar
  875.       .ListIndex = PolarIndex
  876.    End With
  877. End Sub
  878. Private Sub CycleButton(TheButton As SSCommand)
  879.    Dim i%
  880.    TheButton.Value = True
  881.    Refresh
  882.    vtchart1.Repaint = True
  883.    For i = 1 To cboChartType.ListCount - 1
  884.       TheButton.Value = True
  885.       Refresh                 '' let the chart paint
  886.       cboChartType.Refresh    '' identify the chart
  887.    Next i
  888. End Sub
  889. Private Sub DataShow_Click()
  890.    frmData.show
  891.    frmData.Refresh
  892. End Sub
  893. Private Sub EditCopy_Click()
  894.    vtchart1.EditCopy
  895. End Sub
  896. Private Sub EditPaste_Click()
  897.    vtchart1.EditPaste
  898. End Sub
  899. Private Sub FileExit_Click()
  900.     End
  901. End Sub
  902. Private Sub FileMeta_Click()
  903.    On Error GoTo WriteWMFError
  904.    With CommonDialog1
  905.       .DialogTitle = "Write First Impression Metafile"
  906.       .DefaultExt = "wmf"
  907.       .Filter = "Metafiles|*.wmf"
  908.       .flags = &H2
  909.       .CancelError = True
  910.       .InitDir = App.Path
  911.       .ShowSave
  912.       
  913.       vtchart1.WritePictureToFile .filename, VtPictureTypeWMF, 0
  914.    End With
  915.    Exit Sub
  916. WriteWMFError:
  917.    MsgBox Error
  918. End Sub
  919. Private Sub FilePrint_Click()
  920.    vtchart1.PrintChart
  921. End Sub
  922. Private Sub FilePrinterSetup_Click()
  923.    vtchart1.PrintSetupDialog
  924. End Sub
  925. Private Sub FileRead_Click()
  926.    Dim cherror&
  927.    On Error GoTo FileReadError
  928.    With CommonDialog1
  929.       .DialogTitle = "Read First Impression Chart"
  930.       .DefaultExt = "vtc"
  931.       .Filter = "First Impression Chart|*.vtc"
  932.       .flags = &H1000
  933.       .CancelError = True
  934.       .InitDir = App.Path
  935.       .ShowOpen
  936.       
  937.       vtchart1.ReadFromFile .filename
  938.    End With
  939.    Exit Sub
  940. FileReadError:
  941.    MsgBox Error
  942. End Sub
  943. Private Sub FileWrite_Click()
  944.    Dim cherror&
  945.    On Error GoTo FileWriteError
  946.    With CommonDialog1
  947.       .DialogTitle = "Write First Impression Chart"
  948.       .DefaultExt = "vtc"
  949.       .Filter = "First Impression Chart|*.vtc"
  950.       .flags = &H2
  951.       .CancelError = True
  952.       .InitDir = App.Path
  953.       .ShowSave
  954.       vtchart1.WriteToFile .filename
  955.    End With
  956.    Exit Sub
  957. FileWriteError:
  958.    MsgBox Error
  959. End Sub
  960. Private Sub Form_Load()
  961.     ' Set the window up
  962.     Top = 0
  963.     Left = 0
  964.     Height = 7200
  965.     Width = 9615
  966.     ' Size the chart inside the window
  967.     vtchart1.Top = fraControls.Top + fraControls.Height + 50
  968.     vtchart1.Left = fraControls.Left
  969.     vtchart1.Width = ScaleWidth - vtchart1.Left - 30
  970.     vtchart1.Height = ScaleHeight - vtchart1.Top - 30
  971.     fraControls.Width = ScaleWidth - fraControls.Left - 30
  972.     ' Initialize chart list variables
  973.     'LastChartType = ButtonVBar
  974.     VBarIndex = -1
  975.     HBarIndex = -1
  976.     LineIndex = -1
  977.     AreaIndex = -1
  978.     StepIndex = -1
  979.     ComboIndex = -1
  980.     PieIndex = -1
  981.     XYIndex = -1
  982.     PolarIndex = -1
  983.     RadarIndex = -1
  984.     BubbleIndex = -1
  985.     DoughnutIndex = -1
  986.     HilowIndex = -1
  987.     GanttIndex = -1
  988.     OptionIndex = -1
  989.     MultiIndex = -1
  990.     SChartIndex = -1
  991.     ' Display the initial chart
  992.     SSCommand1 = True
  993. End Sub
  994. Private Sub Form_Resize()
  995.    If ScaleWidth > 1000 And ScaleHeight > 1000 Then
  996.       With vtchart1
  997.          .Repaint = False
  998.          .Width = frmMain.ScaleWidth - .Left - 30
  999.          .Height = frmMain.ScaleHeight - .Top - 30
  1000.          .Repaint = True
  1001.       End With
  1002.       fraControls.Width = ScaleWidth - fraControls.Left - 30
  1003.    End If
  1004. End Sub
  1005. Private Sub Form_Unload(Cancel As Integer)
  1006.     End
  1007. End Sub
  1008. Private Sub TestAll_Click()
  1009.    Call CycleButton(SSCommand1)
  1010.    Call CycleButton(SSCommand2)
  1011.    Call CycleButton(SSCommand3)
  1012.    Call CycleButton(SSCommand4)
  1013.    Call CycleButton(SSCommand17)
  1014.    Call CycleButton(SSCommand6)
  1015.    Call CycleButton(SSCommand7)
  1016.    Call CycleButton(SSCommand8)
  1017.    Call CycleButton(SSCommand9)
  1018.    Call CycleButton(SSCommand10)
  1019.    Call CycleButton(SSCommand11)
  1020.    Call CycleButton(SSCommand12)
  1021.    Call CycleButton(SSCommand13)
  1022.    Call CycleButton(SSCommand14)
  1023.    Call CycleButton(SSCommand15)
  1024.    Call CycleButton(SSCommand16)
  1025.    Call CycleButton(SSCommand5)
  1026. End Sub
  1027. Private Sub TestLights_Click()
  1028.    Dim i%, light As Object
  1029.    For Each light In vtchart1.Plot.light.LightSources
  1030.       MsgBox "Light Information" & Chr$(13) & _
  1031.          "Intensity: " & light.Intensity & Chr$(13) & _
  1032.          "X: " & Chr$(9) & light.X & Chr$(13) & _
  1033.          "Y: " & Chr$(9) & light.Y & Chr$(13) & _
  1034.          "Z: " & Chr$(9) & light.Z & Chr$(13)
  1035.    Next light
  1036.    ' Turn off all current lights
  1037.    With vtchart1.Plot.light.LightSources
  1038.       For i = 1 To .Count
  1039.          .Remove (i)
  1040.       Next i
  1041.    End With
  1042.    ' Set the new light
  1043.    vtchart1.Plot.light.LightSources.Add -1, -1, -1, 1
  1044. End Sub
  1045. Private Sub TestOne_Click()
  1046.    Dim i%
  1047.    ' Reset all chart options
  1048.    Call DefaultChart
  1049.    Call QReadData(App.Path + VBARDATA1)
  1050.    With frmMain.vtchart1
  1051.       For i = 1 To 50
  1052.          .ChartType = VtChChartType3dBar
  1053.          Refresh
  1054.          .ChartType = VtChChartType2dBar
  1055.          Refresh
  1056.       Next i
  1057.    End With
  1058. End Sub
  1059. Private Sub VtChart1_PointActivated(series As Integer, dataPoint As Integer, mouseFlags As Integer, Cancel As Integer)
  1060.    Dim flags As Integer
  1061.    Dim TheData As Double
  1062.    flags = mouseFlags And VtChMouseFlagShiftKeyDown
  1063.    If flags Then
  1064.       frmMain.vtchart1.Row = dataPoint
  1065.       frmMain.vtchart1.Column = series
  1066.       TheData = frmMain.vtchart1.Data
  1067.       MsgBox "Series:" & Str$(series) & Chr$(10) & " Point:" & Str$(dataPoint) & Chr$(10) & " Data:" & Str$(TheData)
  1068.       Cancel = True ' Flag to bypass the UI
  1069.    End If
  1070. End Sub
  1071. Private Sub VtChart1_SeriesActivated(series As Integer, mouseFlags As Integer, Cancel As Integer)
  1072.     Dim flags As Integer
  1073.     Dim a As String
  1074.     flags = mouseFlags And VtChMouseFlagShiftKeyDown
  1075.     If flags Then
  1076.         a = "Series:" & Str$(series) + Chr$(10) + Chr$(10) + "Select a single data point before"
  1077.         a = a + Chr$(10) + "Shift-Double Clicking to see its value."
  1078.         MsgBox a
  1079.         Cancel = True ' Flag to bypass the UI
  1080.     End If
  1081. End Sub
  1082. Private Sub WriteBMP_Click()
  1083.    On Error GoTo WriteBitmapError
  1084.    With CommonDialog1
  1085.       .DialogTitle = "Write First Impression Bitmap"
  1086.       .DefaultExt = "bmp"
  1087.       .Filter = "Bitmaps|*.bmp"
  1088.       .flags = &H2
  1089.       .CancelError = True
  1090.       .InitDir = App.Path
  1091.       .ShowSave
  1092.       
  1093.       vtchart1.WritePictureToFile .filename, VtPictureTypeBMP, 0
  1094.    End With
  1095.    Exit Sub
  1096. WriteBitmapError:
  1097.    MsgBox Error
  1098. End Sub
  1099.