home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1996 February
/
PCWK0296.iso
/
po7_win
/
object10
/
grapho.frm
< prev
next >
Wrap
Text File
|
1994-11-10
|
8KB
|
308 lines
VERSION 2.00
Begin Form frmGraphO
BorderStyle = 3 'Fixed Double
Caption = "VB*SQL Graph Options"
ClientHeight = 4320
ClientLeft = 2340
ClientTop = 1530
ClientWidth = 4680
Height = 4725
Left = 2280
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 4320
ScaleWidth = 4680
Top = 1185
Width = 4800
Begin TextBox wtitle
Height = 285
Left = 1320
TabIndex = 8
Text = "VB*SQL Graph"
Top = 3000
Width = 3255
End
Begin ComboBox grGridStyle
Height = 300
Left = 1320
Style = 2 'Dropdown List
TabIndex = 7
Top = 2640
Width = 2175
End
Begin TextBox grBottomTitle
Height = 285
Left = 1320
TabIndex = 6
Top = 2280
Width = 3255
End
Begin TextBox grLeftTitle
Height = 285
Left = 1320
TabIndex = 5
Top = 1920
Width = 3255
End
Begin TextBox grTitle
Height = 285
Left = 1320
TabIndex = 4
Top = 1560
Width = 3255
End
Begin TextBox grCaption
Height = 285
Left = 1320
TabIndex = 3
Top = 1200
Width = 3255
End
Begin ComboBox grValue
Height = 300
Left = 1320
Style = 2 'Dropdown List
TabIndex = 2
Top = 840
Width = 2175
End
Begin ComboBox grLabel
Height = 300
Left = 1320
Style = 2 'Dropdown List
TabIndex = 1
Top = 480
Width = 2175
End
Begin ComboBox grType
Height = 300
Left = 1320
Style = 2 'Dropdown List
TabIndex = 0
Top = 120
Width = 1335
End
Begin CommandButton graphit
Caption = "Graph"
Height = 495
Left = 480
TabIndex = 9
Top = 3720
Width = 1215
End
Begin CommandButton Cancel
Caption = "Cancel"
Height = 495
Left = 3000
TabIndex = 10
Top = 3720
Width = 1215
End
Begin Label Label10
AutoSize = -1 'True
BorderStyle = 1 'Fixed Single
Caption = "Double-Click on the graph to Exit"
Height = 225
Left = 840
TabIndex = 20
Top = 3360
Width = 2865
End
Begin Label Label9
AutoSize = -1 'True
Caption = "Window Title:"
Height = 195
Left = 120
TabIndex = 19
Top = 3000
Width = 1185
End
Begin Label Label8
AutoSize = -1 'True
Caption = "Grid Style:"
Height = 195
Left = 360
TabIndex = 18
Top = 2640
Width = 900
End
Begin Label Label7
AutoSize = -1 'True
Caption = "Bottom Title:"
Height = 195
Left = 120
TabIndex = 17
Top = 2280
Width = 1095
End
Begin Label Label6
AutoSize = -1 'True
Caption = "Left Title:"
Height = 195
Left = 360
TabIndex = 16
Top = 1920
Width = 840
End
Begin Label Label5
AutoSize = -1 'True
Caption = "Title:"
Height = 195
Left = 720
TabIndex = 15
Top = 1560
Width = 450
End
Begin Label Label4
AutoSize = -1 'True
Caption = "Value Field:"
Height = 195
Left = 240
TabIndex = 14
Top = 840
Width = 1020
End
Begin Label Label3
AutoSize = -1 'True
Caption = "Label Field:"
Height = 195
Left = 240
TabIndex = 13
Top = 480
Width = 1005
End
Begin Label Label2
AutoSize = -1 'True
Caption = "Type:"
Height = 195
Left = 720
TabIndex = 12
Top = 120
Width = 495
End
Begin Label Label1
AutoSize = -1 'True
Caption = "Caption:"
Height = 195
Left = 480
TabIndex = 11
Top = 1200
Width = 720
End
End
Option Explicit
Sub Cancel_Click ()
Unload frmGraphO
End Sub
Sub Form_Load ()
Dim i%
grType.AddItem "2D Pie" '1
grType.AddItem "3D Pie" '2
grType.AddItem "2D Bar" '3(default)
grType.AddItem "3D Bar" '4
'grType.AddItem "Gantt" '5
'grType.AddItem "Line" '6
'grType.AddItem "Log/Lin" '7
'grType.AddItem "Area" '8
'grType.AddItem "Scatter" '9
'grType.AddItem "Polar" '10
'grType.AddItem "HLC" '11
grType.ListIndex = 2 '(3 - 1)
grGridStyle.AddItem "None" '0(default)
grGridStyle.AddItem "Horizontal" '1
grGridStyle.AddItem "Vertical" '2
grGridStyle.AddItem "Both" '3
grGridStyle.ListIndex = 0
For i% = 1 To GraphDyn.Fields.Count - 1
grLabel.AddItem GraphDyn.Fields(i%).Name
grValue.AddItem GraphDyn.Fields(i%).Name
Next i%
grLabel.ListIndex = 0
grValue.ListIndex = 0
End Sub
Sub Graphit_Click ()
Dim label$, value$, foo%
If Len(grCaption) > 0 Then
frmGraphA.Graph1.DrawMode = 1
frmGraphA.Graph1.GraphCaption = grCaption.Text
Else
frmGraphA.Graph1.DrawMode = 0
End If
frmGraphA.Graph1.GraphTitle = grTitle.Text
frmGraphA.Graph1.LeftTitle = grLeftTitle.Text
frmGraphA.Graph1.BottomTitle = grBottomTitle.Text
frmGraphA.Graph1.GraphType = (grType.ListIndex) + 1
frmGraphA.Graph1.GridStyle = (grGridStyle.ListIndex)
frmGraphA.Caption = wtitle.Text
label$ = grLabel.List(grLabel.ListIndex)
value$ = grValue.List(grValue.ListIndex)
frmGraphO.Hide
On Error GoTo GraphError
Call SimpleGraph(frmGraphA.Graph1, GraphDyn, label$, value$)
frmGraphA.Show MODAL
Unload frmGraphO
Exit Sub
GraphError:
Call RaiseError("Error", "Cannot draw graph. Check your data.")
Unload frmGraphO
Exit Sub
End Sub
Sub grBottomTitle_Change ()
grBottomTitle.SelStart = 0
grBottomTitle.SelLength = Len(grBottomTitle.Text)
End Sub
Sub grCaption_GotFocus ()
grCaption.SelStart = 0
grCaption.SelLength = Len(grCaption.Text)
End Sub
Sub grLeftTitle_Change ()
grLeftTitle.SelStart = 0
grLeftTitle.SelLength = Len(grLeftTitle.Text)
End Sub
Sub grTitle_GotFocus ()
grTitle.SelStart = 0
grTitle.SelLength = Len(grTitle.Text)
End Sub
Sub wtitle_GotFocus ()
wtitle.SelStart = 0
wtitle.SelLength = Len(wtitle.Text)
End Sub