VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "SAToolBarExtension"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Attribute VB_Ext_KEY = "SavedWithClassBuilder6" ,"Yes"
Attribute VB_Ext_KEY = "Top_Level" ,"Yes"
Option Explicit

Private m_lngExtensionToolID As Long
Private m_strExtensionEventMacro As String
Private m_strExtensionGuid As String
Private m_lngInternalToolID As Long
Private m_objSAToolbarTool As SAToolbarTool
Private m_varPreviousState As Variant

Friend Sub Init(ByVal v_lngInternalToolID, ByVal v_lngExtensionToolID As Long, ByVal v_strExtensionGUID As String)
    m_lngExtensionToolID = v_lngExtensionToolID
    m_strExtensionGuid = v_strExtensionGUID
    m_lngInternalToolID = v_lngInternalToolID
    m_varPreviousState = ""
End Sub

Friend Property Get InternalToolID() As Long
    InternalToolID = m_lngInternalToolID
End Property

Friend Property Get ExtensionToolID() As Long
    ExtensionToolID = m_lngExtensionToolID
End Property

Friend Property Get ExtensionGuid() As String
    ExtensionGuid = m_strExtensionGuid
End Property

Friend Property Get ExtensionEventMacro() As String
    ExtensionEventMacro = m_strExtensionEventMacro
End Property

Friend Property Let ExtensionEventMacro(ByVal value As String)
        m_strExtensionEventMacro = value
End Property

Friend Property Get SATBTool() As SAToolbarTool
    On Error Resume Next
    Set SATBTool = m_objSAToolbarTool
End Property

Public Property Get Text() As String
    'Text = SATBTool.Tool.Text
    Text = SATBTool.Text
End Property

Public Property Let Text(ByVal val As String)
    'SATBTool.Tool.Text = val
    SATBTool.Text = val
    m_varPreviousState = val
    bMenusChanged = True
End Property

Public Property Get ToolTip() As String
    ToolTip = SATBTool.ToolTipText
End Property

Public Property Let ToolTip(ByVal val As String)
    SATBTool.ToolTipText = val
    bMenusChanged = True
End Property

Public Property Get Caption() As String
    Caption = SATBTool.Caption
End Property

Public Property Let Caption(ByVal val As String)
    SATBTool.Caption = val
    bMenusChanged = True
End Property

Friend Property Set SATBTool(ByRef r_val As SAToolbarTool)
    Set m_objSAToolbarTool = r_val
End Property

Friend Property Get PreviousState() As Variant
    PreviousState = m_varPreviousState
End Property

Friend Sub ResetPreviousState()
    Select Case SATBTool.ControlType
        Case SATB_TT_EDIT, SATB_TT_COMBOBOX
            SATBTool.Text = m_varPreviousState
    End Select
    bMenusChanged = True
End Sub

Friend Sub UpdatePreviousState()
    Select Case SATBTool.ControlType
        Case SATB_TT_EDIT, SATB_TT_COMBOBOX
            m_varPreviousState = SATBTool.Text
    End Select
    bMenusChanged = True
End Sub

Public Property Get Checked() As Boolean
    Checked = SATBTool.Checked
End Property

Public Property Let Checked(ByVal val As Boolean)
    SATBTool.Checked = val
    bMenusChanged = True
End Property

Public Property Get CBListIndex() As Long
    CBListIndex = SATBTool.CBListIndex
End Property

Public Sub CBListAdd(ByVal strText As String)
    SATBTool.CBListAddItem strText
End Sub

Public Sub CBListClear()
    m_varPreviousState = ""
    SATBTool.CBListClear
End Sub

Public Function CBListFindItem(ByVal value As String) As Long
    CBListFindItem = SATBTool.CBListFindItem(value)
End Function
