home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1996 February / PCWK0296.iso / po7_win / object10 / grapho.frm < prev    next >
Text File  |  1994-11-10  |  8KB  |  308 lines

  1. VERSION 2.00
  2. Begin Form frmGraphO 
  3.    BorderStyle     =   3  'Fixed Double
  4.    Caption         =   "VB*SQL Graph Options"
  5.    ClientHeight    =   4320
  6.    ClientLeft      =   2340
  7.    ClientTop       =   1530
  8.    ClientWidth     =   4680
  9.    Height          =   4725
  10.    Left            =   2280
  11.    LinkTopic       =   "Form1"
  12.    MaxButton       =   0   'False
  13.    ScaleHeight     =   4320
  14.    ScaleWidth      =   4680
  15.    Top             =   1185
  16.    Width           =   4800
  17.    Begin TextBox wtitle 
  18.       Height          =   285
  19.       Left            =   1320
  20.       TabIndex        =   8
  21.       Text            =   "VB*SQL Graph"
  22.       Top             =   3000
  23.       Width           =   3255
  24.    End
  25.    Begin ComboBox grGridStyle 
  26.       Height          =   300
  27.       Left            =   1320
  28.       Style           =   2  'Dropdown List
  29.       TabIndex        =   7
  30.       Top             =   2640
  31.       Width           =   2175
  32.    End
  33.    Begin TextBox grBottomTitle 
  34.       Height          =   285
  35.       Left            =   1320
  36.       TabIndex        =   6
  37.       Top             =   2280
  38.       Width           =   3255
  39.    End
  40.    Begin TextBox grLeftTitle 
  41.       Height          =   285
  42.       Left            =   1320
  43.       TabIndex        =   5
  44.       Top             =   1920
  45.       Width           =   3255
  46.    End
  47.    Begin TextBox grTitle 
  48.       Height          =   285
  49.       Left            =   1320
  50.       TabIndex        =   4
  51.       Top             =   1560
  52.       Width           =   3255
  53.    End
  54.    Begin TextBox grCaption 
  55.       Height          =   285
  56.       Left            =   1320
  57.       TabIndex        =   3
  58.       Top             =   1200
  59.       Width           =   3255
  60.    End
  61.    Begin ComboBox grValue 
  62.       Height          =   300
  63.       Left            =   1320
  64.       Style           =   2  'Dropdown List
  65.       TabIndex        =   2
  66.       Top             =   840
  67.       Width           =   2175
  68.    End
  69.    Begin ComboBox grLabel 
  70.       Height          =   300
  71.       Left            =   1320
  72.       Style           =   2  'Dropdown List
  73.       TabIndex        =   1
  74.       Top             =   480
  75.       Width           =   2175
  76.    End
  77.    Begin ComboBox grType 
  78.       Height          =   300
  79.       Left            =   1320
  80.       Style           =   2  'Dropdown List
  81.       TabIndex        =   0
  82.       Top             =   120
  83.       Width           =   1335
  84.    End
  85.    Begin CommandButton graphit 
  86.       Caption         =   "Graph"
  87.       Height          =   495
  88.       Left            =   480
  89.       TabIndex        =   9
  90.       Top             =   3720
  91.       Width           =   1215
  92.    End
  93.    Begin CommandButton Cancel 
  94.       Caption         =   "Cancel"
  95.       Height          =   495
  96.       Left            =   3000
  97.       TabIndex        =   10
  98.       Top             =   3720
  99.       Width           =   1215
  100.    End
  101.    Begin Label Label10 
  102.       AutoSize        =   -1  'True
  103.       BorderStyle     =   1  'Fixed Single
  104.       Caption         =   "Double-Click on the graph to Exit"
  105.       Height          =   225
  106.       Left            =   840
  107.       TabIndex        =   20
  108.       Top             =   3360
  109.       Width           =   2865
  110.    End
  111.    Begin Label Label9 
  112.       AutoSize        =   -1  'True
  113.       Caption         =   "Window Title:"
  114.       Height          =   195
  115.       Left            =   120
  116.       TabIndex        =   19
  117.       Top             =   3000
  118.       Width           =   1185
  119.    End
  120.    Begin Label Label8 
  121.       AutoSize        =   -1  'True
  122.       Caption         =   "Grid Style:"
  123.       Height          =   195
  124.       Left            =   360
  125.       TabIndex        =   18
  126.       Top             =   2640
  127.       Width           =   900
  128.    End
  129.    Begin Label Label7 
  130.       AutoSize        =   -1  'True
  131.       Caption         =   "Bottom Title:"
  132.       Height          =   195
  133.       Left            =   120
  134.       TabIndex        =   17
  135.       Top             =   2280
  136.       Width           =   1095
  137.    End
  138.    Begin Label Label6 
  139.       AutoSize        =   -1  'True
  140.       Caption         =   "Left Title:"
  141.       Height          =   195
  142.       Left            =   360
  143.       TabIndex        =   16
  144.       Top             =   1920
  145.       Width           =   840
  146.    End
  147.    Begin Label Label5 
  148.       AutoSize        =   -1  'True
  149.       Caption         =   "Title:"
  150.       Height          =   195
  151.       Left            =   720
  152.       TabIndex        =   15
  153.       Top             =   1560
  154.       Width           =   450
  155.    End
  156.    Begin Label Label4 
  157.       AutoSize        =   -1  'True
  158.       Caption         =   "Value Field:"
  159.       Height          =   195
  160.       Left            =   240
  161.       TabIndex        =   14
  162.       Top             =   840
  163.       Width           =   1020
  164.    End
  165.    Begin Label Label3 
  166.       AutoSize        =   -1  'True
  167.       Caption         =   "Label Field:"
  168.       Height          =   195
  169.       Left            =   240
  170.       TabIndex        =   13
  171.       Top             =   480
  172.       Width           =   1005
  173.    End
  174.    Begin Label Label2 
  175.       AutoSize        =   -1  'True
  176.       Caption         =   "Type:"
  177.       Height          =   195
  178.       Left            =   720
  179.       TabIndex        =   12
  180.       Top             =   120
  181.       Width           =   495
  182.    End
  183.    Begin Label Label1 
  184.       AutoSize        =   -1  'True
  185.       Caption         =   "Caption:"
  186.       Height          =   195
  187.       Left            =   480
  188.       TabIndex        =   11
  189.       Top             =   1200
  190.       Width           =   720
  191.    End
  192. End
  193. Option Explicit
  194.  
  195. Sub Cancel_Click ()
  196.  Unload frmGraphO
  197. End Sub
  198.  
  199. Sub Form_Load ()
  200.  
  201.  Dim i%
  202.  
  203.  grType.AddItem "2D Pie"    '1
  204.  grType.AddItem "3D Pie"    '2
  205.  grType.AddItem "2D Bar"    '3(default)
  206.  grType.AddItem "3D Bar"    '4
  207.  'grType.AddItem "Gantt"     '5
  208.  'grType.AddItem "Line"      '6
  209.  'grType.AddItem "Log/Lin"   '7
  210.  'grType.AddItem "Area"      '8
  211.  'grType.AddItem "Scatter"   '9
  212.  'grType.AddItem "Polar"     '10
  213.  'grType.AddItem "HLC"       '11
  214.  grType.ListIndex = 2   '(3 - 1)
  215.  
  216.  
  217.  grGridStyle.AddItem "None"         '0(default)
  218.  grGridStyle.AddItem "Horizontal"   '1
  219.  grGridStyle.AddItem "Vertical"     '2
  220.  grGridStyle.AddItem "Both"         '3
  221.  grGridStyle.ListIndex = 0
  222.  
  223.  For i% = 1 To GraphDyn.Fields.Count - 1
  224.   grLabel.AddItem GraphDyn.Fields(i%).Name
  225.   grValue.AddItem GraphDyn.Fields(i%).Name
  226.  Next i%
  227.  
  228.  grLabel.ListIndex = 0
  229.  grValue.ListIndex = 0
  230.  
  231.  
  232. End Sub
  233.  
  234. Sub Graphit_Click ()
  235.  
  236.  Dim label$, value$, foo%
  237.  
  238.  If Len(grCaption) > 0 Then
  239.   frmGraphA.Graph1.DrawMode = 1
  240.   frmGraphA.Graph1.GraphCaption = grCaption.Text
  241.  Else
  242.   frmGraphA.Graph1.DrawMode = 0
  243.  End If
  244.  
  245.  frmGraphA.Graph1.GraphTitle = grTitle.Text
  246.  frmGraphA.Graph1.LeftTitle = grLeftTitle.Text
  247.  frmGraphA.Graph1.BottomTitle = grBottomTitle.Text
  248.  frmGraphA.Graph1.GraphType = (grType.ListIndex) + 1
  249.  frmGraphA.Graph1.GridStyle = (grGridStyle.ListIndex)
  250.  frmGraphA.Caption = wtitle.Text
  251.  
  252.  label$ = grLabel.List(grLabel.ListIndex)
  253.  value$ = grValue.List(grValue.ListIndex)
  254.  
  255.  frmGraphO.Hide
  256.  
  257.  On Error GoTo GraphError
  258.  
  259.  Call SimpleGraph(frmGraphA.Graph1, GraphDyn, label$, value$)
  260.  
  261.  frmGraphA.Show MODAL
  262.  Unload frmGraphO
  263.  Exit Sub
  264.  
  265. GraphError:
  266.  Call RaiseError("Error", "Cannot draw graph. Check your data.")
  267.  Unload frmGraphO
  268.  Exit Sub
  269.  
  270.  
  271. End Sub
  272.  
  273. Sub grBottomTitle_Change ()
  274.  
  275.  grBottomTitle.SelStart = 0
  276.  grBottomTitle.SelLength = Len(grBottomTitle.Text)
  277.  
  278. End Sub
  279.  
  280. Sub grCaption_GotFocus ()
  281.  
  282.  grCaption.SelStart = 0
  283.  grCaption.SelLength = Len(grCaption.Text)
  284.  
  285. End Sub
  286.  
  287. Sub grLeftTitle_Change ()
  288.  
  289.  grLeftTitle.SelStart = 0
  290.  grLeftTitle.SelLength = Len(grLeftTitle.Text)
  291.  
  292. End Sub
  293.  
  294. Sub grTitle_GotFocus ()
  295.  
  296.  grTitle.SelStart = 0
  297.  grTitle.SelLength = Len(grTitle.Text)
  298.  
  299. End Sub
  300.  
  301. Sub wtitle_GotFocus ()
  302.  
  303.  wtitle.SelStart = 0
  304.  wtitle.SelLength = Len(wtitle.Text)
  305.  
  306. End Sub
  307.  
  308.