AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

TreeView - maybe a bug?

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
rousni



Joined: 23 Mar 2006
Posts: 126

PostPosted: Tue Dec 15, 2009 12:20 am    Post subject: TreeView - maybe a bug? Reply with quote

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
View user's profile Send private message
entropic



Joined: 21 Dec 2008
Posts: 181

PostPosted: Tue Dec 15, 2009 2:57 am    Post subject: Reply with quote

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
View user's profile Send private message
rousni



Joined: 23 Mar 2006
Posts: 126

PostPosted: Tue Dec 15, 2009 5:19 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group