AutoHotkey Community

It is currently May 27th, 2012, 12:34 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: TreeView - maybe a bug?
PostPosted: December 15th, 2009, 1:20 am 
Offline

Joined: March 23rd, 2006, 2:20 pm
Posts: 128
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")



Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 15th, 2009, 3:57 am 
Offline

Joined: December 21st, 2008, 7:29 pm
Posts: 181
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")
  }
}


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 15th, 2009, 6:19 pm 
Offline

Joined: March 23rd, 2006, 2:20 pm
Posts: 128
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


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: iDrug, Leef_me, Ohnitiel, rjgatito, Yahoo [Bot] and 23 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group