![]() |
Drag&Drop to foreign windows |
Post Reply ![]() |
Author | |
mdoubson ![]() Senior Member ![]() ![]() Joined: 17 November 2008 Status: Offline Points: 1705 |
![]() ![]() ![]() ![]() ![]() Posted: 10 August 2009 at 5:51pm |
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
|
|
![]() |
|
znakeeye ![]() Senior Member ![]() ![]() Joined: 26 July 2006 Status: Offline Points: 1672 |
![]() ![]() ![]() ![]() ![]() |
Even with user-defined "My_Own_Records"?
|
|
PokerMemento - http://www.pokermemento.com/
|
|
![]() |
|
mdoubson ![]() Senior Member ![]() ![]() Joined: 17 November 2008 Status: Offline Points: 1705 |
![]() ![]() ![]() ![]() ![]() |
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 |
![]() ![]() ![]() ![]() ![]() |
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 |
![]() ![]() ![]() ![]() ![]() |
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);} |
|
![]() |
|
XAMLFreak ![]() Newbie ![]() Joined: 17 June 2009 Location: Germany Status: Offline Points: 3 |
![]() ![]() ![]() ![]() ![]() |
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! |
|
![]() |
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 |