Home » U++ Library support » TreeCtrl » treectrl with ctrl
Re: treectrl with ctrl [message #23431 is a reply to message #22925] |
Mon, 19 October 2009 09:07   |
 |
kohait00
Messages: 939 Registered: July 2009 Location: Germany
|
Experienced Contributor |
|
|
the goal behind all this is to be able to put something down in the TreeCtrl (be it a key/value pair or a Ctrl content), tag with a kind of hash information and later be able to retrieve exactly this element again, using the key. well, as it seems it works quite well with the key/value approach, but using ctrl as content, there is no way to assign a hash, that is kept *inside* the tree ctrl and not propagated to the ctrl itself. Find'ing the key then results in a for loop, which again decides, where to take the value, from the internal key database or from the control.
but imagine controls that dont support GetData/SetData, like simple ParentCtrl containing others..this would not work.
thats somehow a drawback in double sense (we use the keys only for verification, not for hasching, --> performance)
maybe instead of setting up another SetData() in the Ctrl:: one could just think of an additional method in the TreeCtrl (and maybe the other controls with the same respective behaviour), something like a
void SetK(int id, Value key); which does *not* propagate it to a ctrl's SetData but still sets the internal keys, and a FindK(Value key) method which only searches the internal keys, no matter what content, control or key/value.
so one could still use the Find(Value key) methods, and use the others if one knows what to do.. changig the API is hard, when we have a lot of progs already used to this behaviour.
cheers
|
|
|
Goto Forum:
Current Time: Sat Apr 26 08:46:32 CEST 2025
Total time taken to generate the page: 0.00623 seconds
|