home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 4 Unleashed / Visual_Basic_4_Unleashed_SAMS_Publishing_1995.iso / crystal / extras / crpedemo / graphopt.frm < prev    next >
Text File  |  1994-12-14  |  8KB  |  254 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. End
  147. Dim Legend As Integer
  148. Dim Grid As Integer
  149. Dim Riser As Integer
  150. Dim Horiz As Integer
  151. Dim Vert As Integer
  152.  
  153. Sub Form_Load ()
  154. 'Declare Structure
  155.     Dim GraphOptions As PEGraphOptions
  156.     GraphOptions.StructSize = Len(GraphOptions)
  157.     GraphOptions.GraphMaxValue = 0
  158.     GraphOptions.GraphMinValue = 0
  159.     GraphOptions.ShowDataValue = 0
  160.     GraphOptions.ShowGridLine = 0
  161.     GraphOptions.VerticalBars = 0
  162.     GraphOptions.ShowLegend = 0
  163.     GraphOptions.FontFaceName = Chr$(0)
  164.     
  165.  
  166. 'Get the Graph Text back from existing graph in RPT file
  167. 'allow user to modify text
  168.  
  169.     If PEGetGraphOptions(JobNum, SCode, GraphNo, GraphOptions) = 1 Then
  170.         MaxText.Text = Str(GraphOptions.GraphMaxValue)
  171.         MinText.Text = Str(GraphOptions.GraphMinValue)
  172.         If GraphOptions.ShowDataValue = 0 Then
  173.           ShowValuesCheck.Value = False
  174.         Else
  175.           ShowValuesCheck.Value = True
  176.         End If
  177.         If GraphOptions.ShowGridLine = 0 Then
  178.            ShowGridCheck.Value = False
  179.         Else
  180.            ShowGridCheck.Value = True
  181.         End If
  182.         If GraphOptions.ShowLegend = 0 Then
  183.            ShowLegendCheck.Value = False
  184.         Else
  185.            ShowLegendCheck.Value = True
  186.         End If
  187.         If GraphOptions.VerticalBars = 0 Then
  188.           HorizOption.Value = True
  189.         Else
  190.           VertOption.Value = True
  191.         End If
  192.           
  193.     Else
  194.       RCode = GetErrorString(JobNum)
  195.       MsgBox "PEGetGraphOptions Error #: " + Str(ErrorCode) + " - " + RCode
  196.       Exit Sub
  197.     End If
  198.   
  199. End Sub
  200.  
  201. Sub OptionsCancel_Click ()
  202.  Unload Me
  203. End Sub
  204.  
  205. Sub OptionsHelp_Click ()
  206.   RCode = Shell("Winhelp c:\crw\crw.hlp", 3)
  207. End Sub
  208.  
  209. Sub OptionsOK_Click ()
  210.  
  211. 'Declare Structure and populate via dialogue input
  212.     Dim GraphOptions As PEGraphOptions
  213.     GraphOptions.StructSize = Len(GraphOptions)
  214.     GraphOptions.GraphMaxValue = Val(MaxText)
  215.     GraphOptions.GraphMinValue = Val(MinText)
  216.     GraphOptions.ShowDataValue = ShowValuesCheck.Value
  217.     GraphOptions.ShowGridLine = ShowGridCheck.Value
  218.     If HorizOption.Value = True Then
  219.        GraphOptions.VerticalBars = HorizOption.Value
  220.     Else
  221.        GraphOptions.VerticalBars = VertOption.Value
  222.     End If
  223.     GraphOptions.ShowLegend = ShowLegendCheck.Value
  224.     
  225.     
  226.  
  227. 'Set the Graph Options based on the user input in the dialogue
  228. 'The users input will fill in the structure as specified above
  229.  
  230.  
  231.     If PESetGraphOptions(JobNum, SCode, GraphNo, GraphOptions) = 1 Then
  232.         MaxText.Text = Str(GraphOptions.GraphMaxValue)
  233.         MinText.Text = Str(GraphOptions.GraphMinValue)
  234.         ShowValuesCheck.Value = GraphOptions.ShowDataValue
  235.         ShowGridCheck.Value = GraphOptions.ShowGridLine
  236.         ShowLegendCheck.Value = GraphOptions.ShowLegend
  237.         If GraphOptions.VerticalBars = 0 Then
  238.           HorizOption.Value = True
  239.         Else
  240.           VertOption.Value = True
  241.         End If
  242.         Main!StatusBar.Caption = "Graph Options Set."
  243.     Else
  244.       RCode = GetErrorString(JobNum)
  245.       MsgBox "PESetGraphOptions Error #: " + Str(ErrorCode) + " - " + RCode
  246.       Exit Sub
  247.     End If
  248.   
  249.  
  250.  
  251.  Unload Me
  252. End Sub
  253.  
  254.