 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
rousni
Joined: 23 Mar 2006 Posts: 126
|
Posted: Tue Dec 15, 2009 12:20 am Post subject: TreeView - maybe a bug? |
|
|
TV_GetNext(ID, "Full") does not work correctly here:
| Code: |
ID = 0
Loop, % TV_GetCount()
{
ID := TV_GetNext(ID, "Full")
If Not TV_Get(ID, "Expand")
TV_Modify(ID, "Expand")
}
|
The workaround I found (not very elegant) is given below.
| Code: |
ID = 0
Loop, % TV_GetCount()
{
ID := TV_GetNext(ID, "Full")
If Not TV_Get(ID, "Expand")
ID_LIST := ID_LIST . "|" . ID
}
Loop, Parse, ID_LIST, |
TV_Modify(A_LoopField, "Expand")
|
|
|
| Back to top |
|
 |
entropic
Joined: 21 Dec 2008 Posts: 181
|
Posted: Tue Dec 15, 2009 2:57 am Post subject: |
|
|
Is it not expanding all items for you? Can you post your full code? I just did a little test with this code and it worked:
| Code: |
Gui, Add, TreeView,
P1 := TV_Add("First parent")
P1C1 := TV_Add("Parent 1's first child", P1)
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)
test()
Gui, Show
return
GuiClose:
ExitApp
return
Test()
{
ID = 0
Loop, % TV_GetCount()
{
ID := TV_GetNext(ID, "Full")
If Not TV_Get(ID, "Expand")
TV_Modify(ID, "Expand")
}
}
|
|
|
| Back to top |
|
 |
rousni
Joined: 23 Mar 2006 Posts: 126
|
Posted: Tue Dec 15, 2009 5:19 pm Post subject: |
|
|
I tried it and it works, indeed. It was because of the g-Label. I added the CRITICAL option to the thread and now my code (see below) works fine two.
VESTI - Viewer and Editor for Structured Text and Inserter, Versatile plain text editor for programming and structured text
(Help Viewer - Hierarchical Text Editor - HTML tag inserter - ...)
http://web.uni-plovdiv.bg/rousni/vesti.zip |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|