Drag&Drop to foreign windows |
Post Reply |
Author | |
XAMLFreak
Newbie Joined: 17 June 2009 Location: Germany Status: Offline Points: 3 |
Post Options
Thanks(0)
Posted: 26 June 2009 at 2:05pm |
Hi,
I enabled Drag&Drop in my CXTPReportControl derived class with the following command: EnableDragDrop(_T("MyDragFromatName"), xtpReportAllowDrag | xtpReportAllowDrop); ...and I have some text and markup coloumns in this control. Now when I drag a row outside my window and place it in a e.g Visual Studio text file, the text of the row including the markup is moved to this text file. These rows are completly removed from my Report Control - but drop cursor still says "Drop not allowecd". How can I prevent moving this rows to outside my control? Thanks! |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
You need to overwirte function virtual void OnDragLeave(CWnd* pWnd)
Now there is not restriction here - you can add in (e.g. in your derived class):
class CXTPReportControl::CReportDropTarget - virtual void OnDragLeave(CWnd* pWnd) {CXTPReportControl* pReport = DYNAMIC_DOWNCAST(CXTPReportControl, pWnd); if (pReport) pReport->OnDragOver(NULL, 0, CPoint(-1, -1), 1);} |
|
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
|
I suppose you can do this too:
m_wndReport.EnableDragDrop(_T("My_Own_Records"), xtpReportAllowDragCopy);
Works for me!
|
|
PokerMemento - http://www.pokermemento.com/
|
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
This flag (xtpReportAllowDragCopy) essentially make OPPOSITE effect - it ALLOW to drop to foreign window - I succeded to drop selected range from modified (with this code) Pane app to static non-modified one (which use standard xtpReportAllowDrag | xtpReportAllowDrop |
|
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
|
Even with user-defined "My_Own_Records"?
|
|
PokerMemento - http://www.pokermemento.com/
|
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
if you use unique Clipboard format name FIXED for your app - you can only drag and drop between same app (but in different instances)
if you use run-time random name - only drag and drop in same running instance
|
|
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 |