home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 4 Power Pack / Visual_Basic4_Power_Pack.bin / vb4files / vbmax3d / 3dtext.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1996-11-20  |  12.7 KB  |  423 lines

  1. VERSION 4.00
  2. Begin VB.Form frm3DText 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "VBMax 3D Effects Demo - Text"
  5.    ClientHeight    =   4755
  6.    ClientLeft      =   2055
  7.    ClientTop       =   3330
  8.    ClientWidth     =   8535
  9.    Height          =   5160
  10.    Icon            =   "3DText.frx":0000
  11.    Left            =   1995
  12.    LinkTopic       =   "Form1"
  13.    LockControls    =   -1  'True
  14.    MaxButton       =   0   'False
  15.    MinButton       =   0   'False
  16.    ScaleHeight     =   4755
  17.    ScaleWidth      =   8535
  18.    ShowInTaskbar   =   0   'False
  19.    Top             =   2985
  20.    Width           =   8655
  21.    Begin VB.Frame Frame4 
  22.       Caption         =   "Effect"
  23.       Height          =   3135
  24.       Left            =   4740
  25.       TabIndex        =   32
  26.       Top             =   1500
  27.       Width           =   2235
  28.       Begin VB.OptionButton optEffect 
  29.          Caption         =   "Projected"
  30.          Height          =   255
  31.          Index           =   8
  32.          Left            =   180
  33.          TabIndex        =   22
  34.          Top             =   2760
  35.          Width           =   1155
  36.       End
  37.       Begin VB.OptionButton optEffect 
  38.          Caption         =   "Outline Left"
  39.          Height          =   255
  40.          Index           =   7
  41.          Left            =   180
  42.          TabIndex        =   21
  43.          Top             =   2460
  44.          Width           =   1275
  45.       End
  46.       Begin VB.OptionButton optEffect 
  47.          Caption         =   "Outline Right"
  48.          Height          =   255
  49.          Index           =   6
  50.          Left            =   180
  51.          TabIndex        =   20
  52.          Top             =   2160
  53.          Width           =   1335
  54.       End
  55.       Begin VB.OptionButton optEffect 
  56.          Caption         =   "Floating"
  57.          Height          =   255
  58.          Index           =   5
  59.          Left            =   180
  60.          TabIndex        =   19
  61.          Top             =   1860
  62.          Width           =   915
  63.       End
  64.       Begin VB.OptionButton optEffect 
  65.          Caption         =   "Embossed Recessed"
  66.          Height          =   255
  67.          Index           =   4
  68.          Left            =   180
  69.          TabIndex        =   18
  70.          Top             =   1560
  71.          Width           =   1995
  72.       End
  73.       Begin VB.OptionButton optEffect 
  74.          Caption         =   "Embossed Raised"
  75.          Height          =   255
  76.          Index           =   3
  77.          Left            =   180
  78.          TabIndex        =   17
  79.          Top             =   1260
  80.          Width           =   1695
  81.       End
  82.       Begin VB.OptionButton optEffect 
  83.          Caption         =   "Recessed"
  84.          Height          =   255
  85.          Index           =   2
  86.          Left            =   180
  87.          TabIndex        =   16
  88.          Top             =   960
  89.          Width           =   1155
  90.       End
  91.       Begin VB.OptionButton optEffect 
  92.          Caption         =   "Raised"
  93.          Height          =   255
  94.          Index           =   1
  95.          Left            =   180
  96.          TabIndex        =   15
  97.          Top             =   660
  98.          Width           =   915
  99.       End
  100.       Begin VB.OptionButton optEffect 
  101.          Caption         =   "Normal"
  102.          Height          =   255
  103.          Index           =   0
  104.          Left            =   180
  105.          TabIndex        =   14
  106.          Top             =   360
  107.          Value           =   -1  'True
  108.          Width           =   915
  109.       End
  110.    End
  111.    Begin VB.Frame Frame3 
  112.       Caption         =   "Shadow"
  113.       Height          =   1215
  114.       Left            =   7140
  115.       TabIndex        =   31
  116.       Top             =   1500
  117.       Width           =   1275
  118.       Begin VB.OptionButton optShadow 
  119.          Caption         =   "Dark"
  120.          Height          =   255
  121.          Index           =   1
  122.          Left            =   240
  123.          TabIndex        =   24
  124.          Top             =   720
  125.          Width           =   795
  126.       End
  127.       Begin VB.OptionButton optShadow 
  128.          Caption         =   "Light"
  129.          Height          =   255
  130.          Index           =   0
  131.          Left            =   240
  132.          TabIndex        =   23
  133.          Top             =   360
  134.          Value           =   -1  'True
  135.          Width           =   795
  136.       End
  137.    End
  138.    Begin VB.Frame Frame2 
  139.       Caption         =   "Font"
  140.       Height          =   3135
  141.       Left            =   1680
  142.       TabIndex        =   28
  143.       Top             =   1500
  144.       Width           =   2895
  145.       Begin VB.ComboBox cboFontNames 
  146.          Height          =   315
  147.          Left            =   180
  148.          Sorted          =   -1  'True
  149.          Style           =   2  'Dropdown List
  150.          TabIndex        =   8
  151.          Top             =   540
  152.          Width           =   2535
  153.       End
  154.       Begin VB.ComboBox cboTextSize 
  155.          Height          =   1740
  156.          Left            =   180
  157.          Style           =   1  'Simple Combo
  158.          TabIndex        =   9
  159.          Top             =   1260
  160.          Width           =   915
  161.       End
  162.       Begin VB.CheckBox chkBold 
  163.          Caption         =   "Bold"
  164.          Height          =   315
  165.          Left            =   1380
  166.          TabIndex        =   10
  167.          Top             =   1620
  168.          Width           =   795
  169.       End
  170.       Begin VB.CheckBox chkItalic 
  171.          Caption         =   "Italic"
  172.          Height          =   315
  173.          Left            =   1380
  174.          TabIndex        =   11
  175.          Top             =   1980
  176.          Width           =   795
  177.       End
  178.       Begin VB.CheckBox chkUnderline 
  179.          Caption         =   "Underline"
  180.          Height          =   315
  181.          Left            =   1380
  182.          TabIndex        =   12
  183.          Top             =   2340
  184.          Width           =   1095
  185.       End
  186.       Begin VB.CheckBox chkStrikeout 
  187.          Caption         =   "Strikeout"
  188.          Height          =   315
  189.          Left            =   1380
  190.          TabIndex        =   13
  191.          Top             =   2700
  192.          Width           =   1095
  193.       End
  194.       Begin VB.Label Label2 
  195.          AutoSize        =   -1  'True
  196.          Caption         =   "Name:"
  197.          Height          =   195
  198.          Left            =   180
  199.          TabIndex        =   30
  200.          Top             =   300
  201.          Width           =   465
  202.       End
  203.       Begin VB.Label Label3 
  204.          AutoSize        =   -1  'True
  205.          Caption         =   "Size:"
  206.          Height          =   195
  207.          Left            =   180
  208.          TabIndex        =   29
  209.          Top             =   1020
  210.          Width           =   345
  211.       End
  212.    End
  213.    Begin VB.Frame Frame1 
  214.       Caption         =   "Color"
  215.       Height          =   3135
  216.       Left            =   120
  217.       TabIndex        =   27
  218.       Top             =   1500
  219.       Width           =   1395
  220.       Begin VB.OptionButton optColor 
  221.          Caption         =   "White"
  222.          ForeColor       =   &H00FFFFFF&
  223.          Height          =   255
  224.          Index           =   8
  225.          Left            =   180
  226.          TabIndex        =   7
  227.          Top             =   2460
  228.          Width           =   1095
  229.       End
  230.       Begin VB.OptionButton optColor 
  231.          Caption         =   "Cyan"
  232.          ForeColor       =   &H00FFFF00&
  233.          Height          =   255
  234.          Index           =   7
  235.          Left            =   180
  236.          TabIndex        =   6
  237.          Top             =   2160
  238.          Width           =   1095
  239.       End
  240.       Begin VB.OptionButton optColor 
  241.          Caption         =   "Magenta"
  242.          ForeColor       =   &H00FF00FF&
  243.          Height          =   255
  244.          Index           =   6
  245.          Left            =   180
  246.          TabIndex        =   5
  247.          Top             =   1860
  248.          Width           =   1095
  249.       End
  250.       Begin VB.OptionButton optColor 
  251.          Caption         =   "Blue"
  252.          ForeColor       =   &H00FF0000&
  253.          Height          =   255
  254.          Index           =   5
  255.          Left            =   180
  256.          TabIndex        =   4
  257.          Top             =   1560
  258.          Width           =   1095
  259.       End
  260.       Begin VB.OptionButton optColor 
  261.          Caption         =   "Yellow"
  262.          ForeColor       =   &H0000FFFF&
  263.          Height          =   255
  264.          Index           =   4
  265.          Left            =   180
  266.          TabIndex        =   3
  267.          Top             =   1260
  268.          Width           =   1095
  269.       End
  270.       Begin VB.OptionButton optColor 
  271.          Caption         =   "Green"
  272.          ForeColor       =   &H0000FF00&
  273.          Height          =   255
  274.          Index           =   3
  275.          Left            =   180
  276.          TabIndex        =   2
  277.          Top             =   960
  278.          Width           =   1095
  279.       End
  280.       Begin VB.OptionButton optColor 
  281.          Caption         =   "Red"
  282.          ForeColor       =   &H000000FF&
  283.          Height          =   255
  284.          Index           =   2
  285.          Left            =   180
  286.          TabIndex        =   1
  287.          Top             =   660
  288.          Width           =   1095
  289.       End
  290.       Begin VB.OptionButton optColor 
  291.          Caption         =   "Black"
  292.          ForeColor       =   &H00000000&
  293.          Height          =   255
  294.          Index           =   1
  295.          Left            =   180
  296.          TabIndex        =   0
  297.          Top             =   360
  298.          Value           =   -1  'True
  299.          Width           =   1095
  300.       End
  301.    End
  302.    Begin VB.CommandButton cmdClose 
  303.       Cancel          =   -1  'True
  304.       Caption         =   "Close"
  305.       Height          =   495
  306.       Left            =   7200
  307.       TabIndex        =   25
  308.       Top             =   4080
  309.       Width           =   1215
  310.    End
  311.    Begin VB.Label Label1 
  312.       Alignment       =   2  'Center
  313.       BackStyle       =   0  'Transparent
  314.       Caption         =   "VBMax 3D Text Effects"
  315.       BeginProperty Font 
  316.          name            =   "MS Sans Serif"
  317.          charset         =   0
  318.          weight          =   400
  319.          size            =   18
  320.          underline       =   0   'False
  321.          italic          =   0   'False
  322.          strikethrough   =   0   'False
  323.       EndProperty
  324.       Height          =   435
  325.       Left            =   720
  326.       TabIndex        =   26
  327.       Top             =   240
  328.       Width           =   3975
  329.    End
  330. Attribute VB_Name = "frm3DText"
  331. Attribute VB_Creatable = False
  332. Attribute VB_Exposed = False
  333. Option Explicit
  334. Dim mo3D   As New cls3D
  335. Private Sub Form_Load()
  336. Dim i As Integer
  337.     Move (Screen.Width - Width) \ 2, (Screen.Height - Height) \ 2
  338.     For i = 0 To Screen.FontCount - 1
  339.         cboFontNames.AddItem Screen.Fonts(i)
  340.     Next i
  341.     With cboTextSize
  342.         .AddItem "8"
  343.         .AddItem "10"
  344.         .AddItem "12"
  345.         .AddItem "14"
  346.         .AddItem "20"
  347.         .AddItem "24"
  348.         .AddItem "26"
  349.         .AddItem "32"
  350.     End With
  351.     mo3D.Caption Label1, gnUSE_CONTROL_FONT
  352. End Sub
  353. Private Sub Form_Unload(Cancel As Integer)
  354.     Set mo3D = Nothing
  355.     Set frm3DText = Nothing
  356. End Sub
  357. Private Sub cmdClose_Click()
  358.     Unload Me
  359. End Sub
  360. Sub RedrawText()
  361.     Cls
  362.     mo3D.Caption Label1
  363. End Sub
  364. Private Sub optColor_Click(Index As Integer)
  365.     mo3D.ForeColor = optColor(Index).ForeColor
  366.     RedrawText
  367. End Sub
  368. Private Sub cboFontNames_Click()
  369.     mo3D.FontName = cboFontNames.Text
  370.     RedrawText
  371. End Sub
  372. Private Sub cboTextSize_Click()
  373.     mo3D.FontSize = cboTextSize.Text
  374.     RedrawText
  375. End Sub
  376. Private Sub cboTextSize_Change()
  377.     mo3D.FontSize = Val(cboTextSize.Text)
  378.     RedrawText
  379. End Sub
  380. Private Sub chkBold_Click()
  381.     If chkBold.Value = vbChecked Then
  382.         mo3D.FontBold = True
  383.     Else
  384.         mo3D.FontBold = False
  385.     End If
  386.     RedrawText
  387. End Sub
  388. Private Sub chkItalic_Click()
  389.     If chkItalic.Value = vbChecked Then
  390.         mo3D.FontItalic = True
  391.     Else
  392.         mo3D.FontItalic = False
  393.     End If
  394.     RedrawText
  395. End Sub
  396. Private Sub chkStrikeout_Click()
  397.     If chkStrikeout.Value = vbChecked Then
  398.         mo3D.FontStrikethru = True
  399.     Else
  400.         mo3D.FontStrikethru = False
  401.     End If
  402.     RedrawText
  403. End Sub
  404. Private Sub chkUnderline_Click()
  405.     If chkUnderline.Value = vbChecked Then
  406.         mo3D.FontUnderline = True
  407.     Else
  408.         mo3D.FontUnderline = False
  409.     End If
  410.     RedrawText
  411. End Sub
  412. Private Sub optEffect_Click(Index As Integer)
  413.     mo3D.Style = Index
  414.     RedrawText
  415. End Sub
  416. Private Sub optShadow_Click(Index As Integer)
  417.     Select Case Index
  418.         Case 0: mo3D.Shadow = gnLIGHT_SHADOW
  419.         Case 1: mo3D.Shadow = gnDARK_SHADOW
  420.     End Select
  421.     RedrawText
  422. End Sub
  423.