home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.MDIForm MDIForm1
- BackColor = &H8000000C&
- Caption = "First Impression/Formula One Link Demo"
- ClientHeight = 6450
- ClientLeft = 1095
- ClientTop = 1785
- ClientWidth = 9435
- Height = 7200
- Icon = "CHSSLink.frx":0000
- Left = 1005
- LinkTopic = "MDIForm1"
- Top = 1125
- Width = 9615
- Begin VB.PictureBox Picture1
- Align = 1 'Align Top
- Appearance = 0 'Flat
- BackColor = &H00C0C0C0&
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 700
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- ForeColor = &H80000008&
- Height = 615
- Left = 0
- ScaleHeight = 585
- ScaleWidth = 9405
- TabIndex = 0
- Top = 0
- Width = 9435
- Begin VB.CommandButton ChartButton
- Appearance = 0 'Flat
- BackColor = &H00C0C0C0&
- Caption = "Update Sheet"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 700
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 375
- Left = 7440
- TabIndex = 3
- Top = 120
- Visible = 0 'False
- Width = 1395
- End
- Begin VB.CheckBox chkChartOnSheet
- Caption = "Place Chart On Sheet"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 700
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 255
- Left = 4860
- TabIndex = 2
- Top = 300
- Width = 2475
- End
- Begin VB.CheckBox chkLink
- Caption = "Link Chart To Sheet"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 700
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 195
- Left = 4860
- TabIndex = 1
- Top = 60
- Width = 2175
- End
- End
- Begin MSComDlg.CommonDialog CommonDialog1
- Left = 60
- Top = 660
- _Version = 65536
- _ExtentX = 847
- _ExtentY = 847
- _StockProps = 0
- End
- Begin VB.Menu mnuFile
- Caption = "&File"
- Begin VB.Menu mnuFileLoadChart
- Caption = "Load &Chart..."
- End
- Begin VB.Menu mnuFileLoadWorkbook
- Caption = "Load &Workbook..."
- End
- Begin VB.Menu FileSep
- Caption = "-"
- End
- Begin VB.Menu FileExit
- Caption = "E&xit"
- End
- End
- Begin VB.Menu mnuChart
- Caption = "&Chart"
- Begin VB.Menu mnuChart2DBar
- Caption = "2D Bar Chart"
- End
- Begin VB.Menu mnuChart3DBar
- Caption = "3D Bar Chart"
- End
- Begin VB.Menu mnuChart2DPie
- Caption = "2D Pie Chart"
- End
- Begin VB.Menu mnuChart3DPie
- Caption = "3D Pie Chart"
- End
- End
- Begin VB.Menu Window
- Caption = "&Window"
- Begin VB.Menu mnuWindowCascade
- Caption = "&Cascade"
- End
- Begin VB.Menu mnuWindowHor
- Caption = "Tile &Horizontal"
- End
- Begin VB.Menu mnuWindowVert
- Caption = "Tile &Vertical"
- End
- Begin VB.Menu mnuWindowIcons
- Caption = "&Arrange Icons"
- End
- End
- Attribute VB_Name = "MDIForm1"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Option Explicit
- Private Sub ChartButton_Click()
- ' If there is a chart on the sheet then update the chart
- If chkChartOnSheet.Value = 1 Then
- Call MoveChartPictureToSheet
- End If
- End Sub
- Private Sub FileExit_Click()
- End
- End Sub
- Private Sub chkLink_Click()
- If chkLink.Value = 1 Then
- Call ResizeArea
- Else
- ' Disconnect the two
- ChartForm.VtChart1.SsLinkMode = VtChSsLinkModeOff
- End If
- End Sub
- Private Sub MDIForm_Load()
- Top = 0
- Left = 0
- Width = 9615
- Height = 7200
- ChartForm.Show
- SheetForm.Show
- Arrange 2
- GlobalObjID = 0
- End Sub
- Private Sub MDIForm_QueryUnload(Cancel As Integer, UnloadMode As Integer)
- End
- End Sub
- Private Sub mnuChart2DBar_Click()
- ChartForm.VtChart1.ChartType = VtChChartType2dBar
- Call ClearChartMenuChecks
- mnuChart2DBar.Checked = True
- End Sub
- Private Sub mnuChart2DPie_Click()
- ChartForm.VtChart1.ChartType = VtChChartType2dPie
- Call ClearChartMenuChecks
- mnuChart2DPie.Checked = True
- End Sub
- Private Sub mnuChart3DBar_Click()
- ChartForm.VtChart1.ChartType = VtChChartType3dBar
- Call ClearChartMenuChecks
- mnuChart3DBar.Checked = True
- End Sub
- Private Sub mnuChart3DPie_Click()
- ChartForm.VtChart1.ChartType = VtChChartType3dPie
- Call ClearChartMenuChecks
- mnuChart3DPie.Checked = True
- End Sub
- Private Sub mnuFileLoadChart_Click()
- On Error GoTo FIFileLoadError
- With CommonDialog1
- .DialogTitle = "Read First Impression Chart"
- .DefaultExt = "vtc"
- .Filter = "FirstImpression Charts |*.vtc"
- .Flags = &H1000
- .InitDir = App.Path
- .ShowOpen
- ChartForm.VtChart1.ReadFromFile (.fileName)
- End With
- Exit Sub
- FIFileLoadError:
- MsgBox Error
- End Sub
- Private Sub mnuFileLoadWorkbook_Click()
- On Error GoTo F1FileLoadError
- Dim fileName As String
- SheetForm.F1Book1.OpenFileDlg "Formula One Link Demo", hWnd, fileName
- SheetForm.F1Book1.ReadFile = fileName
- SheetForm.F1Book1.TableName = fileName
- Exit Sub
- F1FileLoadError:
- MsgBox Error
- End Sub
- Private Sub mnuWindowCascade_Click()
- Arrange 0
- End Sub
- Private Sub mnuWindowHor_Click()
- Arrange 1
- End Sub
- Private Sub mnuWindowIcons_Click()
- Arrange 3
- End Sub
- Private Sub mnuWindowVert_Click()
- Arrange 2
- End Sub
- Private Sub chkChartOnSheet_Click()
- #If Win32 Then
- Dim metafile&
- #Else
- Dim metafile%
- #End If
- Dim MapMode%, ObjID&
- Dim X1!, Y1!, X2!, Y2!
- Dim ExtentX&, ExtentY&
- ChartButton.Visible = chkChartOnSheet.Value
- If chkChartOnSheet.Value = 1 Then
- ' Cell coordinates of where to put the chart
- X1 = 1
- Y1 = 6
- X2 = 5
- Y2 = 18
- MapMode = 8 ' Anisotropic Mode (Stretchable)
- ' Get the metafile from the chart
- ChartForm.VtChart1.GetMetafile VtPictureOptionNoSizeHeader, metafile, ExtentX, ExtentY
- ' Place it on the spreadsheet
- SheetForm.F1Book1.ObjNewPicture X1, Y1, X2, Y2, ObjID, metafile, MapMode, ExtentX, ExtentY
- GlobalObjID = ObjID
- Else
- ' Delete the chart metafile object
- SheetForm.F1Book1.ObjSetSelection GlobalObjID
- SheetForm.F1Book1.EditCut
- End If
- End Sub
-