Hide

SftTree/DLL 7.5 - Tree Control

Display
Print

Virtual Data Source

SftTree/DLL supports "flat" lists only in virtual mode. Hierarchies cannot be represented in virtual mode.

A tree control can be populated using conventional methods by adding items one at a time using AddString or InsertString. While there is no built-in limit to the number of items added this way, the more items added, the longer it takes.

If an application already has all items in memory or mapped to a database or some other data source from which items can readily be retrieved, there is no need to add all items to the tree control. A callback function can be supplied to the tree control (see VirtualInitialize). This callback is a "virtual data source". The callback is called by the tree control for each item as it is needed. Usually, only items that are visible in the tree control window need to be retrieved, ranging from one item to maybe a dozen, depending on the size of the tree control. This results in essentially no time spent populating the tree control.

The tree control can be used to display flat lists (without hierarchy) with up to 2,000,000,000 items. Bitmaps, pictures, colors and all tree control data and attributes are provided by application supplied callback functions. This eliminates lengthy initialization when many items are to be displayed.

The virtual data source callback routine can provide all the information to SftTree/DLL, even cell pictures, fonts, etc.

When attaching a content window to a cell, the MakeContentWindow function must be called to notify the tree control. Otherwise, content windows will not be positioned correctly.

Some functions are not available when a virtual data source is used. Most functions which update item or cell information can not be used and return an error. The application cannot update items in the tree control, it must update its (external) data source instead. By using the provided functions VirtualItemChanged and VirtualCount, an application can notify the tree control that items or item count have been modified by the application.