SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftMask/OCX 7.0 - Masked Edit Control
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftPrintPreview/DLL 2.0 - Print Preview Control (discontinued)
SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftDirectory 3.5 - File/Folder Control (discontinued)
SftMask/OCX 7.0 - Masked Edit Control
SftOptions 1.0 - Registry/INI Control (discontinued)
SftPrintPreview/OCX 1.0 - Print Preview Control (discontinued)
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftTabs/NET 6.0 - Tab Control (discontinued)
SftTree/NET 2.0 - Tree Control
Returns an item's sibling information.
C
int WINAPI SftTree_GetSibling(HWND hwndCtl, int index, int type); int WINAPI SftTreeSplit_GetSibling(HWND hwndCtl, int index, int type);
C++
int CSftTree::GetSibling(int index, int type) const; int CSftTreeSplit::GetSibling(int index, int type) const;
hwndCtl
The window handle of the tree control.
index
The zero-based index number of the item for which sibling item information is to be retrieved.
type
A value indicating the type of sibling item information to retrieve.
SFTTREE_SIBLING_FIRST | Retrieve the index of the item's first sibling. |
SFTTREE_SIBLING_LAST | Retrieve the index of the item's last sibling. |
SFTTREE_SIBLING_PREV | Retrieve the index of the item's previous sibling. |
SFTTREE_SIBLING_NEXT | Retrieve the index of the item's next sibling. |
The return value is the index of the requested sibling item or -1 if the specified item doesn't have a sibling of the specified type.
The GetSibling function returns an item's sibling information.
// sort this item's dependents SftTree_SortColDependentsEx(hwndTree, index, 0, fAscending ? SortCallbackExAscending : SortCallbackExDescending); // now visit all dependents and sort each dependent's child items. if (index < 0) parentIndex = 0; else parentIndex = SftTree_GetDependent(hwndTree, index, SFTTREE_DEPENDENT_FIRST);// start with first item for ( ; parentIndex >= 0 ; parentIndex = SftTree_GetSibling(hwndTree, parentIndex, SFTTREE_SIBLING_NEXT)) { SortItems(hwndTree, parentIndex, fAscending); } } static void SetSortDirection(HWND hwndTree, BOOL fAscending) { ShowSortDirection(hwndTree, fAscending); SortItems(hwndTree, -1, fAscending);
// sort this item's dependents m_Tree.SortDependents(index, 0, fAscending ? SortCallbackExAscending : SortCallbackExDescending); // now visit all dependents and sort each dependent's child items. if (index < 0) parentIndex = 0; else parentIndex = m_Tree.GetDependent(index, SFTTREE_DEPENDENT_FIRST);// start with first item for ( ; parentIndex >= 0 ; parentIndex = m_Tree.GetSibling(parentIndex, SFTTREE_SIBLING_NEXT)) { SortItems(parentIndex, fAscending); } } void CSampleView::SetSortDirection(BOOL fAscending) { ShowSortDirection(fAscending); SortItems(-1, fAscending);
See Also C/C++ API | Categories | Notifications