SftTree/DLL 6.5

ItemExpand

Softel vdm, Inc.

Defines an item's expand status.

C

BOOL WINAPI SftTree_GetItemExpand(HWND hwndCtl, int index);
BOOL WINAPI SftTree_SetItemExpand(HWND hwndCtl, int index, BOOL fExpand, BOOL fDepth);
BOOL WINAPI SftTreeSplit_GetItemExpand(HWND hwndCtl, int index);
BOOL WINAPI SftTreeSplit_SetItemExpand(HWND hwndCtl, int index, BOOL fExpand, BOOL fDepth);

C++

BOOL CSftTree::GetItemExpand(int index) const;
BOOL CSftTree::SetItemExpand(int index, BOOL fExpand = TRUE, BOOL fDepth = FALSE);
BOOL CSftTreeSplit::GetItemExpand(int index) const;
BOOL CSftTreeSplit::SetItemExpand(int index, BOOL fExpand = TRUE, BOOL fDepth = FALSE);

Parameters

hwndCtl

The window handle of the tree control.

index

The zero-based index of the item for which the expand status is to be retrieved or set.

fExpand

Set to TRUE to expand the item or FALSE to collapse the item.

fDepth

Set to TRUE to expand the item's indirect dependents in addition to the immediate dependents.  This parameter is ignored if fExpand is set to FALSE.

Returns

GetItemExpand returns the current expand status of the specified item, TRUE if one or more dependent items are visible (the item is expanded), FALSE if no dependents are visible or if the item doesn't have any dependents.

SetItemExpand returns TRUE if the function was successful, otherwise FALSE is returned.

Comments

The GetItemExpand and SetItemExpand functions define an item's expand status.

SetItemExpand does not preserve the expand/collapse state of dependent items.  Use the Collapse function instead, which can optionally preserve this information.

An item can be expanded/collapsed under program control using SetItemExpand.  To determine if an item can be expanded, GetDependentCount can be used.

An item must currently be shown in order to be expanded or collapsed using this function.  Use SetItemShown to make an item visible.

SetItemExpand only takes effect when an item is a parent item (has child items), otherwise it is ignored and SetItemExpand will return FALSE. When items are added to a collapsed parent item (using the AddString, InsertString and the ItemLevel functions), the parent item is automatically expanded.

In a tree control using a virtual data source, SetItemExpand cannot be used and an error is returned. 

See Also  C/C++ API  |  CategoriesNotifications

 


Feedback / comments / error reports for this topic
© 2009 - Softel vdm, Inc. - www.softelvdm.com