home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 4 Unleashed / Visual_Basic_4_Unleashed_SAMS_Publishing_1995.iso / crystal / extras / crpedemo / graphtxt.frm < prev    next >
Text File  |  1994-12-14  |  8KB  |  251 lines

  1. VERSION 2.00
  2. Begin Form GraphText 
  3.    BackColor       =   &H00C0C0C0&
  4.    Caption         =   "Graph Text"
  5.    ClientHeight    =   5670
  6.    ClientLeft      =   1485
  7.    ClientTop       =   1710
  8.    ClientWidth     =   6855
  9.    Height          =   6075
  10.    Left            =   1425
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   5670
  13.    ScaleWidth      =   6855
  14.    Top             =   1365
  15.    Width           =   6975
  16.    Begin CommandButton Command3 
  17.       Caption         =   "Help"
  18.       Height          =   390
  19.       Left            =   4350
  20.       TabIndex        =   10
  21.       Top             =   5040
  22.       Width           =   1515
  23.    End
  24.    Begin CommandButton Command2 
  25.       Caption         =   "Cancel"
  26.       Height          =   390
  27.       Left            =   2670
  28.       TabIndex        =   9
  29.       Top             =   5040
  30.       Width           =   1515
  31.    End
  32.    Begin CommandButton Command1 
  33.       Caption         =   "OK"
  34.       Height          =   360
  35.       Left            =   990
  36.       TabIndex        =   8
  37.       Top             =   5040
  38.       Width           =   1515
  39.    End
  40.    Begin SSFrame Frame3D1 
  41.       Font3D          =   0  'None
  42.       Height          =   4575
  43.       Left            =   180
  44.       TabIndex        =   11
  45.       Top             =   180
  46.       Width           =   6435
  47.       Begin TextBox Text8 
  48.          Height          =   405
  49.          Left            =   2250
  50.          TabIndex        =   7
  51.          Top             =   3645
  52.          Width           =   3495
  53.       End
  54.       Begin TextBox Text7 
  55.          Height          =   405
  56.          Left            =   2250
  57.          TabIndex        =   6
  58.          Top             =   3150
  59.          Width           =   3495
  60.       End
  61.       Begin TextBox Text6 
  62.          Height          =   405
  63.          Left            =   2250
  64.          TabIndex        =   5
  65.          Top             =   2670
  66.          Width           =   3495
  67.       End
  68.       Begin TextBox Text5 
  69.          Height          =   405
  70.          Left            =   2250
  71.          TabIndex        =   4
  72.          Top             =   2205
  73.          Width           =   3495
  74.       End
  75.       Begin TextBox Text4 
  76.          Height          =   405
  77.          Left            =   2250
  78.          TabIndex        =   3
  79.          Top             =   1710
  80.          Width           =   3495
  81.       End
  82.       Begin TextBox Text3 
  83.          Height          =   405
  84.          Left            =   2250
  85.          TabIndex        =   2
  86.          Top             =   1215
  87.          Width           =   3495
  88.       End
  89.       Begin TextBox Text2 
  90.          Height          =   405
  91.          Left            =   2250
  92.          TabIndex        =   1
  93.          Top             =   750
  94.          Width           =   3495
  95.       End
  96.       Begin TextBox Text1 
  97.          Height          =   405
  98.          Left            =   2250
  99.          TabIndex        =   0
  100.          Top             =   225
  101.          Width           =   3495
  102.       End
  103.       Begin Label Label8 
  104.          BackColor       =   &H00C0C0C0&
  105.          Caption         =   "ZAxis Title:"
  106.          Height          =   225
  107.          Left            =   450
  108.          TabIndex        =   19
  109.          Top             =   3690
  110.          Width           =   1155
  111.       End
  112.       Begin Label Label7 
  113.          BackColor       =   &H00C0C0C0&
  114.          Caption         =   "YAxis Title:"
  115.          Height          =   225
  116.          Left            =   450
  117.          TabIndex        =   18
  118.          Top             =   3240
  119.          Width           =   1125
  120.       End
  121.       Begin Label Label6 
  122.          BackColor       =   &H00C0C0C0&
  123.          Caption         =   "XAxis Title:"
  124.          Height          =   255
  125.          Left            =   450
  126.          TabIndex        =   17
  127.          Top             =   2760
  128.          Width           =   1275
  129.       End
  130.       Begin Label Label5 
  131.          BackColor       =   &H00C0C0C0&
  132.          Caption         =   "Series Title:"
  133.          Height          =   255
  134.          Left            =   450
  135.          TabIndex        =   16
  136.          Top             =   2220
  137.          Width           =   1335
  138.       End
  139.       Begin Label Label4 
  140.          BackColor       =   &H00C0C0C0&
  141.          Caption         =   "Groups Title:"
  142.          Height          =   255
  143.          Left            =   450
  144.          TabIndex        =   15
  145.          Top             =   1740
  146.          Width           =   1215
  147.       End
  148.       Begin Label Label3 
  149.          BackColor       =   &H00C0C0C0&
  150.          Caption         =   "Footnote:"
  151.          Height          =   225
  152.          Left            =   450
  153.          TabIndex        =   14
  154.          Top             =   1320
  155.          Width           =   1575
  156.       End
  157.       Begin Label Label2 
  158.          BackColor       =   &H00C0C0C0&
  159.          Caption         =   "SubTitle:"
  160.          Height          =   285
  161.          Left            =   450
  162.          TabIndex        =   13
  163.          Top             =   810
  164.          Width           =   1545
  165.       End
  166.       Begin Label Label1 
  167.          BackColor       =   &H00C0C0C0&
  168.          Caption         =   "Title:"
  169.          Height          =   285
  170.          Left            =   450
  171.          TabIndex        =   12
  172.          Top             =   300
  173.          Width           =   1245
  174.       End
  175.    End
  176. End
  177.  
  178. Sub Command1_Click ()
  179.    'Delcare Structure which retrieve Graph Text information
  180.  
  181.     Dim GraphTextInfo As PEGraphTextInfo
  182.     GraphTextInfo.StructSize = Len(GraphTextInfo)
  183.     GraphTextInfo.GraphTitle = Text1.Text + Chr$(0)
  184.     GraphTextInfo.GraphSubTitle = Text2.Text + Chr$(0)
  185.     GraphTextInfo.GraphFootNote = Text3.Text + Chr$(0)
  186.     GraphTextInfo.GraphGroupsTitle = Text4.Text + Chr$(0)
  187.     GraphTextInfo.GraphSeriesTitle = Text5.Text + Chr$(0)
  188.     GraphTextInfo.GraphXAxisTitle = Text6.Text + Chr$(0)
  189.     GraphTextInfo.GraphYAxisTitle = Text7.Text + Chr$(0)
  190.     GraphTextInfo.GraphZAxisTitle = Text8.Text + Chr$(0)
  191.  
  192.     'Set the Graph Text information based on user modifications
  193.  
  194.     If PESetGraphText(JobNum, SCode, GraphNo, GraphTextInfo) = False Then
  195.       RCode = GetErrorString(JobNum)
  196.       MsgBox "PESetGraphText Error #: " + Str(ErrorCode) + " - " + RCode
  197.       Exit Sub
  198.     Else
  199.       Main!StatusBar.Caption = "Graph Text Set."
  200.     End If
  201.     
  202.  
  203.     Unload Me
  204. End Sub
  205.  
  206. Sub Command2_Click ()
  207.  Unload Me
  208. End Sub
  209.  
  210. Sub Command3_Click ()
  211. RCode = Shell("Winhelp c:\crw\crw.hlp", 3)
  212. End Sub
  213.  
  214. Sub Form_Load ()
  215.  
  216.  
  217. 'Declare Structure
  218.     Dim GraphTextInfo As PEGraphTextInfo
  219.     GraphTextInfo.StructSize = Len(GraphTextInfo)
  220.     GraphTextInfo.GraphTitle = Chr$(0)
  221.     GraphTextInfo.GraphSubTitle = Chr$(0)
  222.     GraphTextInfo.GraphFootNote = Chr$(0)
  223.     GraphTextInfo.GraphGroupsTitle = Chr$(0)
  224.     GraphTextInfo.GraphSeriesTitle = Chr$(0)
  225.     GraphTextInfo.GraphXAxisTitle = Chr$(0)
  226.     GraphTextInfo.GraphYAxisTitle = Chr$(0)
  227.     GraphTextInfo.GraphZAxisTitle = Chr$(0)
  228.  
  229. 'Get the Graph Text back from existing graph in RPT file
  230. 'allow user to modify text. Stuff the text boxes with the
  231. 'appropriate structure item
  232.  
  233.     If PEGetGraphText(JobNum, SCode, GraphNo, GraphTextInfo) = 1 Then
  234.         Text1.Text = GraphTextInfo.GraphTitle
  235.         Text2.Text = GraphTextInfo.GraphSubTitle
  236.         Text3.Text = GraphTextInfo.GraphFootNote
  237.         Text4.Text = GraphTextInfo.GraphGroupsTitle
  238.         Text5.Text = GraphTextInfo.GraphSeriesTitle
  239.         Text6.Text = GraphTextInfo.GraphXAxisTitle
  240.         Text7.Text = GraphTextInfo.GraphYAxisTitle
  241.         Text8.Text = GraphTextInfo.GraphZAxisTitle
  242.     Else
  243.       RCode = GetErrorString(JobNum)
  244.       MsgBox "PEGetGraphText Error #: " + Str(ErrorCode) + " - " + RCode
  245.       Exit Sub
  246.     End If
  247.   
  248.  
  249. End Sub
  250.  
  251.