Hide

SftTree/DLL 7.5 - Tree Control

Display
Print

UpdateCaretExpandCollapse

Defines whether the current location (caret) is updated when the expand/collapse buttons are used.

C

BOOL WINAPI SftTree_GetUpdateCaretExpandCollapse(HWND hwndCtl);
void WINAPI SftTree_SetUpdateCaretExpandCollapse(HWND hwndCtl, BOOL fSet);
BOOL WINAPI SftTreeSplit_GetUpdateCaretExpandCollapse(HWND hwndCtl);
void WINAPI SftTreeSplit_SetUpdateCaretExpandCollapse(HWND hwndCtl, BOOL fSet);

C++

BOOL CSftTree::GetUpdateCaretExpandCollapse() const;
void CSftTree::SetUpdateCaretExpandCollapse(BOOL fSet = TRUE);
BOOL CSftTreeSplit::GetUpdateCaretExpandCollapse() const;
void CSftTreeSplit::SetUpdateCaretExpandCollapse(BOOL fSet = TRUE);

Parameters

hwndCtl

The window handle of the tree control.

fSet

Set to TRUE to update the current location (caret) when the expand/collapse buttons are used. Otherwise, set to FALSE.

Returns

GetUpdateCaretExpandCollapse returns TRUE if the current location (caret) is updated when the expand/collapse buttons are used. Otherwise, FALSE is returned.

Comments

The GetUpdateCaretExpandCollapse and SetUpdateCaretExpandCollapse functions define whether the current location (caret) is updated when the expand/collapse buttons are used.

The current location (caret) can be retrieved using the GetCaretIndex function. If the current location is not updated when the expand/collapse buttons are used, the GetExpandCollapseIndex returns the index of the item where the expand/collapse button was used.

GetExpandCollapseIndex returns the same value as GetCaretIndex (i.e., the current item) unless SetUpdateCaretExpandCollapse(FALSE) was used to initialize the tree control. In this case, GetExpandCollapseIndex returns the index of the item whose expand/collapse button was (double-)clicked.

Examples

C

        else
            SftTree_SetButtons(g_hwndTree, SFTTREE_BUTTON_AUTOMATIC3);/* Automatic button style 3 */
        SftTree_SetShowGrid(g_hwndTree, TRUE);/* Show grid */
        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 */

C++

    else
        m_Tree.SetButtons(SFTTREE_BUTTON_AUTOMATIC3);/* Automatic button style 3 */
    m_Tree.SetShowGrid(TRUE);            /* Show grid */
    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 */

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