Stupid newb question: What am I doing wrong? 
Author Message
 Stupid newb question: What am I doing wrong?

I'm simply trying to make a window accept simultaneous multiple drag &
dropped items (such as a couple pictures, an mpeg and a few text files),
beep once for each item and (ultimately) recognize the absolute path.

In the Open event I've got

  Me.AcceptFileDrop("????")

and in the DropObject event (for testing purposes) is:

  Dim d as DragItem
  d=Me.NewDragItem(Me.left,Me.top,Me.width,Me.height)

  If obj.FolderItemAvailable Then
    MsgBox "Item available"
    Do
      gFile=obj.FolderItem.AbsolutePath
      EditField1.text=gFile
      SortItem
    Loop Until Not obj.NextItem
  else

    msgBox "Not available!"
  End if

The window accepts dragged items, but obj.FolderItemAvailable is NEVER
true; dragging always triggers the "else" MsgBox I put in.

Anybody want to clue me in what I'm doing wrong?

Apologies for what I'm sure is a dumb, basic question. I'm pretty new to
this still.

Thank you, zurg, for getting me into RB. ;-)

--
atb,
infin80

Smaragd is about to release an album!
see http://www.*-*-*.com/



Thu, 27 May 2004 23:15:19 GMT  
 Stupid newb question: What am I doing wrong?

Quote:

> The window accepts dragged items, but obj.FolderItemAvailable is NEVER
> true

Since you don't describe your file types, their names and types, and show
the code with which you're enabling file dropping, it's impossible to give
you a precise fix. The reason you're having trouble is that you're doing
something wrong, but there's no way to know exactly what without using
mind-reading.

The problem you describe, though, is generally due to a lack of
understanding of named File Types - how to declare them in the File Types
dialog, and how to use acceptFileDrop to tell the object which types to
accept. There's a clear explanation in the Drag-and-Drop chapter of my
book, including a number of gotchas and how to avoid them. m.

--

      *** REALbasic: The Definitive Guide! 2nd edition! ***
http://www.amazon.com/exec/obidos/ASIN/0596001770/somethingsbymatt



Fri, 28 May 2004 02:00:38 GMT  
 Stupid newb question: What am I doing wrong?

Quote:

>   Me.AcceptFileDrop("????")

After changing the "????" to "Any", a self-defined file type with the
creator and type "????", it seems to work here.

Uwe.

Btw: Is there a bug in the file types 'Add File Type' dialog box of
Rb3.5.2? After clicking on the popup menu in the 'Name:' line i see
screen wide menu with very long items.

--
OSX.1.1: Got confused when looking at USB devices...



Fri, 28 May 2004 05:25:25 GMT  
 Stupid newb question: What am I doing wrong?
[[ This message was both posted and mailed: see
   the "To," "Cc," and "Newsgroups" headers for details. ]]


Quote:

> Thank you, zurg, for getting me into RB. ;-)

Heh-heh... no need to thank me. It was destiny. :^)


Fri, 28 May 2004 17:57:04 GMT  
 Stupid newb question: What am I doing wrong?

Quote:

> Btw: Is there a bug in the file types 'Add File Type' dialog box of
> Rb3.5.2? After clicking on the popup menu in the 'Name:' line i see
> screen wide menu with very long items.

That's a bug in certain versions of OS X.  But I believe it's fixed in
OS 10.1.

Cheers,
- Joe

--
,------------------------------------------------------------------.
|    Joseph J. Strout         Check out the Mac Web Directory:     |

`------------------------------------------------------------------'



Fri, 28 May 2004 23:55:09 GMT  
 Stupid newb question: What am I doing wrong?

Quote:

> That's a bug in certain versions of OS X.  But I believe it's fixed in
> OS 10.1.

Thanks, but it's still present. I'm using OSX.1.1.

Uwe.

--
OSX.1.1: Got confused when looking at USB devices...



Tue, 01 Jun 2004 05:08:07 GMT  
 Stupid newb question: What am I doing wrong?
Just for the record, I worked this problem out based on Uwe's tip and
with some help from Zurg. The online documentation suggested, as I
understood it, that in Me.AcceptFileDrop("xxxx"), the xxxx should be the
4-character filetype, when in fact it had to be entered as the full MIME
type string.

I changed
    Me.AcceptFileDrop("????")
to
    Me.AcceptFileDrop("special/any")
and double-checked to be sure I'd defined the "special/any" type
correctly, and it's been working beautifully since.

Thanks, everybody!

--
atb,
infin80
who thinks he'll have to dig up a copy of Matt's book...

Smaragd has just released his debut album!
For a free copy, see http://smaragd.cjb.net



Thu, 03 Jun 2004 21:35:25 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. what am i doing wrong? HLA question

2. Simple Newbie Question: What am I doing wrong?

3. What am I doing wrong!

4. What am I doing wrong?

5. What am I doing Wrong

6. what am i doing wrong

7. Help - What am I doing wrong

8. Saving a Variable to a field in a record- what am i doing wrong

9. What am I doing wrong?

10. What am I doing wrong?

11. #CONTROL What am I doing wrong

12. What am i doing wrong.

 

 
Powered by phpBB® Forum Software