Go to the “Edit” menu and then “File Types…”. Click the “Add…” button
and fill the informations for the file's type you want. For instance,
if you want all kind of files to be allowed, set these informations:
Name: Any (can be any text)
Mac Creator: ????
Mac Type: ????
Extension: <left blank>
Then click “Ok” for both dialogs.
In your window, now, put this code in the Open event handler (or
wherever appropriate; remember you cannot undo allowing drag-and-drop
in RB):
self.AcceptFileDrop("Any")
Then locate the DropObject event. Put something like that:
dim f As FolderItem
do
if obj.FolderItemAvailable then
f=obj.FolderItem
'Do something with f
end if
if not obj.NextItem then exit
Loop
Note the line "if not obj.NextItem then exit". You can drop multiple
files on the same window on the same time. So the loop is executed,
with “obj” being always the next dropped item. Once the last item has
be reached, NextItem returns false and the code exits the loop.
The ObjNextItem both returns a boolean (true if another object was
dropped) and, it true, places the next item in "obj".
Hope this helps.
Le 14 nov. 06 à 23:12 Soir, Cox, Ed a écrit:
Greetings,
I've been away from the list and RB for a long time. Now I need a
refresher with some assistance from the group.
I am seeking a code snippet or source example of a project that simply
allows me to drag a file from the finder onto the application
window or
textedit field and to be able to obtain the file name, path, volume.
Thank you in advance.
Kind Regards,
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>