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 information about the currently sorted column.
C
BOOL WINAPI SftTree_GetSortColumn1(HWND hwndCtl, int* realCol, int* sortStyle); BOOL WINAPI SftTreeSplit_GetSortColumn1(HWND hwndCtl, int* realCol, int* sortStyle);
C++
void CSftTree::GetSortColumn1(int& realCol, int& sortStyle) const; void CSftTreeSplit::GetSortColumn1(int& realCol, int& sortStyle) const;
hwndCtl
The window handle of the tree control.
realCol
A pointer to a field (C) or a reference (C++) where the real column number of the currently sorted column is returned. The value -1 is returned if no column has a sort indicator.
sortStyle
A pointer to a field (C) or a reference (C++) where the sort style of the currently sorted column is returned.
Value | Description |
---|---|
SFTTREE_SORT_ASC | The sort indicator is shown as "ascending sort". |
SFTTREE_SORT_DESC | The sort indicator is shown as "descending sort". |
The return value is TRUE if the function was successful, otherwise FALSE is returned.
The GetSortColumn1 function returns information about the currently sorted column.
Only one column can be sorted ascending or descending at a time using the built-in sort handling using EnableSortIndicators with fAuto set to TRUE.
The GetSortColumn1 function is typically used when the SFTTREEN_LBUTTONDBLCLK_COLUMN_HEADER notification is received to retrieve the currently sorted column and its sort order so the application can sort the items using a call to the SortDependents function.
The EnableSortIndicators function is used to enable sort indicators in column headers.
SftTree_RecalcHorizontalExtent(g_hwndTree);/* Update horizontal scroll bar */ } break; } case SFTTREEN_LBUTTONDOWN_COLUMN_HEADER: case SFTTREEN_LBUTTONDBLCLK_COLUMN_HEADER: { /* The user clicked/double-clicked the header */ int sortCol, sortStyle; if (SftTree_GetSortColumn1(g_hwndTree, &sortCol, &sortStyle)) {/* Retrieve the current sort column */ BOOL ascending = (sortStyle == SFTTREE_SORT_ASC); SftTree_SortColDependentsEx(g_hwndTree, -1, sortCol, ascending ? Tree_SortCallbackExAscending : Tree_SortCallbackExDescending);/* Sort level 0 items using the column and order specified */ } break; } case SFTTREEN_LBUTTONDOWN_COLUMN_HEADERDD:
/* This sample code sorts the selected column (items on */ /* level 0 ONLY) based on the current sort indicator which */ /* is automatically managed by the tree control. */ void CSampleView::OnColumnHeaderClick() { int sortCol, sortStyle; if (m_Tree.GetSortColumn1(sortCol, sortStyle)) {/* Retrieve the current sort column */ BOOL ascending = (sortStyle == SFTTREE_SORT_ASC); m_Tree.SortDependents(-1, sortCol, ascending ? SortCallbackExAscending : SortCallbackExDescending);/* Sort level 0 items using the column and order specified */ } } /* Colummn Dropdown/Filter was clicked */ void CSampleView::OnColumnHeaderDDClick()
See Also C/C++ API | Categories | Notifications