vbAccelerator - Contents of code file: cCTreeViewColumns.cls

VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
END
Attribute VB_Name = "cCTreeViewColumns"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Option Explicit

Private m_hWndCtl As Long

Private Function pbVerify(ByRef ctlThis As vbalColumnTreeView) As Boolean
Dim lPtr As Long
Dim lIdx As Long
   If IsWindow(m_hWndCtl) Then
      lPtr = GetProp(m_hWndCtl, gcOBJECT_PROP)
      If Not (lPtr = 0) Then
         
         If (lPtr = 1) Then
            Debug.Print "NOOOOOO"
         End If
         
         Set ctlThis = ObjectFromPtr(lPtr)
         pbVerify = True
      Else
         gErr 1, "cListItems"
      End If
   Else
      gErr 1, "cListItems"
   End If
End Function

Friend Sub fInit(ctl As vbalColumnTreeView)
   m_hWndCtl = ctl.hwnd
End Sub

Public Property Get Count() As Long
Dim ctl As vbalColumnTreeView
   If (pbVerify(ctl)) Then
      Count = ctl.fColumnCount
   End If
End Property

Public Function Add( _
      Optional ByVal Key As String = "", _
      Optional ByVal Text As String = "", _
      Optional ByVal Image As Long = -1, _
      Optional ByVal Width As Long = 64 _
   ) As cCTreeViewColumn
Dim ctl As vbalColumnTreeView
   If (pbVerify(ctl)) Then
      Set Add = ctl.fAddColumn(Key, Text, Image, Width)
   End If
End Function

Public Property Get Item(Index As Variant) As cCTreeViewColumn
Dim ctl As vbalColumnTreeView
   If (pbVerify(ctl)) Then
      Set Item = ctl.fColumn(Index)
   End If
End Property

Public Sub Remove(Index As Variant)
Dim ctl As vbalColumnTreeView
   If (pbVerify(ctl)) Then
      ctl.fRemoveColumn Index
   End If
End Sub

Public Function Exists(Index As Variant) As Boolean
Dim ctl As vbalColumnTreeView
   If (pbVerify(ctl)) Then
      Exists = (ctl.fColumnForIndex(Index) > 0)
   End If
End Function