<%
' *****************************************************************************
'
'  NOTE: This file is client side VBScript. The comments are in server side script 
'  so they don't get sent to the client.
'
'  The sample code shows how to create a simple context sensitive button
'
' *****************************************************************************
'
'
' -----------------------------------------------------------------------------
'
'	This is the hook function being called when the Toolbar is initialized for the first time. 
'   The custom code here can add or remove toolbar buttons.
'
'	@pToolbarInterface [in] - Toolbar interface object that can be used to create
'                             button or comboboxes.
'
' sample implementation that creates a new toolbar and adds one button with the id "TestButton" to it:
'
'	Dim pMyTest
'	Set pMyTest = document.ToolbarInterface.Toolbars.CreateToolbar("MyTest" )
'
'	Call pMyTest.AddButton( "TestButton", "", "undo.gif", "TestButton" )
'
'
' -----------------------------------------------------------------------------
%>

Sub OnInternalToolbarInitialize( ByVal pToolbarInterface )

End Sub

<%
' -----------------------------------------------------------------------------
'
'	This hook is called for each placeholder, and is used to initialize the state
'	for that specific placeholder. The toolbar state will already be initialized to
'	its default state.
'
'	@strPlaceholderName [in] - The name of the placeholder we are initializing for
'
'	@pState [in] - The toolbar state of this toolbar. The toolbar state keeps track
'					of the clicked/disabled state for the toolbar for this placeholder.
'
' sample implementation that enables our button only if the InsertTable button is enabled as well:
'
'	If (pState.Item("InsertTable").Allowed = True) Then
'		pState.Item("TestButton").Allowed = True
'	End If
' -----------------------------------------------------------------------------
%>

Sub OnInternalToolbarStateInitialize( ByVal strPlaceholderName, ByVal pState )

End Sub

<%
' -----------------------------------------------------------------------------
'
'	This is the hook function being called when the toolbar state should be
'	updated because there is a change of state or context in the ActiveX
'	placeholder.
'
'	@pActiveHtmlEditor [in] - The currently active DHTML control
'
'	@bEditingSource [in] - TRUE if we are currently in HTML Source Mode
'
' sample implementation that only enables the test button in non-HTML edit mode
'
'	If bEditingSource Then
'		pActiveHtmlEditor.ToolbarState.Item("TestButton").Enabled = False
'	Else
'		pActiveHtmlEditor.ToolbarState.Item("TestButton").Enabled = True
'	End If
' -----------------------------------------------------------------------------
%>

Sub OnInternalToolbarUpdate( ByVal pActiveHtmlEditor, ByVal bEditingSource )

End Sub

<%
' -----------------------------------------------------------------------------
'
'	This is the hook function being called when a button is clicked in the 
'	ActiveX toolbar.
'
'	@pActiveHtmlEditor [in] - The currently active DHTML edit control
'
'	@bstrId [in] - The ID of the button or combo box that was clicked on
'
'	@pItem [in] - The item that was clicked on
'
'	@bEditingSource [in] - TRUE if we are currently in HTML Source Mode
'
' sample implementation that shows a message box and makes the current text bold:
'
'	Select Case bstrId
'
'		Case "TestButton"
'			Call MsgBox( "hello!" )
'			pActiveHtmlEditor.dom.execCommand "Bold"
'
'	End Select
' -----------------------------------------------------------------------------
%>

Sub OnInternalToolbarEvent( ByVal pActiveHtmlEditor, ByVal bstrId, ByVal pItem, ByVal bEditingSource )

End Sub

