Home » U++ Library support » U++ Library : Other (not classified elsewhere) » [Drag & Drop] How to reject Clip on base of content of data?
[Drag & Drop] How to reject Clip on base of content of data? [message #37710] |
Sun, 04 November 2012 20:00 |
Novo
Messages: 1371 Registered: December 2006
|
Ultimate Contributor |
|
|
Let say I want to allow dropping of only one file. Code below doesn't work because data in Clip is not available till drop time.
void XXX::DragAndDrop(Point p, PasteClip& d)
{
if (AcceptFiles(d))
{
Vector<String> files = GetFiles(d);
if (files.GetCount() > 1)
return d.Reject();
const String fn = files.Top();
if (TryOpenFile(fn)) {}
}
if (d.IsAccepted())
{
Vector<String> files = GetFiles(d);
if (files.GetCount() > 1)
return d.Reject();
}
}
I could use d.Get("files"), but GetFiles(d) takes a Clip as an argument and not actual data ...
Is there a way to do what I want without reimplementing of GetFiles()? And why data should be available only at the time of drop?
TIA
Regards,
Novo
[Updated on: Sun, 04 November 2012 20:45] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Sat Sep 21 06:52:55 CEST 2024
Total time taken to generate the page: 0.03536 seconds
|