Hide

SftTree/DLL 7.5 - Tree Control

Display
Print

Fixed / Variable Height Items

There are two methods by which a tree control determines the height of an item in the list. Based on the window style SFTTREESTYLE_VARIABLE, a variable height or fixed height tree control is created.

Fixed Height Tree Control

In a fixed height tree control, each item has the same height. SftTree/DLL determines the best item height for all items by analyzing the default font height (WM_SETFONT, CWnd::SetFont), the number of text lines (SetItemLines), the registered cell picture height (SetCellInfo), 3D display mode (SetShow3D), the registered label picture height (SetItemLabelPicture), the registered plus/minus bitmap height (SetPlusMinus), the expand/collapse button bitmap height, the tree line style (SetTreeLineStyle), the registered item picture height (SetItemPicture), grid line style (SetShowGrid), the row header font (SetRowHeaderFont), the registered row header picture height (SetRowInfo) and the number of text lines (RowHeaderLines). If a component is not used, it is not considered to determine the best height.

Cell fonts (SetCellInfo) are not considered. If a cell font is used in a fixed height tree control, the application must insure that the cell font is not larger than the default font.

All row header pictures must be the same height and width (SetRowInfo).

All label pictures must be the same height and width as the registered label picture (SetItemLabelPicture).

All item pictures must be the same height and width (SetItemPicture).

All cell pictures in all columns must be the same height and width as the registered cell picture (SetCellInfo).

An application can override the height of all items using the SetItemHeightMinMax function.

Variable Height Tree Control

In a variable height tree control, items have varying heights. Each item's height is individually recalculated as attributes change. This places an additional performance constraint on the tree control, so the window style SFTTREESTYLE_VARIABLE should only be used when variable height items are necessary.

SftTree/DLL determines the best item height for each item by analyzing the default font height (WM_SETFONT, CWnd::SetFont), the cell font and cell picture height for each column (SetCellInfo), the number of text lines (SetItemLines) and word wrap style for each cell (SetColumns), 3D display mode (SetShow3D), the item's label picture height (SetItemLabelPicture), the registered plus/minus bitmap height (SetPlusMinus), the expand/collapse button bitmap height, the tree line style (SetTreeLineStyle), the item's item picture height (SetItemPicture), grid line style (SetShowGrid), the row header font (SetRowHeaderFont), the item's row header picture height (SetRowInfo) and the maximum number of text lines (RowHeaderLines). If a component is not used, it is not considered to determine the best height.

An application can override the item height using the SetItemHeightMinMax function or for virtual mode, using the minHeight, maxHeight members of the SFTTREE_ITEM structure.