Print Page | Close Window

Drag&Drop to foreign windows

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=14632
Printed Date: 26 April 2024 at 7:24pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Drag&Drop to foreign windows
Posted By: XAMLFreak
Subject: Drag&Drop to foreign windows
Date 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!







Replies:
Posted By: mdoubson
Date Posted: 06 August 2009 at 7:41pm
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);

}



-------------
Mark Doubson, Ph.D.


Posted By: znakeeye
Date Posted: 07 August 2009 at 5:25pm
I suppose you can do this too:
 
m_wndReport.EnableDragDrop(_T("My_Own_Records"), xtpReportAllowDragCopy);
 
Works for me!


-------------
PokerMemento - http://www.pokermemento.com/


Posted By: mdoubson
Date Posted: 07 August 2009 at 5:54pm

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



-------------
Mark Doubson, Ph.D.


Posted By: znakeeye
Date Posted: 10 August 2009 at 5:48pm
Even with user-defined "My_Own_Records"?

-------------
PokerMemento - http://www.pokermemento.com/


Posted By: mdoubson
Date 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


-------------
Mark Doubson, Ph.D.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net