Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » TreeCtrl » Node id calculation after removal ?
Node id calculation after removal ? [message #41884] Mon, 03 February 2014 17:17 Go to previous message
Runik is currently offline  Runik
Messages: 5
Registered: February 2013
Location: France
Promising Member
Hello,

Is there a way to have node ids recalculated after a node removal ?
Currently the removed node stays in the treecontrol in an undefined state, and the following node ids in the hierarchy aren't modified, leading to parent id trouble when you save treecontrol data to a file and load it back ...

I suppose it's performance related, but is there a way to overcome this ?

Thanks Smile

Edit: maybe it'll be clearer with a little schema :

Original treecontrol :
root         // id=0
|-node1      // id=1, parent id=0
|  |-node1.1 // id=2, parent id=1
|-node2      // id=3, parent id=0
|  |-node2.2 // id=4, parent id=3


After removal of node1.1 :
root         // id=0
|-node1      // id=1, parent id=0
|-node2      // id=3, parent id=0
|  |-node2.2 // id=4, parent id=3


After saving to a file and reloading
root         // id=0
|-node1      // id=1, parent id=0
|-node2      // id=2, parent id=0
|  |-node2.2 // id=3, parent id=3 // ASSERT triggered !

[Updated on: Mon, 03 February 2014 17:25]

Report message to a moderator

 
Read Message
Read Message
Previous Topic: SetFocus with EditString as Node
Next Topic: [solved] Can we get the private members of TreeCtrl made protected?
Goto Forum:
  


Current Time: Mon Apr 29 15:11:10 CEST 2024

Total time taken to generate the page: 0.02565 seconds