New topic: 

Filetype extension wildcard?

<http://forums.realsoftware.com/viewtopic.php?t=41966>

         Page 1 of 1
   [ 2 posts ]                 Previous topic | Next topic          Author  
Message        rb_monster          Post subject: Filetype extension 
wildcard?Posted: Mon Dec 26, 2011 10:59 pm                         
Joined: Mon Nov 24, 2008 8:03 pm
Posts: 18                Hi there,

I'm using this code

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                 harriew          Post subject: 
Re: Filetype extension wildcard?Posted: Tue Dec 27, 2011 11:01 am               
          
Joined: Fri Dec 01, 2006 3:09 pm
Posts: 558
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:
Code:special/any   Any   ????  ????
In the Open event of your window add the line:
Code:self.AcceptFileDrop anyFile.All
In the DropObject event of the window add something like:
Code:  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            Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 2 posts ]      
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to