home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 4 Unleashed / Visual_Basic_4_Unleashed_SAMS_Publishing_1995.iso / crystal / extras / crpedemo / graphopt.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1994-12-15  |  7.7 KB  |  235 lines

  1. VERSION 2.00
  2. Begin Form Graphoptions 
  3.    BackColor       =   &H00C0C0C0&
  4.    Caption         =   "Graph Options"
  5.    ClientHeight    =   4740
  6.    ClientLeft      =   1695
  7.    ClientTop       =   1980
  8.    ClientWidth     =   6615
  9.    Height          =   5145
  10.    Left            =   1635
  11.    LinkTopic       =   "Form4"
  12.    ScaleHeight     =   4740
  13.    ScaleWidth      =   6615
  14.    Top             =   1635
  15.    Width           =   6735
  16.    Begin CommandButton OptionsHelp 
  17.       Caption         =   "Help"
  18.       Height          =   375
  19.       Left            =   4350
  20.       TabIndex        =   11
  21.       Top             =   4095
  22.       Width           =   1605
  23.    End
  24.    Begin CommandButton OptionsCancel 
  25.       Caption         =   "Cancel"
  26.       Height          =   375
  27.       Left            =   2550
  28.       TabIndex        =   10
  29.       Top             =   4095
  30.       Width           =   1635
  31.    End
  32.    Begin CommandButton OptionsOK 
  33.       Caption         =   "OK"
  34.       Height          =   375
  35.       Left            =   750
  36.       TabIndex        =   9
  37.       Top             =   4095
  38.       Width           =   1635
  39.    End
  40.    Begin SSFrame OptionsFrame 
  41.       Caption         =   "Options"
  42.       Font3D          =   0  'None
  43.       ForeColor       =   &H00000000&
  44.       Height          =   3525
  45.       Left            =   240
  46.       TabIndex        =   0
  47.       Top             =   270
  48.       Width           =   6135
  49.       Begin SSFrame RangeFrame 
  50.          Caption         =   "Range of Values"
  51.          Font3D          =   0  'None
  52.          ForeColor       =   &H00000000&
  53.          Height          =   870
  54.          Left            =   270
  55.          TabIndex        =   6
  56.          Top             =   2295
  57.          Width           =   5535
  58.          Begin TextBox MaxText 
  59.             Height          =   330
  60.             Left            =   3360
  61.             TabIndex        =   8
  62.             Top             =   360
  63.             Width           =   1335
  64.          End
  65.          Begin TextBox MinText 
  66.             Height          =   330
  67.             Left            =   990
  68.             TabIndex        =   7
  69.             Top             =   360
  70.             Width           =   1335
  71.          End
  72.          Begin Label MaxLabel 
  73.             BackColor       =   &H00C0C0C0&
  74.             Caption         =   "Maximum:"
  75.             Height          =   240
  76.             Left            =   2430
  77.             TabIndex        =   14
  78.             Top             =   405
  79.             Width           =   975
  80.          End
  81.          Begin Label MinLabel 
  82.             BackColor       =   &H00C0C0C0&
  83.             Caption         =   "Minimum:"
  84.             Height          =   240
  85.             Left            =   150
  86.             TabIndex        =   13
  87.             Top             =   405
  88.             Width           =   915
  89.          End
  90.       End
  91.       Begin SSOption VertOption 
  92.          Caption         =   "Vertical"
  93.          Font3D          =   0  'None
  94.          Height          =   285
  95.          Left            =   3120
  96.          TabIndex        =   5
  97.          Top             =   1845
  98.          Width           =   1245
  99.       End
  100.       Begin SSOption HorizOption 
  101.          Caption         =   "Horizontal"
  102.          Font3D          =   0  'None
  103.          Height          =   285
  104.          Left            =   1860
  105.          TabIndex        =   4
  106.          Top             =   1845
  107.          Width           =   1215
  108.       End
  109.       Begin SSCheck ShowValuesCheck 
  110.          Caption         =   "Show Values on Risers"
  111.          Font3D          =   0  'None
  112.          Height          =   240
  113.          Left            =   300
  114.          TabIndex        =   3
  115.          Top             =   1350
  116.          Width           =   2445
  117.       End
  118.       Begin SSCheck ShowGridCheck 
  119.          Caption         =   "Show Grid Lines"
  120.          Font3D          =   0  'None
  121.          Height          =   330
  122.          Left            =   330
  123.          TabIndex        =   2
  124.          Top             =   900
  125.          Width           =   1965
  126.       End
  127.       Begin SSCheck ShowLegendCheck 
  128.          Caption         =   "Show Legend"
  129.          Font3D          =   0  'None
  130.          Height          =   330
  131.          Left            =   300
  132.          TabIndex        =   1
  133.          Top             =   495
  134.          Width           =   1875
  135.       End
  136.       Begin Label DirectionLabel 
  137.          BackColor       =   &H00C0C0C0&
  138.          Caption         =   "Direction of Bars:"
  139.          Height          =   240
  140.          Left            =   300
  141.          TabIndex        =   12
  142.          Top             =   1890
  143.          Width           =   1545
  144.       End
  145.    End
  146. Dim Legend As Integer
  147. Dim Grid As Integer
  148. Dim Riser As Integer
  149. Dim Horiz As Integer
  150. Dim Vert As Integer
  151. Sub Form_Load ()
  152. 'Declare Structure
  153.     Dim GraphOptions As PEGraphOptions
  154.     GraphOptions.StructSize = Len(GraphOptions)
  155.     GraphOptions.GraphMaxValue = 0
  156.     GraphOptions.GraphMinValue = 0
  157.     GraphOptions.ShowDataValue = 0
  158.     GraphOptions.ShowGridLine = 0
  159.     GraphOptions.VerticalBars = 0
  160.     GraphOptions.ShowLegend = 0
  161.     GraphOptions.FontFaceName = Chr$(0)
  162. 'Get the Graph Text back from existing graph in RPT file
  163. 'allow user to modify text
  164.     If PEGetGraphOptions(JobNum, SCode, GraphNo, GraphOptions) = 1 Then
  165.         MaxText.Text = Str(GraphOptions.GraphMaxValue)
  166.         MinText.Text = Str(GraphOptions.GraphMinValue)
  167.         If GraphOptions.ShowDataValue = 0 Then
  168.           ShowValuesCheck.Value = False
  169.         Else
  170.           ShowValuesCheck.Value = True
  171.         End If
  172.         If GraphOptions.ShowGridLine = 0 Then
  173.            ShowGridCheck.Value = False
  174.         Else
  175.            ShowGridCheck.Value = True
  176.         End If
  177.         If GraphOptions.ShowLegend = 0 Then
  178.            ShowLegendCheck.Value = False
  179.         Else
  180.            ShowLegendCheck.Value = True
  181.         End If
  182.         If GraphOptions.VerticalBars = 0 Then
  183.           HorizOption.Value = True
  184.         Else
  185.           VertOption.Value = True
  186.         End If
  187.           
  188.     Else
  189.       RCode = GetErrorString(JobNum)
  190.       MsgBox "PEGetGraphOptions Error #: " + Str(ErrorCode) + " - " + RCode
  191.       Exit Sub
  192.     End If
  193. End Sub
  194. Sub OptionsCancel_Click ()
  195.  Unload Me
  196. End Sub
  197. Sub OptionsHelp_Click ()
  198.   RCode = Shell("Winhelp c:\crw\crw.hlp", 3)
  199. End Sub
  200. Sub OptionsOK_Click ()
  201. 'Declare Structure and populate via dialogue input
  202.     Dim GraphOptions As PEGraphOptions
  203.     GraphOptions.StructSize = Len(GraphOptions)
  204.     GraphOptions.GraphMaxValue = Val(MaxText)
  205.     GraphOptions.GraphMinValue = Val(MinText)
  206.     GraphOptions.ShowDataValue = ShowValuesCheck.Value
  207.     GraphOptions.ShowGridLine = ShowGridCheck.Value
  208.     If HorizOption.Value = True Then
  209.        GraphOptions.VerticalBars = HorizOption.Value
  210.     Else
  211.        GraphOptions.VerticalBars = VertOption.Value
  212.     End If
  213.     GraphOptions.ShowLegend = ShowLegendCheck.Value
  214. 'Set the Graph Options based on the user input in the dialogue
  215. 'The users input will fill in the structure as specified above
  216.     If PESetGraphOptions(JobNum, SCode, GraphNo, GraphOptions) = 1 Then
  217.         MaxText.Text = Str(GraphOptions.GraphMaxValue)
  218.         MinText.Text = Str(GraphOptions.GraphMinValue)
  219.         ShowValuesCheck.Value = GraphOptions.ShowDataValue
  220.         ShowGridCheck.Value = GraphOptions.ShowGridLine
  221.         ShowLegendCheck.Value = GraphOptions.ShowLegend
  222.         If GraphOptions.VerticalBars = 0 Then
  223.           HorizOption.Value = True
  224.         Else
  225.           VertOption.Value = True
  226.         End If
  227.         Main!StatusBar.Caption = "Graph Options Set."
  228.     Else
  229.       RCode = GetErrorString(JobNum)
  230.       MsgBox "PESetGraphOptions Error #: " + Str(ErrorCode) + " - " + RCode
  231.       Exit Sub
  232.     End If
  233.  Unload Me
  234. End Sub
  235.