Hide

SftTree/DLL 7.5 - Tree Control

Display
Print

ShowFocus

Defines whether a focus rectangle is drawn around the current item when the tree control has the input focus.

C

BOOL WINAPI SftTree_GetShowFocus(HWND hwndCtl);
void WINAPI SftTree_SetShowFocus(HWND hwndCtl, BOOL fSet);
BOOL WINAPI SftTreeSplit_GetShowFocus(HWND hwndCtl);
void WINAPI SftTreeSplit_SetShowFocus(HWND hwndCtl, BOOL fSet);

C++

BOOL CSftTree::GetShowFocus() const;
void CSftTree::SetShowFocus(BOOL fSet = TRUE);
BOOL CSftTreeSplit::GetShowFocus() const;
void CSftTreeSplit::SetShowFocus(BOOL fSet = TRUE);

Parameters

hwndCtl

The window handle of the tree control.

fSet

Set to TRUE to display the focus rectangle, otherwise set to FALSE.

Returns

GetShowFocus returns a value indicating whether a focus rectangle is drawn around the current item when the tree control has the input focus. TRUE is returned if the focus rectangle is drawn, otherwise FALSE is returned.

Comments

The GetShowFocus and SetShowFocus functions define whether a focus rectangle is drawn around the current item when the tree control has the input focus.

The focus rectangle is used to indicate to the user which item is the current item (see GetCaretIndex). An application could turn off the focus rectangle to change the display style of the current item by using cell foreground and background colors instead.

Examples

C

        m_hwndRightTree = GetDlgItem(hwndDlg, IDC_RIGHTTREE);

        SftTree_SetTreeLineStyle(m_hwndRightTree, SFTTREE_TREELINE_AUTOMATIC0);/* Dotted or invisible tree lines (incl. level 0) */
        SftTree_SetShowButtons(m_hwndRightTree, TRUE);/* Expand/collapse buttons (level 1..n) */
        SftTree_SetShowButton0(m_hwndRightTree, TRUE);/* Show expand/collapse buttons (level 0) */
        SftTree_SetButtons(m_hwndRightTree, SFTTREE_BUTTON_AUTOMATIC3);/* Automatic button style 3 */
        SftTree_SetShowTruncated(m_hwndRightTree, TRUE);/* Show ... if truncated */
        SftTree_SetShowFocus(m_hwndRightTree, FALSE);/* Don't show focus rectangle (caret) */
        SftTree_SetSelectionStyle(m_hwndRightTree, SFTTREE_SELECTION_CELL1 | SFTTREE_SELECTION_OUTLINE);/* Select first cell only using outline */
        SftTree_SetSelectionArea(m_hwndRightTree, SFTTREE_SELECTIONAREA_ALL);/* Selection changes by clicking anywhere on an item */
        SftTree_SetFlyby(m_hwndRightTree, TRUE);/* Flyby highlighting */
        SftTree_SetScrollTips(m_hwndRightTree, TRUE);/* Show Scrolltips */
        SftTree_SetOpenEnded(m_hwndRightTree, TRUE);/* Last column width */

        /* Define columns */
        {

C++

    // DDX_Control(pDX, IDC_RIGHTTREE, m_RightTree);


    m_RightTree.SetTreeLineStyle(SFTTREE_TREELINE_AUTOMATIC0);/* Dotted or invisible tree lines (incl. level 0) */
    m_RightTree.SetShowButtons(TRUE);    /* Expand/collapse buttons (level 1..n) */
    m_RightTree.SetShowButton0(TRUE);    /* Show expand/collapse buttons (level 0) */
    m_RightTree.SetButtons(SFTTREE_BUTTON_AUTOMATIC3);/* Automatic button style 3 */
    m_RightTree.SetShowTruncated(TRUE);  /* Show ... if truncated */
    m_RightTree.SetShowFocus(FALSE);     /* Don't show focus rectangle (caret) */
    m_RightTree.SetSelectionArea(SFTTREE_SELECTIONAREA_ALL);/* Selection changes by clicking anywhere on an item */
    m_RightTree.SetSelectionStyle(SFTTREE_SELECTION_CELL1 | SFTTREE_SELECTION_OUTLINE);/* Select first cell only using outline */
    m_RightTree.SetFlyby(TRUE);          /* Flyby highlighting */
    m_RightTree.SetScrollTips(TRUE);     /* Show Scrolltips */
    m_RightTree.SetOpenEnded(TRUE);      /* Last column width */
    /* Define columns */
    {

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