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 » PROPOSAL: TreeCtrl optionally owns Ctrl's in Node
Re: PROPOSAL: TreeCtrl optionally owns Ctrl's in Node [message #32683 is a reply to message #32530] Wed, 01 June 2011 20:49 Go to previous message
mirek is currently offline  mirek
Messages: 13976
Registered: November 2005
Ultimate Member
kohait00 wrote on Mon, 23 May 2011 16:57

i will be warming up this thing, but need an advice in which direction to go:

the key problem in TreeCtrl is that Node is meant to be passed around by-value, i.e. performing DnD movings or using the Copy() function..

when a Node references a Ctrl which it owns, it cant be passed around by-value, it either needs to be picked (dtor would take care of destruciton of Ctrl) or a different Method for Moving/DnD of the Nodes needs to be found to avoid copy which would duplicate the Node and double ownership. so Node might need to stay unmouvable (exposed only as const or have a subclass which actually holds the ctrl..

any idea? i dont know what'd be better.


Well, general advice in this case is to "give up" Smile

I mean, do not support "predefined" DnD ops for Ctrl owning TreeCtrl. If programmer wants this, he needs to provide his specialized methods.

Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Changing tree control style
Next Topic: PROPOSAL : allow inserting and retrieving of classes DERIVED from TreeCtrl::Node
Goto Forum:
  


Current Time: Thu May 09 20:42:02 CEST 2024

Total time taken to generate the page: 0.02601 seconds