Hide

SftTree/DLL 7.5 - Tree Control

Display
Print

DropHighlightStyle

Defines the display attribute of the current drag & drop target item.

C

DWORD WINAPI SftTree_GetDropHighlightStyle(HWND hwndCtl);
void WINAPI SftTree_SetDropHighlightStyle(HWND hwndCtl, DWORD style);
DWORD WINAPI SftTreeSplit_GetDropHighlightStyle(HWND hwndCtl);
void WINAPI SftTreeSplit_SetDropHighlightStyle(HWND hwndCtl, DWORD style);

C++

DWORD CSftTree::GetDropHighlightStyle() const;
void CSftTree::SetDropHighlightStyle(DWORD style);
DWORD CSftTreeSplit::GetDropHighlightStyle() const;
void CSftTreeSplit::SetDropHighlightStyle(DWORD style);

Parameters

hwndCtl

The window handle of the tree control.

style

A value describing the drop target display method used for the current drag & drop target defined using SetDropHighlight:

SFTTREE_DROPHIGHLIGHT_CARETThe drop target is the current item (GetCaretIndex). The current item is updated by each call to SetDropHighlight. The drop target becomes the new current item. The target item is not selected, so even in a single selection tree control (see SFTTREESTYLE_MULTIPLESEL) index numbers returned by GetCaretIndex and GetCurSel are not identical.
SFTTREE_DROPHIGHLIGHT_ONTOPThe drag & drop target is highlighted using the color defined by the SFTTREE_COLORS structure member colorDropHighlight (see SetCtlColors). The color is used as background color for the target item. The current item is not updated.
SFTTREE_DROPHIGHLIGHT_BETWEENThe drag & drop target is highlighted using a solid line drawn using the color defined by the SFTTREE_COLORS structure member colorDropHighlight (see SetCtlColors). The line is drawn before the target item, interpreting the value returned by GetDropHighlight as the insertion point.

Returns

GetDropHighlightStyle returns a value indicating the current drop target display method.

Comments

The GetDropHighlightStyle and SetDropHighlightStyle functions define the display attribute of the current drag & drop target item.

A tree control must be defined using the SFTTREESTYLE_DRAGDROP window style to support drag & drop.

Examples

C

            };
            SftTree_SetColumnsEx(m_hwndLeftTree, 1, aCol);/* Set column attributes */
        }

        SftTree_SetShowRowHeader(m_hwndLeftTree, SFTTREE_ROWSTYLE_BUTTONCOUNT0);/* Row style */
        SftTree_SetRowHeaderStyle(m_hwndLeftTree, ES_LEFT | SFTTREE_HEADER_UP);/* Row header style */
        SftTree_SetDragBitmaps(m_hwndLeftTree, TRUE);/* Allow drag & drop from item, label pictures */
        SftTree_SetDragType(m_hwndLeftTree, SFTTREE_DRAG_PIXELIMM);/* Select and move by a number of pixels to start drag */
        SftTree_SetDropHighlightStyle(m_hwndLeftTree, SFTTREE_DROPHIGHLIGHT_BETWEEN);/* Draw line to represent drop target */
        SftTree_SetCharSearchMode(m_hwndLeftTree, SFTTREE_CHARSEARCH_ALLCHARS, -1);/* Consider all characters typed */
        /* Change the default colors */
        {
            SFTTREE_COLORS Colors;
            SftTree_GetCtlColors(m_hwndLeftTree, &Colors);/* Get current color settings */
            Colors.colorSelBgNoFocus = COLOR_BTNFACE | 0x80000000L;/* Selection background color (no input focus) */
            Colors.colorSelFgNoFocus = COLOR_BTNTEXT | 0x80000000L;/* Selection foreground color (no input focus) */

C++

        };
        m_LeftTree.SetColumns(1, aCol);  /* Set column attributes */
    }

    m_LeftTree.SetShowRowHeader(SFTTREE_ROWSTYLE_BUTTONCOUNT0);/* Row style */
    m_LeftTree.SetRowHeaderStyle(ES_LEFT | SFTTREE_HEADER_UP);/* Row header style */
    m_LeftTree.SetDragBitmaps(TRUE);     /* Allow drag & drop from item, label pictures */
    m_LeftTree.SetDragType(SFTTREE_DRAG_PIXELIMM);/* Select and move by a number of pixels to start drag */
    m_LeftTree.SetDropHighlightStyle(SFTTREE_DROPHIGHLIGHT_BETWEEN);/* Draw line to represent drop target */
    m_LeftTree.SetCharSearchMode(SFTTREE_CHARSEARCH_ALLCHARS, -1);/* Consider all characters typed */
    /* Change the default colors */
    {
        SFTTREE_COLORS Colors;
        m_LeftTree.GetCtlColors(&Colors);/* Get current color settings */
        Colors.colorSelBgNoFocus = COLOR_BTNFACE | 0x80000000L;/* Selection background color (no input focus) */
        Colors.colorSelFgNoFocus = COLOR_BTNTEXT | 0x80000000L;/* Selection foreground color (no input focus) */

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