Hide

SftTree/DLL 7.5 - Tree Control

Display
Print

ReorderColumns

Defines whether columns can be reordered using column drag & drop.

C

BOOL WINAPI SftTree_GetReorderColumns(HWND hwndCtl);
void WINAPI SftTree_SetReorderColumns(HWND hwndCtl, BOOL fSet);
BOOL WINAPI SftTreeSplit_GetReorderColumns(HWND hwndCtl);
void WINAPI SftTreeSplit_SetReorderColumns(HWND hwndCtl, BOOL fSet);

C++

BOOL CSftTree::GetReorderColumns() const;
void CSftTree::SetReorderColumns(BOOL fSet = TRUE);
BOOL CSftTreeSplit::GetReorderColumns() const;
void CSftTreeSplit::SetReorderColumns(BOOL fSet = TRUE);

Parameters

hwndCtl

The window handle of the tree control.

fSet

Set to TRUE to enable column reordering, otherwise set to FALSE.

Returns

GetReorderColumns returns TRUE if columns can be reordered by the user using the mouse, otherwise FALSE is returned.

Comments

The GetReorderColumns and SetReorderColumns functions define whether columns can be reordered using column drag & drop.

Individual columns can be locked in place even if column reordering is in effect, by adding the SFTTREE_COL_KEEPPOS value to the colFlag member of the SFTTREE_COLUMN_EX structure. SFTTREE_COL_KEEPPOS causes the column to remain in the current display position.

If an application wants to retain the column order between sessions, the dispPos member of the SFTTREE_COLUMN_EX structure must be saved for each column. When the application is restarted and the tree control is reinitialized, the values of the dispPos member can be restored for each column before calling SetColumns. An INI file or the Windows Registry can be used to save these values.

In a split tree control columns can only be reordered within the left side or the right side. It is not possible to drag columns from one pane to the other.

Also see the section "Column Drag & Drop" for additional information.

Examples

C

        SftTree_SetGridStyle(g_hwndTree, SFTTREE_GRID_BOTH_DOT);/* Dotted grid lines */
        SftTree_SetShowTruncated(g_hwndTree, TRUE);/* Show ... if truncated */
        SftTree_SetSelectionStyle(g_hwndTree, SFTTREE_SELECTION_ALL | SFTTREE_SELECTION_OUTLINE);/* Select entire item using outline */
        SftTree_SetSelectionArea(g_hwndTree, SFTTREE_SELECTIONAREA_ALLCELLS);/* Selection changes by clicking on an item's cells */
        SftTree_SetFlyby(g_hwndTree, TRUE);  /* Flyby highlighting */
        SftTree_SetUpdateCaretExpandCollapse(g_hwndTree, FALSE);/* don't update caret location when expand/collapse button clicked */
        SftTree_SetScrollTips(g_hwndTree, TRUE);/* Show Scrolltips */
        SftTree_SetInheritBgColor(g_hwndTree, TRUE);/* Inherit background color of first cell */
        SftTree_SetReorderColumns(g_hwndTree, TRUE);/* Column reordering */
        SftTree_SetOpenEnded(g_hwndTree, FALSE);/* Last column width */
        SftTree_SetShowHeaderButtons(g_hwndTree, TRUE);/* Show column header as buttons */

        /* Define control attributes */
        {
            SFTTREE_CONTROL CtrlInfo;
            memset(&CtrlInfo, 0, sizeof(SFTTREE_CONTROL));

C++

    m_Tree.SetGridStyle(SFTTREE_GRID_BOTH_DOT);/* Dotted grid lines */
    m_Tree.SetShowTruncated(TRUE);       /* Show ... if truncated */
    m_Tree.SetSelectionStyle(SFTTREE_SELECTION_ALL | SFTTREE_SELECTION_OUTLINE);/* Select entire item using outline */
    m_Tree.SetSelectionArea(SFTTREE_SELECTIONAREA_ALLCELLS);/* Selection changes by clicking on an item's cells */
    m_Tree.SetFlyby(TRUE);               /* Flyby highlighting */
    m_Tree.SetUpdateCaretExpandCollapse(FALSE);/* don't update caret location when expand/collapse button clicked */
    m_Tree.SetScrollTips(TRUE);          /* Show Scrolltips */
    m_Tree.SetInheritBgColor(TRUE);      /* Inherit background color of first cell */
    m_Tree.SetReorderColumns(TRUE);      /* Column reordering */
    m_Tree.SetOpenEnded(FALSE);          /* Last column width */
    m_Tree.SetShowHeaderButtons(TRUE);   /* Show column header as buttons */

    /* Define control attributes */
    {
        SFTTREE_CONTROL CtrlInfo;
        memset(&CtrlInfo, 0, sizeof(SFTTREE_CONTROL));

See Also C/C++ API | Categories | Notifications