mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
examples: UWord now checks for correct file types in drop
git-svn-id: svn://ultimatepp.org/upp/trunk@5697 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
eb9cda0219
commit
d3a2d90f9d
1 changed files with 17 additions and 4 deletions
|
|
@ -139,11 +139,24 @@ void UWord::Open()
|
|||
|
||||
void UWord::DragAndDrop(Point, PasteClip& d)
|
||||
{
|
||||
if(AcceptFiles(d)) {
|
||||
if(IsAvailableFiles(d)) {
|
||||
Vector<String> fn = GetFiles(d);
|
||||
for(int i = 0; i < fn.GetCount(); i++)
|
||||
if(FileExists(fn[i]))
|
||||
OpenFile(fn[i]);
|
||||
for(int open = 0; open < 2; open++) {
|
||||
for(int i = 0; i < fn.GetCount(); i++) {
|
||||
String ext = GetFileExt(fn[i]);
|
||||
if(FileExists(fn[i]) && (ext == ".rtf" || ext == ".qtf")) {
|
||||
if(open)
|
||||
OpenFile(fn[i]);
|
||||
else {
|
||||
if(d.Accept())
|
||||
break;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!d.IsAccepted())
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue