home *** CD-ROM | disk | FTP | other *** search
/ The Best of Select: Windows 95 Special 2 / WIN95_2.bin / utils / envelop / envelop.6 / Tools / Bootcamp / basic / apifont / apifont.eto < prev    next >
Encoding:
Text File  |  1996-07-08  |  5.8 KB  |  192 lines

  1. Type APIFontMasterForm From SampleMasterForm
  2.   Dim btnSetFont As New Button
  3.   Dim Label1 As New Label
  4.   Dim lblTest As New Label
  5.   Dim TestFont As New Font
  6.   Dim FontPanel As New FontDialog
  7.   Dim Label2 As New Label
  8.   Dim lblFaceName As New Label
  9.   Dim Label4 As New Label
  10.   Dim lblColor As New Label
  11.   Dim Label6 As New Label
  12.   Dim lblSize As New Label
  13.   Dim Label8 As New Label
  14.   Dim lblBold As New Label
  15.   Dim Label10 As New Label
  16.   Dim Label11 As New Label
  17.   Dim Label12 As New Label
  18.   Dim lblItalic As New Label
  19.   Dim lblUnderline As New Label
  20.   Dim lblStrikethru As New Label
  21.  
  22.   ' METHODS for object: APIFontMasterForm
  23.   Sub btnSetFont_Click()
  24.     FontPanel.Title = "Choose font properties"
  25.     ' Post the FontPanel
  26.     FontPanel.Execute
  27.   
  28.     ' Set font attributes to test label
  29.     TestFont.Bold = FontPanel.Bold
  30.     TestFont.FaceName = FontPanel.FaceName
  31.     TestFont.Italic = FontPanel.Italic
  32.     TestFont.Size = FontPanel.Size
  33.     TestFont.Strikethru = FontPanel.Strikethru
  34.     TestFont.Underline = FontPanel.Underline
  35.   
  36.     ' Update the foreground color
  37.     lblTest.ForeColor = FontPanel.Color
  38.   
  39.     ' Update the status properties
  40.     lblFaceName.Caption = FontPanel.FaceName
  41.     lblColor.Caption = FontPanel.Color
  42.     lblSize.Caption = FontPanel.Size
  43.     lblBold.Caption = FontPanel.Bold
  44.     lblItalic.Caption = FontPanel.Italic
  45.     lblUnderline.Caption = FontPanel.Underline
  46.     lblStrikethru.Caption = FontPanel.Strikethru
  47.   
  48.   End Sub
  49.  
  50.   Sub ResetApplication_Click ()
  51.   
  52.     ' Initialize Font Dialog Demonstration
  53.   
  54.     ' Set font attributes to test label
  55.     TestFont.Bold = "True"
  56.     TestFont.FaceName = "System"
  57.     TestFont.Italic = "False"
  58.     TestFont.Size = 12
  59.     TestFont.Strikethru = "False"
  60.     TestFont.Underline = "False"
  61.   
  62.     ' Set the default foreground color
  63.     lblTest.ForeColor = -1
  64.   
  65.     ' Update the status properties
  66.     lblFaceName.Caption = TestFont.FaceName
  67.     lblColor.Caption = lblTest.ForeColor
  68.     lblSize.Caption = TestFont.Size
  69.     lblBold.Caption = TestFont.Bold
  70.     lblItalic.Caption = TestFont.Italic
  71.     lblUnderline.Caption = TestFont.Underline
  72.     lblStrikethru.Caption = TestFont.Strikethru
  73.   
  74.   End Sub
  75.  
  76. End Type
  77.  
  78. Begin Code
  79. ' Reconstruction commands for object: APIFontMasterForm
  80. '
  81.   With APIFontMasterForm
  82.     .Caption := "Windows Font Dialog Demonstration"
  83.     .Move(5205, 1335, 6885, 5340)
  84.     .SampleDir := "W:\Examples\apifont\"
  85.     .SampleName := "apifont"
  86.     With .btnSetFont
  87.       .Caption := "SetFont"
  88.       .Move(2700, 3900, 1650, 450)
  89.     End With  'APIFontMasterForm.btnSetFont
  90.     With .Label1
  91.       .Caption := "1. Click SetFont button to select font properties."
  92.       .ForeColor := 13107200
  93.       .Move(300, 300, 5250, 300)
  94.     End With  'APIFontMasterForm.Label1
  95.     With .lblTest
  96.       .Caption := "Font Test"
  97.       .BackColor := 16777215
  98.       .ForeColor := 8388608
  99.       .Font := APIFontMasterForm.TestFont
  100.       .Move(450, 750, 5850, 1350)
  101.       .BorderStyle := "Fixed Single"
  102.       .Alignment := "Center"
  103.     End With  'APIFontMasterForm.lblTest
  104.     With .TestFont
  105.       .FaceName := "Matura MT Script Capitals"
  106.       .Size := 15
  107.       .Italic := True
  108.     End With  'APIFontMasterForm.TestFont
  109.     With .FontPanel
  110.       .FaceName := "Matura MT Script Capitals"
  111.       .Size := 16
  112.       .Bold := True
  113.       .Italic := True
  114.       .Color := 8388608
  115.       .Title := "Choose font properties"
  116.     End With  'APIFontMasterForm.FontPanel
  117.     With .Label2
  118.       .Caption := "FaceName:"
  119.       .ForeColor := 13107200
  120.       .Move(450, 2400, 1350, 300)
  121.       .Alignment := "Right"
  122.     End With  'APIFontMasterForm.Label2
  123.     With .lblFaceName
  124.       .Caption := "Matura MT Script Capitals"
  125.       .Move(1950, 2400, 4350, 300)
  126.     End With  'APIFontMasterForm.lblFaceName
  127.     With .Label4
  128.       .Caption := "Color:"
  129.       .ForeColor := 13107200
  130.       .Move(450, 2700, 1350, 300)
  131.       .Alignment := "Right"
  132.     End With  'APIFontMasterForm.Label4
  133.     With .lblColor
  134.       .Caption := "8388608"
  135.       .Move(1950, 2700, 2235, 300)
  136.     End With  'APIFontMasterForm.lblColor
  137.     With .Label6
  138.       .Caption := "Size:"
  139.       .ForeColor := 13107200
  140.       .Move(450, 3000, 1350, 300)
  141.       .Alignment := "Right"
  142.     End With  'APIFontMasterForm.Label6
  143.     With .lblSize
  144.       .Caption := "16"
  145.       .Move(1950, 3000, 2235, 300)
  146.     End With  'APIFontMasterForm.lblSize
  147.     With .Label8
  148.       .Caption := "Bold:"
  149.       .ForeColor := 13107200
  150.       .Move(450, 3300, 1350, 300)
  151.       .Alignment := "Right"
  152.     End With  'APIFontMasterForm.Label8
  153.     With .lblBold
  154.       .Caption := "True"
  155.       .Move(1950, 3300, 2235, 300)
  156.     End With  'APIFontMasterForm.lblBold
  157.     With .Label10
  158.       .Caption := "Italic:"
  159.       .ForeColor := 13107200
  160.       .Move(4350, 2700, 1050, 300)
  161.       .Alignment := "Right"
  162.     End With  'APIFontMasterForm.Label10
  163.     With .Label11
  164.       .Caption := "Underline:"
  165.       .ForeColor := 13107200
  166.       .Move(4350, 3000, 1050, 300)
  167.       .Alignment := "Right"
  168.     End With  'APIFontMasterForm.Label11
  169.     With .Label12
  170.       .Caption := "Strikethru:"
  171.       .ForeColor := 13107200
  172.       .Move(4350, 3300, 1050, 300)
  173.       .Alignment := "Right"
  174.     End With  'APIFontMasterForm.Label12
  175.     With .lblItalic
  176.       .Caption := "True"
  177.       .Move(5550, 2700, 750, 300)
  178.     End With  'APIFontMasterForm.lblItalic
  179.     With .lblUnderline
  180.       .Caption := "False"
  181.       .Move(5550, 3000, 750, 300)
  182.     End With  'APIFontMasterForm.lblUnderline
  183.     With .lblStrikethru
  184.       .Caption := "False"
  185.       .Move(5550, 3300, 750, 300)
  186.     End With  'APIFontMasterForm.lblStrikethru
  187.     With .helpfile
  188.       .FileName := "W:\Examples\apifont\apifont.hlp"
  189.     End With  'APIFontMasterForm.helpfile
  190.   End With  'APIFontMasterForm
  191. End Code
  192.