View Issue Details

IDProjectCategoryView StatusLast Update
0007369MMW v4Framework: Scripts/Extensionspublic2011-02-13 11:06
Reporterzvezdan Assigned To 
PrioritynoneSeverityminorReproducibilityalways
Status newResolutionopen 
Summary0007369: OnFillTracks is not fired after OnNodeFocused in some cases
DescriptionHere is the test script which could always reproduce this issue in MM4, however I cannot find in which occasions this happens in MM3 (but it happens):
Option Explicit

Dim oMyNode1
Dim oMyNode2

Sub OnStartup()
    Dim oMenuItem

    Set oMyNode1 = SDB.MainTree.CreateNode
    oMyNode1.Caption = "Test Node 1"
    Script.RegisterEvent oMyNode1, "OnFillTracks", "OnFillTracks"
    SDB.MainTree.AddNode SDB.MainTree.Node_Library, oMyNode1, 1

    Set oMyNode2 = SDB.MainTree.CreateNode
    oMyNode2.Caption = "Test Node 2"
    Script.RegisterEvent oMyNode2, "OnFillTracks", "OnFillTracks"
    SDB.MainTree.AddNode oMyNode1, oMyNode2, 3

    Set oMenuItem = SDB.UI.AddMenuItem(SDB.UI.Menu_Edit, 0, 0)
    oMenuItem.Caption = "Disable OnNodeFocused"
    oMenuItem.UseScript = Script.ScriptPath
    oMenuItem.OnClickFunc = "Disable_Focused"

    Set oMenuItem = SDB.UI.AddMenuItem(SDB.UI.Menu_Edit, 0, 0)
    oMenuItem.Caption = "Enable OnNodeFocused"
    oMenuItem.UseScript = Script.ScriptPath
    oMenuItem.OnClickFunc = "Enable_Focused"

    Enable_Focused oMenuItem
End Sub

Sub OnFillTracks(oCurNode)
    If Not oCurNode Is Nothing Then
        MsgBox "OnFillTracks" & vbCr & oCurNode.Caption
    Else
        MsgBox "OnFillTracks - oCurNode Is Nothing"
    End If
End Sub

Function OnNodeFocused(oCurNode)
    If Not oCurNode Is Nothing Then
        MsgBox "OnNodeFocused" & vbCr & oCurNode.Caption
    Else
        MsgBox "OnNodeFocused - oCurNode Is Nothing"
    End If
End Function

Sub Enable_Focused(oMenuItem)
    Script.RegisterEvent oMyNode1, "OnNodeFocused", "OnNodeFocused"
    Script.RegisterEvent oMyNode2, "OnNodeFocused", "OnNodeFocused"
End Sub

Sub Disable_Focused(oMenuItem)
    Script.UnRegisterHandler "OnNodeFocused"
End Sub
Steps To ReproduceA1. Select Playlist or some other built-in topmost node;
A2. exit MM, put the test script in the Auto folder and start MM again;
A3. expand Test Node 1;
A4. click on Test Node 2 -> OnFillTracks is not fired;
A5. click on Test Node 1 -> OnFillTracks is not fired.

B1. Select Playlist or some other built-in topmost node;
B2. exit MM, put the test script in the Auto folder and start MM again;
B3. click on Test Node 1 -> OnFillTracks is fired;
B4. expand Test Node 1;
B5. click on Test Node 2 -> OnFillTracks is fired.

If you disable OnNodeFocused using the menu option, OnFillTracks is fired even in the A) example.
TagsNo tags attached.
Fixed in build

Activities

There are no notes attached to this issue.