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 General Discussion » dragging operation problem on CExtControlBar Collapse All
Subject Author Date
Yasushi Yamasaki Dec 2, 2003 - 11:40 AM

Hello, I found following problems and fixed it with the appended patch.

1. Clicking a caption starts immediate dragging operation.
2. A caption is activated on a LBUTTON*UP* event.
3. Clicking the caption of uppermost docked controlbar
causes unwanted redocking.

I hope this helps you...

diff -rcN Src.orig/extcontrolbar.cpp Src/extcontrolbar.cpp
*** Src.orig/extcontrolbar.cpp    Wed Nov 26 11:17:20 2003
--- Src/extcontrolbar.cpp    Wed Dec 3 02:39:12 2003
***************
*** 6702,6707 ****
--- 6702,6724 ----

void CExtControlBar::OnMouseMove(UINT nFlags, CPoint point)
{
+ #ifdef SMART_DRAGGING
+     if (!(m_bDragging || m_bRowResizing || m_bRowRecalcing) &&
+         (nFlags & MK_LBUTTON) &&
+         m_ptDraggingLast != point)
+     {
+      ClientToScreen( &point );
+         CPoint ptOffset( point );
+         CRect rcWnd;
+
+         GetWindowRect( &rcWnd );
+         ptOffset -= rcWnd.TopLeft();
+
+         _DraggingStart( point, ptOffset );
+         return;
+     }
+     m_ptDraggingLast = point;
+ #endif
    if( _OnMouseMoveMsg(nFlags,point) )
        return;
    CControlBar::OnMouseMove(nFlags,point);
***************
*** 6958,6969 ****
--- 6975,6988 ----
    if( !IsFixedMode() )
        SetFocus();

+ #ifndef SMART_DRAGGING
CPoint ptOffset( point );
CRect rcWnd;
    GetWindowRect( &rcWnd );
    ptOffset -= rcWnd.TopLeft();

    _DraggingStart( point, ptOffset );
+ #endif
}

void CExtControlBar::OnLButtonUp(UINT nFlags, CPoint point)

Sergiy Lavrynenko Dec 3, 2003 - 4:19 AM

Dear Yasushi,

The code changes you posted are correct but they should be put in in the CExtControlBar::_DraggingStart() method. It is responsible for drag-n-dropping (it tracks its own message loop and affects all drag-n-drop events). I will send you my implementation.

Best regards, Sergiy.