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

  1. VERSION 2.00
  2. Begin Form Font 
  3.    BackColor       =   &H00C0C0C0&
  4.    Caption         =   "Field Types"
  5.    ClientHeight    =   1635
  6.    ClientLeft      =   4425
  7.    ClientTop       =   2715
  8.    ClientWidth     =   5280
  9.    Height          =   2040
  10.    Left            =   4365
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   1635
  13.    ScaleWidth      =   5280
  14.    Top             =   2370
  15.    Width           =   5400
  16.    Begin SSFrame Frame3D1 
  17.       Caption         =   "Field Types to Modify"
  18.       Font3D          =   0  'None
  19.       ForeColor       =   &H00000000&
  20.       Height          =   1410
  21.       Left            =   180
  22.       TabIndex        =   6
  23.       Top             =   90
  24.       Width           =   3345
  25.       Begin SSOption Option3D2 
  26.          Caption         =   "Both"
  27.          Font3D          =   0  'None
  28.          Height          =   195
  29.          Index           =   2
  30.          Left            =   180
  31.          TabIndex        =   0
  32.          TabStop         =   0   'False
  33.          Top             =   990
  34.          Width           =   1275
  35.       End
  36.       Begin SSOption Option3D2 
  37.          Caption         =   "All Fields in Section"
  38.          Font3D          =   0  'None
  39.          Height          =   285
  40.          Index           =   1
  41.          Left            =   180
  42.          TabIndex        =   1
  43.          TabStop         =   0   'False
  44.          Top             =   585
  45.          Width           =   1995
  46.       End
  47.       Begin SSOption Option3D2 
  48.          Caption         =   "All Text in Section"
  49.          Font3D          =   0  'None
  50.          Height          =   195
  51.          Index           =   0
  52.          Left            =   180
  53.          TabIndex        =   5
  54.          Top             =   315
  55.          Value           =   -1  'True
  56.          Width           =   1815
  57.       End
  58.    End
  59.    Begin CommonDialog CMDialog1 
  60.       CancelError     =   -1  'True
  61.       FontName        =   "Arial"
  62.       FontSize        =   10
  63.       Left            =   1530
  64.       Top             =   1980
  65.    End
  66.    Begin CommandButton Command3 
  67.       Caption         =   "Cancel"
  68.       Height          =   375
  69.       Left            =   3690
  70.       TabIndex        =   4
  71.       Top             =   855
  72.       Width           =   1365
  73.    End
  74.    Begin CommandButton Command1 
  75.       Caption         =   "Ok"
  76.       Height          =   375
  77.       Left            =   3690
  78.       TabIndex        =   3
  79.       Top             =   405
  80.       Width           =   1365
  81.    End
  82.    Begin SSPanel Statusbar 
  83.       Alignment       =   1  'Left Justify - MIDDLE
  84.       BackColor       =   &H00C0C0C0&
  85.       BorderWidth     =   1
  86.       Font3D          =   0  'None
  87.       Height          =   510
  88.       Left            =   0
  89.       TabIndex        =   2
  90.       Top             =   4905
  91.       Width           =   6675
  92.    End
  93. Sub Command1_Click ()
  94.     'Critical Error Checking, mainly for if user hits cancel in common dialogue
  95.     On Error GoTo FontErr
  96.     'Set Common dialogue flags
  97.     CMDialog1.Flags = &H2& Or &H200& Or &H100&
  98.     'Call the common dialogue for fonts
  99.     CMDialog1.Action = 4
  100.     'User specifies fontname, store this name in a variable to use in PESetFont
  101.      CRWFontName = CMDialog1.FontName
  102.     'User specifies fontsize, store this name in a variable to use in PESetFont
  103.     CRWFontSize = CMDialog1.FontSize
  104.     'User specifies fontItalics or not, store this True or False in a variable to use in PESetFont.
  105.     If CMDialog1.FontItalic = True Then
  106.        CRWFontItalic = 1
  107.     Else
  108.        CRWFontItalic = 0
  109.     End If
  110.      
  111.     'User specifies font underline, store this True or false in a variable to use in PESetFont.
  112.     If CMDialog1.FontUnderLine = True Then
  113.        CRWFontUnderline = 1
  114.     Else
  115.        CRWFontUnderline = 0
  116.     End If
  117. 'User specifies fontstrikethru, store this true or False in a variable to use in PESetFont
  118.     If CMDialog1.FontStrikeThru = True Then
  119.        CRWFontStrikeThru = 1
  120.     Else
  121.        CRWFontStrikeThru = 0
  122.     End If
  123. MsgBox Str(SectionCode)
  124.    'Set the Font using PESetFont
  125.    If PESetFont(JobNum, SectionCode, ScopeCode, CRWFontName, 0, 0, 0, CRWFontSize, CRWFontItalic, CRWFontUnderline, CRWFontStrikeThru, 0) = False Then
  126.       RCode = GetErrorString(JobNum)
  127.       MsgBox "PESetFont Error #: " + Str(ErrorCode) + " - " + RCode
  128.       Exit Sub
  129.    Else
  130.         Font!Statusbar.Caption = "Section Fonts have been modified!"
  131.    End If
  132.    Unload Me
  133.    Exit Sub
  134. FontErr:
  135.   'MsgBox "User hit Cancel"
  136. Exit Sub
  137. End Sub
  138. Sub Command2_Click ()
  139.  Unload Me
  140. End Sub
  141. Sub Command3_Click ()
  142.   Unload Me
  143. End Sub
  144. Sub FontFile_Click ()
  145.  Unload Me
  146. End Sub
  147. Sub Form_Load ()
  148.   ScopeCode = 2
  149. End Sub
  150. Sub Option3D1_Click (Index As Integer, Value As Integer)
  151.    Select Case Index
  152.     Case 0:
  153.       SectionCode = 0    'PE_AllSections
  154.     Case 1:
  155.       SectionCode = 2000 'PE_HeaderSection
  156.     Case 2:
  157.       SectionCode = 3000 'PE_GroupHeader
  158.     Case 3:
  159.       SectionCode = 4000 'PE_DetailSection
  160.     Case 4:
  161.       SectionCode = 5000 'PE_GroupFooter
  162.     Case 5:
  163.       SectionCode = 7000 'PE_FooterSection
  164.     Case 6:
  165.       SectionCode = 6000 'PE_GrandTotalSection
  166.    End Select
  167. End Sub
  168. Sub Option3D2_Click (Index As Integer, Value As Integer)
  169.    Select Case Index
  170.     Case 0:
  171.       ScopeCode = 2 'PE_Text
  172.     Case 1:
  173.       ScopeCode = 1  'PE_Fields
  174.     Case 2:
  175.       ScopeCode = 1 Or 2  'PE_Text Or PE_Fields
  176.    End Select
  177. End Sub
  178.