home *** CD-ROM | disk | FTP | other *** search
/ ActiveX Programming Unleashed CD / AXU.iso / activex / demos / oletrial / samples / vb / mhlbl / fthreed.frm (.txt) next >
Encoding:
Visual Basic Form  |  1995-11-28  |  26.0 KB  |  726 lines

  1. VERSION 4.00
  2. Begin VB.Form fThreeD 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "form1"
  5.    ClientHeight    =   5076
  6.    ClientLeft      =   2196
  7.    ClientTop       =   672
  8.    ClientWidth     =   4932
  9.    BeginProperty Font 
  10.       name            =   "MS Sans Serif"
  11.       charset         =   0
  12.       weight          =   700
  13.       size            =   7.8
  14.       underline       =   0   'False
  15.       italic          =   0   'False
  16.       strikethrough   =   0   'False
  17.    EndProperty
  18.    ForeColor       =   &H80000008&
  19.    Height          =   5676
  20.    Left            =   2148
  21.    LinkTopic       =   "Form1"
  22.    ScaleHeight     =   5076
  23.    ScaleWidth      =   4932
  24.    Top             =   120
  25.    Width           =   5028
  26.    Begin Mh3dLib.MhThreed Mh3d1 
  27.       Height          =   372
  28.       Index           =   0
  29.       Left            =   120
  30.       TabIndex        =   1
  31.       Top             =   120
  32.       Width           =   4692
  33.       _Version        =   65536
  34.       _ExtentX        =   8281
  35.       _ExtentY        =   661
  36.       _StockProps     =   77
  37.       BackColor       =   -2147483643
  38.       TintColor       =   16711935
  39.       FillColor       =   1044480
  40.       Max             =   0
  41.       Style           =   0
  42.       TextFillColor   =   -2147483633
  43.       Caption         =   "Mh3d1"
  44.    End
  45.    Begin Mh3dLib.MhThreed Mh3d1 
  46.       Height          =   1212
  47.       Index           =   1
  48.       Left            =   120
  49.       TabIndex        =   2
  50.       Top             =   3720
  51.       Width           =   4692
  52.       _Version        =   65536
  53.       _ExtentX        =   8281
  54.       _ExtentY        =   2143
  55.       _StockProps     =   77
  56.       BackColor       =   -2147483643
  57.       TintColor       =   16711935
  58.       FillColor       =   1044480
  59.       Max             =   0
  60.       Style           =   0
  61.       TextFillColor   =   -2147483633
  62.       Caption         =   "Mh3d1"
  63.    End
  64.    Begin Mh3dfrmLibCtl.Mh3dFrame frmChoices 
  65.       Height          =   2052
  66.       Left            =   120
  67.       TabIndex        =   4
  68.       Top             =   1560
  69.       Width           =   4692
  70.       _Version        =   65536
  71.       _ExtentX        =   8281
  72.       _ExtentY        =   3625
  73.       _StockProps     =   77
  74.       BackColor       =   -2147483643
  75.       TintColor       =   16711935
  76.       Alignment       =   0
  77.       AutoSize        =   0   'False
  78.       BevelSize       =   0
  79.       BevelStyle      =   0
  80.       BorderColor     =   -2147483642
  81.       BorderStyle     =   1
  82.       FillColor       =   -2147483633
  83.       FontStyle       =   0
  84.       FontTransparent =   0   'False
  85.       LightColor      =   -2147483643
  86.       ShadowColor     =   -2147483632
  87.       TextColor       =   -2147483640
  88.       WallPaper       =   0
  89.       Picture         =   "Fthreed.frx":0000
  90.       NoPrefix        =   0   'False
  91.       FormatString    =   ""
  92.       Caption         =   "Mh3dFrame1"
  93.       Begin VB.CommandButton cmdIncreasePercent 
  94.          Caption         =   "Command1"
  95.          Height          =   495
  96.          Left            =   2400
  97.          TabIndex        =   9
  98.          Top             =   1440
  99.          Width           =   2175
  100.       End
  101.       Begin VB.CommandButton cmdDecreasePercent 
  102.          Caption         =   "Command1"
  103.          Height          =   495
  104.          Left            =   144
  105.          TabIndex        =   8
  106.          Top             =   1440
  107.          Width           =   2175
  108.       End
  109.       Begin Mh3doptLib.Mh3dOption optChoices 
  110.          Height          =   375
  111.          Index           =   2
  112.          Left            =   120
  113.          TabIndex        =   7
  114.          Top             =   960
  115.          Width           =   4455
  116.          _Version        =   65536
  117.          _ExtentX        =   7858
  118.          _ExtentY        =   661
  119.          _StockProps     =   79
  120.          Caption         =   "Mh3dOption1"
  121.          BackColor       =   -2147483643
  122.          TintColor       =   16711935
  123.          Alignment       =   0
  124.          AutoSize        =   -1  'True
  125.          BoxSize         =   13
  126.          BorderColor     =   -2147483642
  127.          BorderStyle     =   0
  128.          FillColor       =   -2147483633
  129.          FontStyle       =   0
  130.          FontTransparent =   -1  'True
  131.          LightColor      =   -2147483628
  132.          Multiline       =   0   'False
  133.          PictureChecked  =   "Fthreed.frx":001C
  134.          PicturePressed  =   "Fthreed.frx":0038
  135.          PictureUnChecked=   "Fthreed.frx":0054
  136.          PictureGrayed   =   "Fthreed.frx":0070
  137.          ShadowColor     =   -2147483632
  138.          TextColor       =   -2147483630
  139.          WallPaper       =   1
  140.          Picture         =   "Fthreed.frx":008C
  141.          BoxAlignment    =   0
  142.          Value           =   0
  143.          Group           =   0
  144.          DataText        =   ""
  145.          DataStyle       =   0
  146.          DataStyleCaseSens=   0   'False
  147.          CheckBox2d      =   0   'False
  148.       End
  149.       Begin Mh3doptLib.Mh3dOption optChoices 
  150.          Height          =   375
  151.          Index           =   1
  152.          Left            =   120
  153.          TabIndex        =   6
  154.          Top             =   600
  155.          Width           =   4455
  156.          _Version        =   65536
  157.          _ExtentX        =   7858
  158.          _ExtentY        =   661
  159.          _StockProps     =   79
  160.          Caption         =   "Mh3dOption1"
  161.          BackColor       =   -2147483643
  162.          TintColor       =   16711935
  163.          Alignment       =   0
  164.          AutoSize        =   -1  'True
  165.          BoxSize         =   13
  166.          BorderColor     =   -2147483642
  167.          BorderStyle     =   0
  168.          FillColor       =   -2147483633
  169.          FontStyle       =   0
  170.          FontTransparent =   -1  'True
  171.          LightColor      =   -2147483628
  172.          Multiline       =   0   'False
  173.          PictureChecked  =   "Fthreed.frx":00A8
  174.          PicturePressed  =   "Fthreed.frx":00C4
  175.          PictureUnChecked=   "Fthreed.frx":00E0
  176.          PictureGrayed   =   "Fthreed.frx":00FC
  177.          ShadowColor     =   -2147483632
  178.          TextColor       =   -2147483630
  179.          WallPaper       =   1
  180.          Picture         =   "Fthreed.frx":0118
  181.          BoxAlignment    =   0
  182.          Value           =   0
  183.          Group           =   0
  184.          DataText        =   ""
  185.          DataStyle       =   0
  186.          DataStyleCaseSens=   0   'False
  187.          CheckBox2d      =   0   'False
  188.       End
  189.       Begin Mh3doptLib.Mh3dOption optChoices 
  190.          Height          =   375
  191.          Index           =   0
  192.          Left            =   120
  193.          TabIndex        =   5
  194.          Top             =   240
  195.          Width           =   4455
  196.          _Version        =   65536
  197.          _ExtentX        =   7858
  198.          _ExtentY        =   661
  199.          _StockProps     =   79
  200.          Caption         =   "Mh3dOption1"
  201.          BackColor       =   -2147483643
  202.          TintColor       =   16711935
  203.          Alignment       =   0
  204.          AutoSize        =   -1  'True
  205.          BoxSize         =   13
  206.          BorderColor     =   -2147483642
  207.          BorderStyle     =   0
  208.          FillColor       =   -2147483633
  209.          FontStyle       =   0
  210.          FontTransparent =   -1  'True
  211.          LightColor      =   -2147483628
  212.          Multiline       =   0   'False
  213.          PictureChecked  =   "Fthreed.frx":0134
  214.          PicturePressed  =   "Fthreed.frx":0150
  215.          PictureUnChecked=   "Fthreed.frx":016C
  216.          PictureGrayed   =   "Fthreed.frx":0188
  217.          ShadowColor     =   -2147483632
  218.          TextColor       =   -2147483630
  219.          WallPaper       =   1
  220.          Picture         =   "Fthreed.frx":01A4
  221.          BoxAlignment    =   0
  222.          Value           =   1
  223.          Group           =   0
  224.          DataText        =   ""
  225.          DataStyle       =   0
  226.          DataStyleCaseSens=   0   'False
  227.          CheckBox2d      =   0   'False
  228.       End
  229.    End
  230.    Begin MhcommdlLib.MhCommonDialog Mhcommdl1 
  231.       Height          =   336
  232.       Left            =   4440
  233.       TabIndex        =   3
  234.       Top             =   5640
  235.       Width           =   336
  236.       _Version        =   65536
  237.       _ExtentX        =   593
  238.       _ExtentY        =   593
  239.       _StockProps     =   4
  240.       TintColor       =   16711935
  241.       Filename        =   ""
  242.       DialogTop       =   0
  243.       DialogLeft      =   0
  244.       DialogWidth     =   0
  245.       DialogHeight    =   0
  246.       InitDir         =   ""
  247.       Filter          =   ""
  248.       DefaultExt      =   ""
  249.       DialogTitle     =   ""
  250.       FilterIndex     =   0
  251.       Flags           =   0
  252.       CancelError     =   0   'False
  253.       MaxFileSize     =   256
  254.       Color           =   0
  255.       Max             =   0
  256.       Min             =   0
  257.       Copies          =   0
  258.       FromPage        =   0
  259.       PrinterDefault  =   -1  'True
  260.       ToPage          =   0
  261.       HelpCommand     =   0
  262.       HelpContext     =   0
  263.       HelpFile        =   ""
  264.       HelpKey         =   ""
  265.    End
  266.    Begin VB.Label lblXplain 
  267.       Appearance      =   0  'Flat
  268.       BackColor       =   &H80000005&
  269.       BackStyle       =   0  'Transparent
  270.       Caption         =   "Label1"
  271.       ForeColor       =   &H80000008&
  272.       Height          =   855
  273.       Left            =   120
  274.       TabIndex        =   0
  275.       Top             =   600
  276.       Width           =   4695
  277.    End
  278.    Begin VB.Menu mnuFile 
  279.       Caption         =   "&File"
  280.       Begin VB.Menu itmExit 
  281.          Caption         =   "E&xit"
  282.       End
  283.    End
  284.    Begin VB.Menu mnuOptions 
  285.       Caption         =   "&Options"
  286.       Begin VB.Menu itmAlignment 
  287.          Caption         =   "&Alignment"
  288.          Begin VB.Menu itmAlign 
  289.             Caption         =   "&Left"
  290.             Index           =   0
  291.          End
  292.          Begin VB.Menu itmAlign 
  293.             Caption         =   "&Right"
  294.             Index           =   1
  295.          End
  296.          Begin VB.Menu itmAlign 
  297.             Caption         =   "&Center"
  298.             Checked         =   -1  'True
  299.             Index           =   2
  300.          End
  301.       End
  302.       Begin VB.Menu itmReverse 
  303.          Caption         =   "Fill Right to Left"
  304.       End
  305.       Begin VB.Menu itmVertical 
  306.          Caption         =   "Vertical Fill"
  307.       End
  308.       Begin VB.Menu itmBorderStyle 
  309.          Caption         =   "Border Style"
  310.          Begin VB.Menu itmBorder 
  311.             Caption         =   "None"
  312.             Index           =   0
  313.          End
  314.          Begin VB.Menu itmBorder 
  315.             Caption         =   "Single Line"
  316.             Checked         =   -1  'True
  317.             Index           =   1
  318.          End
  319.          Begin VB.Menu itmBorder 
  320.             Caption         =   "Single Line with Rounded Corners"
  321.             Index           =   2
  322.          End
  323.       End
  324.       Begin VB.Menu itmBevelStyle 
  325.          Caption         =   "Bevel Style"
  326.          Begin VB.Menu itmStyleOfBevel 
  327.             Caption         =   "Lowered"
  328.             Index           =   0
  329.          End
  330.          Begin VB.Menu itmStyleOfBevel 
  331.             Caption         =   "Raised"
  332.             Checked         =   -1  'True
  333.             Index           =   1
  334.          End
  335.          Begin VB.Menu itmStyleOfBevel 
  336.             Caption         =   "Chiseled"
  337.             Index           =   2
  338.          End
  339.          Begin VB.Menu itmStyleOfBevel 
  340.             Caption         =   "Shadowed Right"
  341.             Index           =   3
  342.          End
  343.          Begin VB.Menu itmStyleOfBevel 
  344.             Caption         =   "Shadowed Left"
  345.             Index           =   4
  346.          End
  347.       End
  348.    End
  349.    Begin VB.Menu mnuColors 
  350.       Caption         =   "Colors"
  351.       Begin VB.Menu itmColors 
  352.          Caption         =   "Border Color"
  353.          Index           =   0
  354.       End
  355.       Begin VB.Menu itmColors 
  356.          Caption         =   "Fill Color"
  357.          Index           =   1
  358.       End
  359.       Begin VB.Menu itmColors 
  360.          Caption         =   "Light Color (Top and Left Bevels)"
  361.          Index           =   2
  362.       End
  363.       Begin VB.Menu itmColors 
  364.          Caption         =   "Outer Fill Color"
  365.          Index           =   3
  366.       End
  367.       Begin VB.Menu itmColors 
  368.          Caption         =   "Shadow Color (Bottom, Right Bevels)"
  369.          Index           =   4
  370.       End
  371.       Begin VB.Menu itmColors 
  372.          Caption         =   "Text Color"
  373.          Index           =   5
  374.       End
  375.       Begin VB.Menu itmColors 
  376.          Caption         =   "Text Fill Color"
  377.          Index           =   6
  378.       End
  379.    End
  380. Attribute VB_Name = "fThreeD"
  381. Attribute VB_Creatable = False
  382. Attribute VB_Exposed = False
  383. Option Explicit
  384. ' For continuous button pressing
  385. Dim imDown As Integer
  386. Dim imChoices As Integer
  387. Dim imStart As Integer
  388. 'Declare constants
  389. Const im_TRUE = -1, im_FALSE = 0
  390. Const im_LEFT = 0, im_RIGHT = 1, im_CENTER = 2
  391. Const im_BORDERCOLOR = 0, im_FILLCOLOR = 1, im_LIGHTCOLOR = 2, im_OUTERFILLCOLOR = 3, im_SHADOWCOLOR = 4, im_TEXTCOLOR = 5, im_TEXTFILLCOLOR = 6
  392. Const im_NONE = 0, im_SINGLE = 1, im_ROUNDED = 2
  393. Const im_LOWERED = 0, im_RAISED = 1, im_CHISELED = 2, im_SHADOWLEFT = 3, im_SHADOWRIGHT = 4
  394. Const CC_PREVENTFULLOPEN = &H4&
  395. Private Sub cmdDecreasePercent_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  396. 'Allows for continuous decrease of the value of MhThreeD.
  397. 'Routine checks to make sure button is down, then it sets
  398. 'flag variable so we know when user quits pressing button
  399. 'Then it decreases value until limit reached or user quits
  400. 'Do loop and DoEvents keep things going
  401. 'Flag to quit thrown again in _MouseUp event
  402.     Dim iIndex As Integer
  403.     'If user is pressing the mouse button, set flag and do case
  404.     If Button Then
  405.         imDown = im_TRUE
  406.         Select Case imChoices
  407.             'If option 0 clicked (default), change percentage of fill in both controls
  408.             Case 0
  409.                 Do While imDown And Mh3d1(0).Value > Mh3d1(0).Min
  410.                     For iIndex = 0 To 1
  411.                         Mh3d1(iIndex).Value = Mh3d1(iIndex).Value - 1
  412.                         Mh3d1(iIndex).Caption = Str$(Mh3d1(iIndex).Value) & "%"
  413.                         DoEvents
  414.                     Next
  415.                 Loop
  416.             'If option 1 clicked, change outer bevel of bottom control
  417.             Case 1
  418.                 While imDown And Mh3d1(1).BevelSize > 0 And Mh3d1(1).BevelSize >= 0
  419.                     Mh3d1(1).BevelSize = Mh3d1(1).BevelSize - 1
  420.                     DoEvents
  421.                 Wend
  422.             'If option 2 clicked, change inner bevel of bottom control
  423.             Case 2
  424.                 While imDown And Mh3d1(1).BevelSizeInside > 0 And Mh3d1(1).BevelSizeInside >= 0
  425.                     Mh3d1(1).BevelSizeInside = Mh3d1(1).BevelSizeInside - 1
  426.                     DoEvents
  427.                 Wend
  428.         End Select
  429.     End If
  430. End Sub
  431. Private Sub cmdDecreasePercent_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  432. 'Flag to indicate user isn't pressing on button anymore
  433.     imDown = im_FALSE
  434. End Sub
  435. Private Sub cmdIncreasePercent_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  436. 'Allows for continuous decrease of the value of MhThreeD.
  437. 'Routine checks to make sure button is down, then it sets
  438. 'flag variable so we know when user quits pressing button
  439. 'Then it decreases value until limit reached or user quits
  440. 'Do loop and DoEvents keep things moving
  441. 'Flag to quit thrown again in _MouseUp event
  442.     Dim iIndex As Integer
  443.     'If the user is pressing the button, throw flag
  444.     If Button Then
  445.         imDown = im_TRUE
  446.         'Poll to see which option is chosen
  447.         Select Case imChoices
  448.             'If option 0 clicked (default), change percentage value in MhThreeDs
  449.             Case 0
  450.                 Do While imDown And Mh3d1(0).Value < Mh3d1(0).Max
  451.                     For iIndex = 0 To 1
  452.                         Mh3d1(iIndex).Value = Mh3d1(iIndex).Value + 1
  453.                         Mh3d1(iIndex).Caption = Str$(Mh3d1(iIndex).Value) & "%"
  454.                         DoEvents
  455.                     Next
  456.                 Loop
  457.             'If option 1 clicked, change outer bevel of bottom MhThreeD
  458.             Case 1
  459.                 Do
  460.                     Mh3d1(1).BevelSize = Mh3d1(1).BevelSize + 1
  461.                     DoEvents
  462.                 Loop While imDown And Mh3d1(1).BevelSize < 30
  463.             'If option 2 clicked, change inner bevel of bottom MhThreeD
  464.             Case 2
  465.                 Do While imDown And Mh3d1(1).BevelSizeInside < 30
  466.                     Mh3d1(1).BevelSizeInside = Mh3d1(1).BevelSizeInside + 1
  467.                     DoEvents
  468.                 Loop
  469.         End Select
  470.     End If
  471. End Sub
  472. Private Sub cmdIncreasePercent_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  473. 'Set flag to indicate user has quit pressing button
  474.     imDown = im_FALSE
  475. End Sub
  476. Private Sub form_Activate()
  477. 'Fills Mh3d1 when form first becomes active
  478.     Dim iIndex As Integer
  479.     If imStart = im_TRUE Then
  480.         'Do this until MhThreeD is full
  481.         Do Until Mh3d1(0).Value = 100
  482.             For iIndex = 0 To 1
  483.                 DoEvents
  484.                 'Add one to value and update caption
  485.                 Mh3d1(iIndex).Value = Mh3d1(iIndex).Value + 1
  486.                 Mh3d1(iIndex).Caption = Str$(Mh3d1(iIndex).Value) & "%"
  487.             Next
  488.         Loop
  489.     imStart = im_FALSE
  490.     End If
  491.     cmdDecreasePercent.SetFocus
  492. End Sub
  493. Private Sub Form_Load()
  494. 'For the purposes of this example, all the control
  495. 'properties except the name and properties that
  496. 'designtime-only are set programmatically
  497. 'rather than through the Visual Basic property sheet.
  498. 'Therefore, property sheet settings are defaults for
  499. 'MicroHelp's controls
  500.     Dim iIndex As Integer
  501.     'Set flag for startup fill
  502.     imStart = im_TRUE
  503.     'Set form defaults
  504.     fThreeD.Caption = "MicroHelp MH3D Example"
  505.     'Set common Mh3d1 defaults
  506.     For iIndex = 0 To 1
  507.         Mh3d1(iIndex).BevelSize = 1
  508.         Mh3d1(iIndex).BevelSizeInside = 1
  509.         Mh3d1(iIndex).Max = 100
  510.         Mh3d1(iIndex).Min = 0
  511.         Mh3d1(iIndex).Alignment = im_CENTER
  512.     Next
  513.     'Set Mh3d1(0) defaults
  514.     Mh3d1(0).InnerBottom = 5
  515.     Mh3d1(0).InnerTop = 5
  516.     Mh3d1(0).InnerLeft = 5
  517.     Mh3d1(0).InnerRight = 5
  518.     Mh3d1(0).FillColor = RGB(255, 0, 0)
  519.     'Set Mh3d1(1) defaults
  520.     Mh3d1(1).InnerBottom = 30
  521.     Mh3d1(1).InnerTop = 30
  522.     Mh3d1(1).InnerLeft = 30
  523.     Mh3d1(1).InnerRight = 30
  524.     Mh3d1(1).FillColor = RGB(0, 255, 0)
  525.     'Set properties for frame
  526.     frmChoices.FontTransparent = True
  527.     frmChoices.Caption = "Select values to change"
  528.     frmChoices.BevelSize = 1
  529.     frmChoices.BevelStyle = im_RAISED
  530.     'Set properties for option buttons
  531.     optChoices(0).Caption = "Change percent fill value of both MhThreeDs"
  532.     'optChoices(0).Value = True
  533.     optChoices(1).Caption = "Change size of outer bevel of bottom MhThreeD"
  534.     optChoices(2).Caption = "Change size of inner bevel of bottom MhThreeD"
  535.     'Set properties for controls concerning gauge behavior
  536.     cmdDecreasePercent.Caption = "Decrease %"
  537.     cmdIncreasePercent.Caption = "Increase %"
  538.     'Set properties for explanation labels
  539.     lblXplain.WordWrap = True
  540.     lblXplain.Caption = "The MhThreeD control can be used as a conventional label, as a beveled label and even as a percent-complete gauge. It can fill from left to right, right to left, bottom to top or top to bottom."
  541.     ' center form to screen
  542.     Move Abs(Screen.Width - Width) \ 2, Abs(Screen.Height - Height) \ 2
  543. End Sub
  544. Private Sub itmAlign_Click(index As Integer)
  545. 'Set MhThreeD caption alignment here
  546.     Dim iIndex As Integer
  547.     'Loop to turn off checks on menu
  548.     For iIndex = 0 To 2
  549.         itmAlign(iIndex).Checked = False
  550.     Next
  551.     'Set alignment, set checks
  552.     Mh3d1(0).Alignment = index
  553.     Mh3d1(1).Alignment = index
  554.     itmAlign(index).Checked = True
  555. End Sub
  556. Private Sub itmBorder_Click(index As Integer)
  557. 'This will control the borderstyle for the bottom Mh3d1
  558.     Dim iIndex As Integer
  559.     'Turn all checks off
  560.     For iIndex = 0 To 2
  561.         itmBorder(iIndex).Checked = False
  562.     Next
  563.     'Change border style and check appropriate menu item
  564.     Select Case index
  565.         Case im_NONE
  566.             Mh3d1(1).BorderStyle = index
  567.             itmBorder(index).Checked = True
  568.         Case im_SINGLE
  569.             Mh3d1(1).BorderStyle = index
  570.             itmBorder(index).Checked = True
  571.         Case im_ROUNDED
  572.             Mh3d1(1).BorderStyle = index
  573.             itmBorder(index).Checked = True
  574.     End Select
  575. End Sub
  576. Private Sub itmColors_Click(index As Integer)
  577. 'Routine calls up common color dialog so we can
  578. 'illustrate the color properties of the control.
  579. 'Note that we don't set .ForeColor or .BackColor
  580. 'even though they appear in the properties list.
  581. 'Changing them can cause bizarre color display and
  582. 'some controls may behave strangely. Leave those
  583. 'properties at their defaults
  584.     'Test to make sure they're setting something
  585.     'that will actually have a visible effect
  586.     If index = im_BORDERCOLOR And Mh3d1(1).BorderStyle = im_NONE Then
  587.         MsgBox "You must set a border under the options menu before this property can have any effect.", 16, "MicroHelp"
  588.         Exit Sub
  589.     End If
  590.     'Sets flag to prevent custom color palette from
  591.     'appearing, calls dialog and sets appropriate
  592.     'color property when dialog closes.
  593.     Mhcommdl1.Flags = CC_PREVENTFULLOPEN
  594.     Mhcommdl1.CancelError = True
  595.     On Error GoTo ColorError
  596.     Mhcommdl1.Action = 3
  597.     Select Case index
  598.         Case im_BORDERCOLOR
  599.             Mh3d1(1).BorderColor = Mhcommdl1.Color
  600.         Case im_FILLCOLOR
  601.             Mh3d1(1).FillColor = Mhcommdl1.Color
  602.         Case im_LIGHTCOLOR
  603.             Mh3d1(1).LightColor = Mhcommdl1.Color
  604.         Case im_OUTERFILLCOLOR
  605.             Mh3d1(1).OuterFillColor = Mhcommdl1.Color
  606.         Case im_SHADOWCOLOR
  607.             Mh3d1(1).ShadowColor = Mhcommdl1.Color
  608.         Case im_TEXTCOLOR
  609.             Mh3d1(1).TextColor = Mhcommdl1.Color
  610.         Case im_TEXTFILLCOLOR
  611.             Mh3d1(1).TextFillColor = Mhcommdl1.Color
  612.     End Select
  613. Exit Sub
  614. ColorError:
  615.     Select Case index
  616.         Case im_BORDERCOLOR
  617.             Mh3d1(1).BorderColor = Mh3d1(1).BorderColor
  618.         Case im_FILLCOLOR
  619.             Mh3d1(1).FillColor = Mh3d1(1).FillColor
  620.         Case im_LIGHTCOLOR
  621.             Mh3d1(1).LightColor = Mh3d1(1).LightColor
  622.         Case im_OUTERFILLCOLOR
  623.             Mh3d1(1).OuterFillColor = Mh3d1(1).OuterFillColor
  624.         Case im_SHADOWCOLOR
  625.             Mh3d1(1).ShadowColor = Mh3d1(1).ShadowColor
  626.         Case im_TEXTCOLOR
  627.             Mh3d1(1).TextColor = Mh3d1(1).TextColor
  628.         Case im_TEXTFILLCOLOR
  629.             Mh3d1(1).TextFillColor = Mh3d1(1).TextFillColor
  630.     End Select
  631. Exit Sub
  632. End Sub
  633. Private Sub itmExit_Click()
  634. Unload fThreeD
  635. End Sub
  636. Private Sub itmReverse_Click()
  637. 'MhThreeD has a .Reverse property so that it can
  638. 'fill from right to left or left to right. If
  639. '.VerticalFill is set to true, this property
  640. 'determines whether it fills from top to bottom
  641. 'or bottom to top
  642.     Dim iIndex As Integer
  643.     Dim iValue As Integer
  644.     iValue = Mh3d1(1).Value
  645.     If Mh3d1(0).ReverseFill = False Then
  646.         For iIndex = 0 To 1
  647.             Mh3d1(iIndex).ReverseFill = True
  648.             itmReverse.Caption = "Fill Left To Right"
  649.             Mh3d1(iIndex).Value = iValue
  650.         Next
  651.     Else
  652.         For iIndex = 0 To 1
  653.             Mh3d1(iIndex).ReverseFill = False
  654.             itmReverse.Caption = "Fill Right To Left"
  655.             Mh3d1(iIndex).Value = iValue
  656.         Next
  657.     End If
  658. End Sub
  659. Private Sub itmStyleOfBevel_Click(index As Integer)
  660. 'Routine picks bevel style for control
  661.     Dim iIndex As Integer
  662.     'if Bevelsize = 0, there's nothing else to set
  663.     'so we tell the user and then exit
  664.     If Mh3d1(1).BevelSize = 0 Then
  665.         MsgBox "You must set .BevelSize to something other than zero for this property to have any effect.", 16, "MicroHelp"
  666.         Exit Sub
  667.     End If
  668.     'Turn all the checks off
  669.     For iIndex = 0 To 4
  670.         itmStyleOfBevel(iIndex).Checked = False
  671.     Next
  672.     'Change style and check appropriate menu item
  673.     Select Case index
  674.         Case im_LOWERED
  675.             Mh3d1(1).BevelStyle = index
  676.             itmStyleOfBevel(index).Checked = True
  677.         Case im_RAISED
  678.             Mh3d1(1).BevelStyle = index
  679.             itmStyleOfBevel(index).Checked = True
  680.         Case im_CHISELED
  681.             Mh3d1(1).BevelStyle = index
  682.             itmStyleOfBevel(index).Checked = True
  683.         Case im_SHADOWLEFT
  684.             Mh3d1(1).BevelStyle = index
  685.             itmStyleOfBevel(index).Checked = True
  686.         Case im_SHADOWRIGHT
  687.             Mh3d1(1).BevelStyle = index
  688.             itmStyleOfBevel(index).Checked = True
  689.     End Select
  690. End Sub
  691. Private Sub itmVertical_Click()
  692. 'MhThreeD has a .VerticalFill property that determines
  693. 'whether the control fills horizontially or vertically.
  694. 'If .ReverseFill is set to true, then the control may
  695. 'fill from top to bottom rather than bottom to top.
  696.     Dim iIndex As Integer
  697.     Dim iValue As Integer
  698.     iValue = Mh3d1(0).Value
  699.     If Mh3d1(0).VerticalFill = False Then
  700.         For iIndex = 0 To 1
  701.             Mh3d1(iIndex).VerticalFill = True
  702.             itmVertical.Caption = "Horizontal Fill"
  703.             Mh3d1(iIndex).Value = iValue
  704.         Next
  705.     Else
  706.         For iIndex = 0 To 1
  707.             Mh3d1(iIndex).VerticalFill = False
  708.             itmVertical.Caption = "Vertical Fill"
  709.             Mh3d1(iIndex).Value = iValue
  710.         Next
  711.     End If
  712. End Sub
  713. Private Sub optChoices_Click(index As Integer)
  714. 'Set flag for increase/decrease button routines.
  715.     imChoices = index
  716. End Sub
  717. Private Sub optChoices_MouseUp(index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
  718. 'Set focus to most likely initial choice given defaults
  719. 'of the MhThreeD controls at startup
  720.     If index = 0 Then
  721.         cmdDecreasePercent.SetFocus
  722.     Else
  723.         cmdIncreasePercent.SetFocus
  724.     End If
  725. End Sub
  726.