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
The SFTTREE_DRAGINFO structure is used during drag & drop operations and can be retrieved using GetDragInfo.
typedef struct tagSftTreeDragInfo { /* read/only fields */ POINT ptDrag; // screen coordinate of mouse cursor HWND hwnd; // window under mouse cursor int index; // current drop entry, -1 if dropped // outside of tree BOOL fMultiple; // moving/copying more than one item BOOL fControl; // TRUE if control key pressed BOOL fShift; // TRUE if shift key pressed int button; // button used for dragging #define SFTTREE_LBUTTON 1 #define SFTTREE_MBUTTON 2 #define SFTTREE_RBUTTON 3 /* fields set by application: */ BOOL fDropOK; // set to FALSE if drop not possible HCURSOR hCursor; // application-defined cursor (drag) BOOL fLeftTree; // True if left side tree control is drag source } SFTTREE_DRAGINFO, * LPSFTTREE_DRAGINFO;
Not modifiable. The current screen coordinates of the mouse cursor.
Not modifiable. The handle of the window under the mouse cursor.
Not modifiable. Current entry where items could be dropped.
This field may be -1 if the items will be dropped outside the tree control (even in another tree control).
Not modifiable. TRUE if more than one item is being dragged, otherwise FALSE.
Not modifiable. TRUE if the Control key is pressed, otherwise FALSE.
Not modifiable. TRUE if the Shift key is pressed, otherwise FALSE.
One of the values SFTTREE_LBUTTON, SFTTREE_MBUTTON or SFTTREE_RBUTTON indicating which button is used for the operation.
Modifiable. An application can set this to TRUE or FALSE to indicate dropping is currently not possible while processing a SFTTREEN_BEGINDRAG or SFTTREEN_DRAGGING notification. fDropOK has no effect on how SftTree/DLL handles the drag & drop. The field is for use by the application only and is preserved between all drag & drop events.
An application can set the desired mouse cursor while processing a SFTTREEN_BEGINDRAG or SFTTREEN_DRAGGING notification. By default, SftTree/DLL will set a "don't-drop" cursor if dragging outside the current tree control and a simple drop cursor inside the tree control. Implementation of a copy/move cursor based on the number of items or the Control or Shift keys is up to the application.
In a split tree control, fLeftTree is set to TRUE if the drag & drop operation started in the left pane, otherwise it is set to FALSE.
The SFTTREE_DRAGINFO structure is used during drag & drop operations and can be retrieved using GetDragInfo.
To find out more about the current drag & drop operation, an application can use GetDragInfo, which makes a pointer to the SFTTREE_DRAGINFO structure available. This area is only valid while processing one WM_COMMAND notification and must be retrieved for each notification. Some of the SFTTREE_DRAGINFO members are modifiable. GetDragInfo should be used when processing SFTTREEN_BEGINDRAG, SFTTREEN_DRAGGING, SFTTREEN_ENDDRAG or SFTTREEN_CANCELDRAG notifications.
A tree control must be defined using the SFTTREESTYLE_DRAGDROP window style to support drag & drop.
/**********************************************************************/ /* Left Tree Control Handling */ /**********************************************************************/ static void DraggingLeft() { /* Drag & drop in progress, which was started on the left side tree */ LPSFTTREE_DRAGINFO lpInfo; lpInfo = SftTree_GetDragInfo(m_hwndLeftTree); if (lpInfo->hwnd != m_hwndLeftTree) { // The target is another window // clear old drop target if (m_hwndLastTarget) { SftTree_SetDropHighlight(m_hwndLastTarget, -1, FALSE); SftTree_StopAutoExpandTimer(m_hwndLastTarget);
m_LeftTree.Expand(index, TRUE, FALSE); } void CSampleDlg::OnEndDragLeft() { /* The user dropped something */ LPSFTTREE_DRAGINFO lpInfo; int index; CString str, text; lpInfo = m_LeftTree.GetDragInfo(); if (lpInfo->hwnd != m_LeftTree.m_hWnd) { // The target is another window // In this example the "other" control could be the right tree control
See Also C/C++ API | Categories | Notifications