Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » CExtTreeGridWnd - how do I replace the various drag & drop cursors Collapse All
Subject Author Date
Alastair Watts Sep 23, 2010 - 10:05 AM

Is it possible?


 

Technical Support Sep 24, 2010 - 10:22 AM

Looks like you found an issue in the drag-n-drop subsystem of Prof-UIS grid controls. To fix it, please update the source code for the following three methods in the .../Prof-UIS/Src/ExtGridWnd.cpp file:

SCODE CExtGridOleDropSource::QueryContinueDrag( BOOL bEscapePressed, DWORD dwKeyState )
{
            __PROF_UIS_MANAGE_STATE;
            __EXT_DEBUG_GRID_ASSERT_VALID( this );
SCODE sCode = m_pWndGrid->OnGridDropSourceQueryContinueDrag( bEscapePressed, dwKeyState );
            if( bEscapePressed && sCode == DRAGDROP_S_CANCEL )
                        m_EscapePressed = true;
            return sCode;
}

SCODE CExtGridOleDropSource::GiveFeedback( DROPEFFECT dropEffect )
{
            __PROF_UIS_MANAGE_STATE;
            __EXT_DEBUG_GRID_ASSERT_VALID( this );
            m_deLast = dropEffect;
SCODE sCode = m_pWndGrid->OnGridDropSourceGiveFeedback( dropEffect );
            if( sCode == DRAGDROP_S_USEDEFAULTCURSORS )
            {
                        if( dropEffect == DROPEFFECT_COPY )
                        {
                                    if( m_hCursorCopy != NULL )
                                                ::SetCursor( m_hCursorCopy );
                                    sCode = S_OK;
                        }
                        else if( dropEffect == DROPEFFECT_MOVE )
                        {
                                    if( m_hCursorMove != NULL )
                                                ::SetCursor( m_hCursorMove );
                                    sCode = S_OK;
                        }
                        else if( dropEffect == DROPEFFECT_NONE )
                        {
                                    if( m_hCursorDelete != NULL )
                                                ::SetCursor( m_hCursorDelete );
                                    sCode = S_OK;
                        }
            } // if( sCode == DRAGDROP_S_USEDEFAULTCURSORS )
            return sCode;
}

SCODE CExtGridWnd::OnGridDropSourceGiveFeedback( DROPEFFECT dropEffect )
{
            __EXT_DEBUG_GRID_ASSERT_VALID( this );
            dropEffect;
            return DRAGDROP_S_USEDEFAULTCURSORS;
}

Alastair Watts Sep 24, 2010 - 5:43 AM


I’m using the standard drag & drop.  The following doesn’t change the icon ... what am I doing wrong?


 



SCODE CMyTreeGridWnd::OnGridDropSourceGiveFeedback(DROPEFFECT dropEffect)


{


HCURSOR hCursor = LoadCursor(NULL, MAKEINTRESOURCE(IDC_HAND));


SetCursor(hCursor);


 


}


return NOERROR;

Technical Support Sep 24, 2010 - 3:15 AM

Please take a look at the following test application dedicated to the drag-n-drop and the CExtTreeGridWnd control:

http://www.prof-uis.com/download/forums/test_tree_grid_idea_dnd.zip

If you are using the standard drag-n-drop of the CExtGridWnd control, then you should override the CExtGridWnd::OnGridDropSourceGiveFeedback() virtual method and change cursor in it using the standard SetCursor() API.