Hide

SftTabs/DLL 6.5 - Tab Control

Display
Print

SFTTABS_DRAGINFO Structure

The SFTTABS_DRAGINFO structure is used with GetDragInfo/SetDragInfo during tab reordering and drag & drop.

typedef struct tagTabsDragInfo {        // {popup "drag & drop" pop_dragdrop} information

    HWND targetWindow;                  // target window
    BOOL targetIsTabControl;            // TRUE if target window is a tab control
    int targetTab;                      // insertion point (for tab control only)
    POINT targetCursorPoint;            // last cursor position (in targetWindow client coordinates)
    BOOL targetAllowed;                 // TRUE if target window is allowed as drop target

    HWND sourceWindow;                  // source window for drag&drop
    int reorderTab;                     // tab being dragged (from sourceWindow)
    POINT reorderPt;                    // where mouse button was initially clicked (in sourceWindow client coordinates)

} SFTTABS_DRAGINFO, * LPSFTTABS_DRAGINFO;
typedef const SFTTABS_DRAGINFO * LPCSFTTABS_DRAGINFO;

Members

targetWindow

Defines the target window, currently located at the mouse cursor position.

targetIsTabControl

If the target window, currently located at the mouse cursor position, is a SftTabs/DLL tab control, the value is TRUE, FALSE otherwise.

targetTab

If the current target window is a SftTabs/DLL tab control, this member defines the current zero-based insertion point for the tab being moved.

targetCursorPoint

Defines the mouse cursor position in client coordinates within the target window targetWindow.

targetAllowed

Defines whether the current target is an allowable drop target. Set to TRUE to allow the tab to be dropped at the current position (defined by targetWindow, targetTab), FALSE otherwise. When modifying the targetAllowed member, the SetDragInfo function must be called. This is only possible while handling a SFTTABSN_DRAGMOVE event to signal whether the current target is an allowable drop target.

sourceWindow

Defines the source window (always a SftTabs/DLL control) where the drag & drop operation started.

reorderTab

Defines the zero-based tab within the source window (tab control) sourceWindow where the drag & drop operation originated.

reorderPt

Defines the coordinates (in client area coordinates) within the source window (tab control) sourceWindow where the drag & drop operation originated.

Comments

The SFTTABS_DRAGINFO structure is used with GetDragInfo/SetDragInfo during tab reordering and drag & drop.

Examples

C++

        MDINext();

    // Destroy the MDI child window
    pChildFrame->DestroyWindow();
}

void CMainFrame::OnTabsReordered()
{
    SFTTABS_DRAGINFO dragInfo;
    m_MDITab.GetDragInfo(&dragInfo);
    if (dragInfo.targetAllowed)
        m_MDITab.MoveTab(dragInfo.reorderTab, dragInfo.targetTab);
}

BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{

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


Last Updated 08/13/2020 - (email)
© 2024 Softel vdm, Inc.