Drag-n-Drop bug |
Post Reply |
Author | |
larryp
Groupie Joined: 15 January 2005 Location: United States Status: Offline Points: 61 |
Post Options
Thanks(0)
Posted: 22 October 2005 at 3:55pm |
Drag-n-Drop bug.
In the routine CXTPReportControl::OnMouseMove exists the following code: // If mouse moved some since down... if (m_bPrepareDrag && (labs (point.x - m_pointDrag.x) > 3 || labs (point.x - m_pointDrag.x) > 3)) { // Prevent duplicate m_bPrepareDrag = FALSE; // Begin a drag operation OnBeginDrag(m_pointDrag); } There are two identical checks for point.x - m_pointDrag.x. It seems that the second one should be point.y - m_pointDrag.y This prevents rows from being dragged unless the mouse is moved horizontally greater than three. |
|
gshawn
Senior Member Joined: 04 October 2004 Status: Offline Points: 227 |
Post Options
Thanks(0)
|
I thought the Report Control didn't support drag and drop?
|
|
larryp
Groupie Joined: 15 January 2005 Location: United States Status: Offline Points: 61 |
Post Options
Thanks(0)
|
If you have a view class derived from CXTPReportView, then the report
control supports standard MFC drag-n-drop behavior. The report
control will not perform the drag-n-drop for you but you get the
standard messages such that you can implement it in your view class.
You need to add the following routines in your view class: virtual DROPEFFECT OnDragEnter(COleDataObject* pDataObject, DWORD dwKeyState, CPoint point ); virtual DROPEFFECT OnDragOver(COleDataObject* pDataObject, DWORD dwKeyState, CPoint point ); virtual DROPEFFECT OnDropEx(COleDataObject* pDataObject, DROPEFFECT dropDefaultEffect, DROPEFFECT dropListEffect, CPoint point); virtual void OnDragLeave(); afx_msg void OnReportBeginDrag(NMHDR * pNotifyStruct, LRESULT * result); Also you need to add: ON_NOTIFY(LVN_BEGINDRAG, XTP_ID_REPORT_CONTROL, OnReportBeginDrag) Your code has to copy your records to the clipboard and paste them into your report control, but it can be done. --Larry |
|
gshawn
Senior Member Joined: 04 October 2004 Status: Offline Points: 227 |
Post Options
Thanks(0)
|
Thanks Larry, I did not realize this is the MFC forum. :( I was under the impression this feature would be in the ActiveX version a while ago, I was wondering if I had just missed it... still no luck in the ActiveX version, and apparently to get it to work in MFC you have to use a hack. The lack of drag and drop support is a pretty huge oversight imho. Anyway, thanks for the reply. |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |