This should illustrate the disappearing panel issue. I've added a sub to toggle the panel's handle so you can see that manually undocking and docking the panel works.
For some reason, if I open the same HTML file in IE it's not controlling the panel. I swear that was working for me before and I don't think anything I did should have broken that. It's a secondary concern if I can get the panel undocking properly, but I'm confused by it all the same.
Both of these should go into /scripts/auto:
panel.html
Code: Select all
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=10">
<meta http-equiv="X-Frame-Options" content="allow">
<title>Test Panel</title>
<script type="text/vbscript">
<!--
Sub dockPanel(where)
Dim panel : set Panel = CreateObject("SongsDB.SDBApplication")
Panel.Objects("testpanel").dockedTo = where
End Sub
Sub toggleHandle()
Dim panel : set Panel = CreateObject("SongsDB.SDBApplication")
If Panel.Objects("testpanel").ShowCaption = true Then
Panel.Objects("testpanel").ShowCaption = false
Else
Panel.Objects("testpanel").ShowCaption = true
End If
End Sub
-->
</script>
</head>
<body style="background-color:#000000; color:#FFFFFF">
<input type="button" value="Top" onclick="vbscript:dockPanel('3')">
<input type="button" value="Bottom" onclick="vbscript:dockPanel('4')">
<input type="button" value="Left" onclick="vbscript:dockPanel('1')">
<input type="button" value="Right" onclick="vbscript:dockPanel('2')">
<input type="button" value="Undock" onclick="vbscript:dockPanel('0')">
<input type="button" value="Toggle Handle" onclick="vbscript:toggleHandle()">
</body>
</html>
testpanel.vbs
Code: Select all
Dim testPanel : Set testPanel = SDB.UI.NewDockablePersistentPanel("testpanel")
Dim testHtmlPnl
Dim Mnu
Sub OnStartup
If testPanel.IsNew then
testPanel.DockedTo = 3
testPanel.Common.Height = 500
End If
testPanel.Caption = "testpanel"
testPanel.ShowCaption = 0
Set testHtmlPnl = SDB.UI.NewActiveX(testPanel, "Shell.Explorer.2")
testHtmlPnl.Common.Align = 5
testHtmlPnl.Interf.Navigate SDB.ScriptsPath & "Auto\panel.html"
Set SDB.Objects("testpanel") = testPanel
Set SDB.Objects("htmltestpanel") = testHtmlPnl
Set Sep = SDB.UI.AddMenuItemSep(SDB.UI.Menu_View,0,0)
Set Mnu = SDB.UI.AddMenuItem(SDB.UI.Menu_View,0,0)
SDB.Objects("TestPanelMenuItem") = Mnu
SDB.Objects("TestPanelSeparator") = Sep
Mnu.Caption = "testpanel"
Mnu.Checked = testPanel.Common.Visible
Script.RegisterEvent Mnu, "OnClick", "ShowPanel"
End Sub
Sub ShowPanel(Item)
testPanel.Common.Visible = not testPanel.Common.Visible
Mnu.Checked = testPanel.Common.Visible
End Sub