Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - Drag&Drop to foreign windows
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Drag&Drop to foreign windows

 Post Reply Post Reply
Author
Message
XAMLFreak View Drop Down
Newbie
Newbie


Joined: 17 June 2009
Location: Germany
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote XAMLFreak Quote  Post ReplyReply Direct Link To This Post Topic: Drag&Drop to foreign windows
    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!




Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post 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);

}

Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post 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/
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Posted: 10 August 2009 at 5:48pm
Even with user-defined "My_Own_Records"?
PokerMemento - http://www.pokermemento.com/
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.156 seconds.