vbAccelerator - Contents of code file: cPickItem.clsVERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
END
Attribute VB_Name = "cPickItem"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Option Explicit
Private m_hWnd As Long
Private m_lPtr As Long
Private m_sKey As String
Friend Function fInit(ByVal hwnd As Long, ByVal lPtr As Long, ByVal sKey As
String)
m_hWnd = hwnd
m_lPtr = lPtr
m_sKey = sKey
End Function
Private Function pbVerify(ByRef cI As pcItem, ByRef ctl As vbalPicker) As
Boolean
If gbValidOwner(m_hWnd, ctl) Then
If Not m_lPtr = 0 Then
If ctl.fIsValid(m_sKey, m_lPtr) Then
Set cI = ObjectFromPtr(m_lPtr)
pbVerify = True
End If
End If
End If
End Function
Public Property Get DropDown() As vbalPicker
Dim c As pcItem, ctl As vbalPicker
If pbVerify(c, ctl) Then
Dim lhWnd As Long, ctlDropDown As vbalPicker
Dim lErr As Long
lhWnd = c.hWndDropDown
On Error Resume Next
gbValidOwner lhWnd, ctlDropDown
lErr = Err.Number
On Error GoTo 0
If (lErr = 0) Then
Set DropDown = ctlDropDown
End If
End If
End Property
Public Property Let DropDown(ByVal ctlPicker As vbalPicker)
pSetDropDown ctlPicker
End Property
Public Property Set DropDown(ByVal ctlPicker As vbalPicker)
pSetDropDown ctlPicker
End Property
Private Sub pSetDropDown(ctlPicker As vbalPicker)
Dim c As pcItem, ctl As vbalPicker
If pbVerify(c, ctl) Then
Dim lhWnd As Long
lhWnd = ctlPicker.hwnd
Dim ctlCheck As vbalPicker
If (gbValidOwner(lhWnd, ctlCheck)) Then
c.hWndDropDown = lhWnd
End If
End If
End Sub
Public Property Get Key() As String
Dim c As pcItem, ctl As vbalPicker
If pbVerify(c, ctl) Then
Key = c.Key
End If
End Property
Public Property Get DropDownStyle() As EVPLPickItemDropDrownStyle
Dim c As pcItem, ctl As vbalPicker
If pbVerify(c, ctl) Then
DropDownStyle = c.DropDownStyle
End If
End Property
Public Property Let DropDownStyle(ByVal eAlign As EVPLPickItemDropDrownStyle)
Dim c As pcItem, ctl As vbalPicker
If pbVerify(c, ctl) Then
c.DropDownStyle = eAlign
ctl.fUpdatedItem c
End If
End Property
Public Property Get Alignment() As EVPLPickItemAlignment
Dim c As pcItem, ctl As vbalPicker
If pbVerify(c, ctl) Then
Alignment = c.Alignment
End If
End Property
Public Property Let Alignment(ByVal eAlign As EVPLPickItemAlignment)
Dim c As pcItem, ctl As vbalPicker
If pbVerify(c, ctl) Then
c.Alignment = eAlign
ctl.fUpdatedItem c
End If
End Property
Public Property Get ShowCaption() As Boolean
Dim c As pcItem, ctl As vbalPicker
If pbVerify(c, ctl) Then
ShowCaption = c.ShowCaption
End If
End Property
Public Property Let ShowCaption(ByVal bShowCaption As Boolean)
Dim c As pcItem, ctl As vbalPicker
If pbVerify(c, ctl) Then
c.ShowCaption = bShowCaption
ctl.fUpdatedItem c
End If
End Property
Public Property Get Enabled() As Boolean
Dim c As pcItem, ctl As vbalPicker
If pbVerify(c, ctl) Then
Enabled = c.Enabled
End If
End Property
Public Property Let Enabled(ByVal bEnabled As Boolean)
Dim c As pcItem, ctl As vbalPicker
If pbVerify(c, ctl) Then
c.Enabled = bEnabled
ctl.fUpdatedItem c
End If
End Property
Public Property Get Checked() As Boolean
Dim c As pcItem, ctl As vbalPicker
If pbVerify(c, ctl) Then
Checked = c.Checked
End If
End Property
Public Property Let Checked(ByVal bChecked As Boolean)
Dim c As pcItem, ctl As vbalPicker
If pbVerify(c, ctl) Then
c.Checked = bChecked
ctl.fUpdatedItem c
End If
End Property
Public Property Get HelpText() As String
Dim c As pcItem, ctl As vbalPicker
If pbVerify(c, ctl) Then
HelpText = c.HelpText
End If
End Property
Public Property Let HelpText(ByVal sHelpText As String)
Dim c As pcItem, ctl As vbalPicker
If pbVerify(c, ctl) Then
c.HelpText = sHelpText
End If
End Property
Public Property Get Caption() As String
Attribute Caption.VB_UserMemId = 0
Dim c As pcItem, ctl As vbalPicker
If pbVerify(c, ctl) Then
Caption = c.Caption
End If
End Property
Public Property Let Caption(ByVal sCaption As String)
Dim c As pcItem, ctl As vbalPicker
If pbVerify(c, ctl) Then
c.Caption = sCaption
ctl.fUpdatedItem c, True
End If
End Property
Public Property Get ToolTipText() As String
Dim c As pcItem, ctl As vbalPicker
If pbVerify(c, ctl) Then
ToolTipText = c.ToolTipText
End If
End Property
Public Property Let ToolTipText(ByVal sToolTipText As String)
Dim c As pcItem, ctl As vbalPicker
If pbVerify(c, ctl) Then
c.ToolTipText = sToolTipText
End If
End Property
Public Property Get ShortCut() As String
Dim c As pcItem, ctl As vbalPicker
If pbVerify(c, ctl) Then
ShortCut = c.ShortCut
End If
End Property
Public Property Let ShortCut(ByVal sShortCut As String)
Dim c As pcItem, ctl As vbalPicker
If pbVerify(c, ctl) Then
c.ShortCut = sShortCut
ctl.fUpdatedItem c, True
End If
End Property
Public Property Get Tag() As String
Dim c As pcItem, ctl As vbalPicker
If pbVerify(c, ctl) Then
Tag = c.Tag
End If
End Property
Public Property Let Tag(ByVal sTag As String)
Dim c As pcItem, ctl As vbalPicker
If pbVerify(c, ctl) Then
c.Tag = sTag
ctl.fUpdatedItem c
End If
End Property
Public Property Get ItemData() As Long
Dim c As pcItem, ctl As vbalPicker
If pbVerify(c, ctl) Then
ItemData = c.ItemData
End If
End Property
Public Property Let ItemData(ByVal lItemData As Long)
Dim c As pcItem, ctl As vbalPicker
If pbVerify(c, ctl) Then
c.ItemData = lItemData
End If
End Property
Public Property Get Icon() As Long
Dim c As pcItem, ctl As vbalPicker
If pbVerify(c, ctl) Then
Icon = c.Icon
End If
End Property
Public Property Let Icon(ByVal lIcon As Long)
Dim c As pcItem, ctl As vbalPicker
If pbVerify(c, ctl) Then
c.Icon = lIcon
ctl.fUpdatedItem c
End If
End Property
Public Property Get LineWidth() As Long
Dim c As pcItem, ctl As vbalPicker
If pbVerify(c, ctl) Then
LineWidth = c.LineWidth
End If
End Property
Public Property Let LineWidth(ByVal lLineWidth As Long)
Dim c As pcItem, ctl As vbalPicker
If pbVerify(c, ctl) Then
c.LineWidth = lLineWidth
ctl.fUpdatedItem c
End If
End Property
Public Property Get LineStyle() As Long
Dim c As pcItem, ctl As vbalPicker
If pbVerify(c, ctl) Then
LineStyle = c.LineStyle
End If
End Property
Public Property Let LineStyle(ByVal lLineStyle As Long)
Dim c As pcItem, ctl As vbalPicker
If pbVerify(c, ctl) Then
c.LineStyle = lLineStyle
ctl.fUpdatedItem c
End If
End Property
Public Property Get Style() As EVPLPickItemTypes
Dim c As pcItem, ctl As vbalPicker
If pbVerify(c, ctl) Then
Style = c.Style
End If
End Property
Public Property Let Style(ByVal eStyle As EVPLPickItemTypes)
Dim c As pcItem, ctl As vbalPicker
If pbVerify(c, ctl) Then
c.Style = eStyle
ctl.fUpdatedItem c, True
End If
End Property
Public Property Get Color() As OLE_COLOR
Dim c As pcItem, ctl As vbalPicker
If pbVerify(c, ctl) Then
Color = c.Colour
End If
End Property
Public Property Let Color(ByVal eColor As OLE_COLOR)
Dim c As pcItem, ctl As vbalPicker
If pbVerify(c, ctl) Then
c.Colour = eColor
ctl.fUpdatedItem c
End If
End Property
|
|