home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.3#0"; "COMCTL32.OCX"
- Begin VB.Form frmShadowLens
- BorderStyle = 1 'Fixed Single
- Caption = "Shadow lens settings"
- ClientHeight = 2295
- ClientLeft = 1905
- ClientTop = 2010
- ClientWidth = 3735
- FillColor = &H00400000&
- Icon = "frmShadowLens.frx":0000
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 2295
- ScaleWidth = 3735
- StartUpPosition = 2 'CenterScreen
- Begin VB.CommandButton btnCancel
- Caption = "Cancel"
- Height = 360
- Left = 2745
- TabIndex = 7
- Top = 525
- Width = 930
- End
- Begin VB.ComboBox cmbLensType
- Height = 315
- Left = 135
- Style = 2 'Dropdown List
- TabIndex = 5
- Top = 480
- Width = 2130
- End
- Begin VB.CommandButton btnStartColor
- Caption = "Start Color"
- Enabled = 0 'False
- Height = 345
- Left = 135
- TabIndex = 0
- Top = 1860
- Width = 1065
- End
- Begin VB.CommandButton btnEndColor
- Caption = "End Color"
- Enabled = 0 'False
- Height = 345
- Left = 1260
- TabIndex = 1
- Top = 1860
- Width = 1065
- End
- Begin VB.CommandButton btnOK
- Caption = "OK"
- Height = 360
- Left = 2745
- TabIndex = 2
- Top = 135
- Width = 930
- End
- Begin ComctlLib.Slider sldPercentage
- Height = 210
- Left = 30
- TabIndex = 4
- Top = 1530
- Width = 2145
- _ExtentX = 3784
- _ExtentY = 370
- _Version = 327682
- Enabled = -1 'True
- LargeChange = 10
- Min = -100
- Max = 100
- TickStyle = 3
- End
- Begin VB.Label Label1
- Caption = "Choose lens type:"
- Height = 255
- Left = 135
- TabIndex = 6
- Top = 210
- Width = 2130
- End
- Begin VB.Label lblPercentage
- Caption = "Effect percentage:"
- Height = 285
- Left = 105
- TabIndex = 3
- Top = 1125
- Width = 2250
- End
- Attribute VB_Name = "frmShadowLens"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Dim pd_ShadowLens As POLARDRAW20Lib.Lens
- Const polNothing = -1
- Dim LensType As Variant
- Dim crStartColor As OLE_COLOR, crEndColor As OLE_COLOR
- Dim lPercentage As Long, lType As Long
- Dim fHasLens As Boolean
- Private Sub btnCancel_Click()
- 'if user cancels, set back to initial values
- With pd_ShadowLens
- .Type = lType
- .Percent = lPercentage
- .BackColor = crEndColor
- .Color = crStartColor
- End With
- pd_Selection.ShapeRange.Shadow.HasLens = fHasLens
- Unload Me
- End Sub
- Private Sub btnOK_Click()
- Unload Me
- End Sub
- Private Sub btnStartColor_Click()
- 'Displays dialogbox showing colors
- With pd_ShadowLens
- .Color = SetColor(.Color)
- End With
- End Sub
- Private Sub btnEndColor_Click()
- With pd_ShadowLens
- .BackColor = SetColor(.BackColor)
- End With
- End Sub
- Private Sub cmbLensType_Click()
- With cmbLensType
- If .ItemData(.ListIndex) = -1 Then
- pd_Selection.ShapeRange.Shadow.HasLens = False
- Else
- pd_Selection.ShapeRange.Shadow.HasLens = True
- pd_ShadowLens.Type = .ItemData(.ListIndex)
- SetControls pd_ShadowLens.Type
- End If
- End With
- End Sub
- Private Sub Form_Load()
- Set pd_ShadowLens = Nothing
- Set pd_ShadowLens = pd_Selection.ShapeRange.Shadow.Lens
- 'saving initial values
- With pd_ShadowLens
- lType = .Type
- lPercentage = .Percent
- crEndColor = .BackColor
- crStartColor = .Color
- End With
- fHasLens = pd_Selection.ShapeRange.Shadow.HasLens
- LensType = Array(polTransparency, polBrighten, polColorAdd, polColorLimit, polCustomPalette, polInvert, polTintedGrayscale, polHeatmapPalette, polNothing)
- Dim strLensName As Variant
- strLensName = Array("Transparency", "Brighten/Darken", "Add Color", "Limit Color", "Custom Palette", "Invert", "Tinted Grayscale", "Heatmap Palette", "Nothing")
- 'setting values to combo box
- With cmbLensType
- .Clear
- For i = 0 To 8
- .AddItem strLensName(i), i
- .ItemData(i) = LensType(i)
- Next
- If False = pd_Selection.ShapeRange.Shadow.HasLens Then
- .ListIndex = .NewIndex
- Else
- j = 0
- Do While .ItemData(j) <> pd_ShadowLens.Type
- j = j + 1
- Loop
- .ListIndex = j
-
- End If
- SetControls .ItemData(.ListIndex)
- End With
- lblPercentage.Caption = "Effect percentage: " + CStr(sldPercentage.Value) + "%"
- End Sub
- Private Sub Form_Unload(Cancel As Integer)
- Set pd_ShadowLens = Nothing
- End Sub
- Private Sub sldPercentage_Scroll()
- pd_ShadowLens.Percent = sldPercentage.Value
- lblPercentage.Caption = "Effect percentage: " + CStr(pd_ShadowLens.Percent) + "%"
- End Sub
- Sub SetControls(LensType As polLensType)
- Select Case LensType
- Case polNothing
- sldPercentage.Enabled = False
- btnStartColor.Enabled = False
- btnEndColor = False
- Case polTransparency
- sldPercentage.Enabled = True
- btnStartColor.Enabled = False
- btnEndColor = False
- Case polBrighten
- sldPercentage.Enabled = True
- btnStartColor.Enabled = False
- btnEndColor = False
- Case polColorAdd
- sldPercentage.Enabled = True
- btnStartColor.Enabled = True
- btnEndColor = False
- Case polColorLimit
- sldPercentage.Enabled = True
- btnStartColor.Enabled = True
- btnEndColor = False
- Case polCustomPalette
- sldPercentage.Enabled = False
- btnStartColor.Enabled = True
- btnEndColor = True
- Case polInvert
- sldPercentage.Enabled = False
- btnStartColor.Enabled = False
- btnEndColor = False
- Case polTintedGrayscale
- sldPercentage.Enabled = False
- btnStartColor.Enabled = True
- btnEndColor = False
- Case polHeatmapPalette
- sldPercentage.Enabled = False
- btnStartColor.Enabled = False
- btnEndColor = False
- End Select
- End Sub
-