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
Defines the drag & drop detection attribute.
C
int WINAPI SftTree_GetDragType(HWND hwndCtl); void WINAPI SftTree_SetDragType(HWND hwndCtl, int dragType); int WINAPI SftTreeSplit_GetDragType(HWND hwndCtl); void WINAPI SftTreeSplit_SetDragType(HWND hwndCtl, int dragType);
C++
int CSftTree::GetDragType() const; void CSftTree::SetDragType(int dragType); int CSftTreeSplit::GetDragType() const; void CSftTreeSplit::SetDragType(int dragType);
hwndCtl
The window handle of the tree control.
dragType
A value describing the drag & drop detection method used:
SFTTREE_DRAG_LEAVE | The drag & drop operation can start from a cell and is initiated once the mouse cursor leaves the current item. Before an item can be dragged, it has to be selected using the keyboard or the mouse button and the mouse button has to be released, then a drag & drop operation can be started by pressing the mouse button again. |
SFTTREE_DRAG_LEAVEIMM | The drag & drop operation can start from a cell and is initiated once the mouse cursor leaves the current item. An item can be dragged as it is selected in a single selection tree control (see SFTTREESTYLE_MULTIPLESEL). In a multiple-selection tree, an item has to be selected before it can be dragged (identical to SFTTREE_DRAG_LEAVE). |
SFTTREE_DRAG_LEAVEIMM2 | The drag & drop operation can start from a cell and is initiated once the mouse cursor leaves the current item. An item can be dragged as it is selected in both a single and multiple selection tree control (see SFTTREESTYLE_MULTIPLESEL). |
SFTTREE_DRAG_PIXEL | The drag & drop operation can start from a cell and is initiated once the mouse cursor is moved by a certain pixel distance. Before an item can be dragged, it has to be selected using the keyboard or the mouse button and the mouse button has to be released, then a drag & drop operation can be started by pressing the mouse button again. |
SFTTREE_DRAG_PIXELIMM | The drag & drop operation can start from a cell and is initiated once the mouse cursor is moved by a certain pixel distance. An item can be dragged as it is selected in a single selection tree control (see SFTTREESTYLE_MULTIPLESEL). In a multiple-selection tree, an item has to be selected before it can be dragged (identical to SFTTREE_DRAG_PIXEL). |
SFTTREE_DRAG_PIXELIMM2 | The drag & drop operation can start from a cell and is initiated once the mouse cursor is moved by a certain pixel distance. An item can be dragged as it is selected in both a single and multiple selection tree control (see SFTTREESTYLE_MULTIPLESEL). |
GetDragType returns a value indicating the current drag & drop detection method used.
The GetDragType and SetDragType functions define the drag & drop detection attribute.
A tree control must be defined using the SFTTREESTYLE_DRAGDROP window style to support drag & drop.
SetDragType determines when the SFTTREEN_BEGINDRAG notification is generated to notify the application that a drag & drop operation has been initiated by the user.
A drag & drop operation always starts at the current location described by GetCaretIndex. It is the application's responsibility to visually implement the drag & drop operation.
Depending on SetDragBitmaps, dragging can start on the cell only or also on the label and item pictures.
With some type values, a drag and drop operation starts once the user moves the mouse cursor by a certain pixel distance. The pixel distance used is retrieved by using the Windows API GetSystemMetrics(SM_CX/Y/DRAG).
The settings of the RubberbandSelection property may affect the drag & drop detection.
} }; 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) */
} }; 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) */
See Also C/C++ API | Categories | Notifications