|
Registration method to allocate tree internal data per node.
function AllocateInternalDataArea(Size: Cardinal): Cardinal; virtual;
This method is used for descentants to specify their need for internal data. Each node contains some extra reserved bytes between the node's normal members and the user data area. This internal area can be used to cache additional information, e.g. the string tree keeps here the width of the node's caption in the main column for quick hit tests when doing draw selection with the mouse.
A tree implementation must call this method only once and before any node is created (except the hidden root node which is handled accordingly). The result value is the offset from the start of the node to the internal data area of the node for this tree class. I recommend to implement an access method called InternalData (as shown in TCustomVirtualStringTree) which does the pointer mathematic.
What do you think about this topic? Send feedback!
|