Home » U++ Library support » U++ Library : Other (not classified elsewhere) » Image DnD into Upp app
Re: Image DnD into Upp app [message #44170 is a reply to message #44169] |
Wed, 14 January 2015 22:09 |
|
bushman
Messages: 134 Registered: February 2009
|
Experienced Member |
|
|
Thank you for the code, Mirek, but I'm afraid it doesn't work. BTW, before I posted this topic I've tried something quite close to what you suggest, based on what I could learn from the IDE help and reference code, but it failed too.
I've inserted some LOGs in your code to see if any of the DnD-related virtual methods ever get called, which they don't, with the exception of CancelMode(), but obviously for other non-DnD reasons:
#include <CtrlLib/CtrlLib.h>
using namespace Upp;
struct MyApp : TopWindow {
virtual void CancelMode();
virtual void Paint(Draw& w);
virtual void DragAndDrop(Point p, PasteClip& d);
virtual void DragLeave();
Image img;
bool dnd;
MyApp() { dnd = false; }
};
void MyApp::Paint(Draw& w)
{
Size sz = GetSize();
w.DrawRect(sz, dnd ? SColorInfo() : SColorFace());
w.DrawImage(0, 0, img);
}
void MyApp::DragAndDrop(Point p, PasteClip& d)
{
LOG("DragAndDrop"); // this never gets called
if(AcceptImage(d))
img = GetImage(d);
dnd = d.IsAccepted();
Refresh();
}
void MyApp::DragLeave()
{
LOG("DragLeave"); // this never gets called
CancelMode();
}
void MyApp::CancelMode()
{
LOG("CancelMode");
dnd = false;
Refresh();
}
GUI_APP_MAIN
{
MyApp().Run();
}
Aren't we missing something? There's something I do not quite fully understand here, I mean, how is our code supposed to acknowledge it should accept DnD data from other non-Upp Windows processes? Doesn't Windows require us to somehow register our Upp process as potential target of DnD events?
Thanks again!
|
|
|
|
|
Image DnD into Upp app
By: bushman on Wed, 14 January 2015 15:28
|
|
|
Re: Image DnD into Upp app
By: mirek on Wed, 14 January 2015 19:21
|
|
|
Re: Image DnD into Upp app
By: bushman on Wed, 14 January 2015 22:09
|
|
|
Re: Image DnD into Upp app
By: mirek on Thu, 15 January 2015 08:51
|
|
|
Re: Image DnD into Upp app
By: bushman on Thu, 15 January 2015 19:06
|
|
|
Re: Image DnD into Upp app
By: mirek on Thu, 15 January 2015 20:58
|
|
|
Re: Image DnD into Upp app
By: mirek on Thu, 15 January 2015 21:11
|
|
|
Re: Image DnD into Upp app
By: bushman on Thu, 15 January 2015 23:26
|
|
|
Re: Image DnD into Upp app
By: mirek on Fri, 16 January 2015 09:16
|
|
|
Re: Image DnD into Upp app
By: bushman on Fri, 16 January 2015 21:41
|
|
|
Re: Image DnD into Upp app
By: mirek on Sat, 17 January 2015 16:19
|
|
|
Re: Image DnD into Upp app
By: bushman on Sat, 17 January 2015 18:10
|
|
|
Re: Image DnD into Upp app
By: mirek on Sun, 18 January 2015 09:18
|
|
|
Re: Image DnD into Upp app
By: bushman on Sun, 18 January 2015 11:44
|
|
|
Re: Image DnD into Upp app
By: koldo on Thu, 15 January 2015 08:51
|
|
|
Re: Image DnD into Upp app
By: bushman on Thu, 15 January 2015 19:17
|
|
|
Re: Image DnD into Upp app
By: bushman on Sun, 18 January 2015 11:56
|
|
|
Re: Image DnD into Upp app
By: mirek on Mon, 19 January 2015 11:41
|
|
|
Re: Image DnD into Upp app
By: bushman on Mon, 19 January 2015 19:59
|
|
|
Re: Image DnD into Upp app
By: mirek on Tue, 20 January 2015 14:44
|
|
|
Re: Image DnD into Upp app
By: bushman on Thu, 22 January 2015 21:18
|
|
|
Re: Image DnD into Upp app
By: mirek on Fri, 23 January 2015 09:43
|
|
|
Re: Image DnD into Upp app
|
|
|
Re: Image DnD into Upp app
By: bushman on Fri, 23 January 2015 22:14
|
|
|
Re: Image DnD into Upp app
By: mirek on Sat, 24 January 2015 11:49
|
|
|
Re: Image DnD into Upp app
By: bushman on Sat, 24 January 2015 15:21
|
|
|
Re: Image DnD into Upp app
By: mirek on Mon, 26 January 2015 19:05
|
|
|
Re: Image DnD into Upp app
By: bushman on Mon, 26 January 2015 21:24
|
Goto Forum:
Current Time: Thu May 16 15:45:35 CEST 2024
Total time taken to generate the page: 0.02639 seconds
|