Hide

SftTabs/DLL 6.5 - Tab Control

Display
Print

GetDragInfo

Returns the drag & drop information while handling SFTTABSN_DRAGMOVE/SFTTABSN_DRAGDROP notifications.

C

void SftTabs_GetDragInfo(HWND hwndCtl, LPSFTTABS_DRAGINFO lpDragInfo);

C++

void CSftTabs::GetDragInfo(LPSFTTABS_DRAGINFO lpDragInfo) const;

Parameters

hwndCtl

The window handle of the tab control where tab reordering or drag & drop originated.

lpDragInfo

A pointer to a SFTTABS_DRAGINFO structure containing the drag & drop definitions. GetDragInfo uses this structure to return the current drag & drop information.

Comments

The GetDragInfo function returns the drag & drop information while handling SFTTABSN_DRAGMOVE/SFTTABSN_DRAGDROP notifications.

GetDragInfo and SetDragInfo can be used to disallow dragging to a target window (see SFTTABS_DRAGINFO, targetAllowed).

Examples

C

                        // couldn't deactivate current page, so don't switch
                        SendMessage(hwndCtl, WM_CANCELMODE, 0, 0);
                    break;
                case SFTTABSN_SWITCHED:// we switched to a new page
                    SftTabs_ActivatePage(hwnd, hwndCtl, NULL, FALSE);
                    break;
                case SFTTABSN_DRAGDROP: { // {popup "tab reordering" pop_tabreordering}
                    SFTTABS_DRAGINFO dragInfo;
                    SftTabs_GetDragInfo(hwndCtl, &dragInfo);
                    if (dragInfo.targetAllowed) {
                        SftTabs_MoveTab(hwndCtl, dragInfo.reorderTab, dragInfo.targetTab);
                    }
                    break;
                 }
                }
                break;

C++

    // 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)
{
    if( !CMDIFrameWnd::PreCreateWindow(cs) )
        return FALSE;

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


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