If any windows or controls in your projects are designed to allow the
user
to drop files on them, indicating which files are acceptable involves
using
File Types. You add a file type to your project using the File Types
dialog
box and specify the MacType and MacCreator codes for a particular file
type
you wish to accept. If you don't know the MacType and/or MacCreator, the
File Types dialog box provides a popup menu of popular file types. You
can
also use ResEdit, Resourceror or even built a quick little utility
application in REALbasic that will provide you with this information.
But what about folders? Say you want the user to be able to drop a
particular file type or folder on a window or control. What's the
MacType
and MacCreator for a folder? ResEdit and Resourceror (even REALbasic)
don't
provide MacType and MacCreator information for folders. It turns out
that
the MacType for a folder is "fold" and the MacCreator code is "MACS"
(the
Finder's MacCreator code).
So, if you want to accept folders dropped on a window or control, just
add a
file type with a "MACS" as the MacCreator and "fold" as the MacType then
pass the file type to the AcceptFileDrop method and you're on your way.
This tip was brought to you by Dave Grogono, REAL Software Tester
Extraordinaire.
--
Geoff Perlman
President & CEO
REAL Software, Inc.
http://www.realsoftware.com
mailto:geoff at realsoftware dot com
Phone: 512-263-1233 x711
Fax: 512-263-1441
- - - - - - - - - -
Got a useful tip to share? Send it to us at:
REALbasic-tips at lists dot realsoftware dot com dot
For list commands, send "Help" in the body of a message to
<requests at lists dot realsoftware dot com>
|