"Sort" method for TreeView - not implemented or not working

Issue #31 closed
Winter Laite created an issue

AHK code (working, basically from docs page)

MyGui := Gui(, "TreeView")
MyGui.Opt("+Resize")
TV := MyGui.Add("TreeView", "xp y+5 w200 h200 -ReadOnly") ;
TV.OnEvent("ItemEdit", MyTreeView_Edit)
P1 := TV.Add("First parent")
P1C1 := TV.Add("Parent 1's first child", P1)  ; Specify P1 to be this item's parent.
P2 := TV.Add("Second parent")
P2C1 := TV.Add("Parent 2's first child", P2)
P2C2 := TV.Add("Parent 2's second child", P2)
P2C2C1 := TV.Add("Child 2's first child", P2C2)

MyGui.Show()

MyTreeView_Edit(TV, Item) {

    TV.Modify(TV.GetParent(Item), "Sort")  ; This works even if the item has no parent.
}

Non-sorting KS code:

MyGui := Gui(, "TreeView")
MyGui.Opt("+Resize")
TV := MyGui.AddTreeView("xp y+5 w200 h200 -ReadOnly") ; Need to work on "Sort"
TV.OnEvent("ItemEdit", "MyTreeView_Edit")
P1 := TV.Add("First parent")
P1C1 := TV.Add("Parent 1's first child", P1)  ; Specify P1 to be this item's parent.
P2 := TV.Add("Second parent")
P2C1 := TV.Add("Parent 2's first child", P2)
P2C2 := TV.Add("Parent 2's second child", P2)
P2C2C1 := TV.Add("Child 2's first child", P2C2)

MyGui.Show()

MyTreeView_Edit(TV, Item) {

    TV.Modify(TV.GetParent(Item), "Sort")  ; This works even if the item has no parent.
}

Comments (5)

  1. Log in to comment