Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Sun Oct 20, 2019 3:50 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Filetype extension wildcard?
PostPosted: Mon Dec 26, 2011 10:59 pm 
Offline

Joined: Mon Nov 24, 2008 8:03 pm
Posts: 18
Hi there,

I'm using this code

Private Function AnyFileType() As fileType
static f as FileType
if f = nil then
f = new FileType
f.Extensions = "*" // there are millions of file formats, why limit to any?
f.MacType = "????"
f.Name = "movie"
end if
Return f
End Function

me.AcceptFileDrop movieFT // in mywindow.open


I want to be able to drag and drop ANY file, to my window.

How do I do this?? Its not working on Windows :( I can't figure out how :(


Top
 Profile  
Reply with quote  
 Post subject: Re: Filetype extension wildcard?
PostPosted: Tue Dec 27, 2011 11:01 am 
Offline

Joined: Fri Dec 01, 2006 3:09 pm
Posts: 650
Location: Tennessee, USA
Instead of trying to figure out exactly what to put into the FileType why not let RS create the proper file type for you. If you truly want to be able to drop any kind of file then Create a FileType set in your project and name it whatever you want. For here I will name it "anyFile". You may have to choose "File Type Set" under the Add option of the Project menu in the IDE to add the File Type Set to your project.

In the File Type Set editor choose the "Add Common File Type" option and when the popup menu appears choose the "More..." option. This should add a new popup menu at the bottom of the window to supply the long list of possible file types. When you open this scroll down to the "Special/Any" option and select it. The special/any file type will be added to your FileType set and should look something like:
special/any     Any       ????    ????

In the Open event of your window add the line:
self.AcceptFileDrop anyFile.All

In the DropObject event of the window add something like:
If obj.FolderItemAvailable then
f = obj.FolderItem // f is a window property
xxx // where xxx is the code, or call to a method, that will handle the dropped file
end if

see if this doesn't get things going for you.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group