realbasic-nug
[Top] [All Lists]

Re: Is it even possible to drag and drop on the PC at all?

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Is it even possible to drag and drop on the PC at all?
From: John McKernon <mckernonjunk at earthlink dot net>
Date: Sun, 30 Sep 2007 14:27:42 -0400
Delivered-to: listarchive at realsoftware dot com
Delivered-to: realbasic-nug at lists dot realsoftware dot com
Thread-index: AcgDj5Z81QHEV2+CEdyH+gAbY5Keog==
Thread-topic: Is it even possible to drag and drop on the PC at all?
> OK, I have a simple project. Just 2 classes. (OK it could have been 1
> but I cut it down from 400 classes so it's a start).
> 
> Just about 20 lines of code. Still fails. On PC. And works on Mac.
> 
> I can't drag and drop on the PC. Why? It works on Mac, exactly the same.

I'm unfortunately not at home where my PC is handy, but I looked at your
code and a couple of things got my attention:

Returning True from either DragEnter or DragOver prevents the DropObject
event from firing (according to the Language Reference). It seems to me all
you need is the DropObject event to accomplish what you're doing.

You have all three of these statements:

  me.AcceptRawDataDrop( "ALFI" )
  me.AcceptTextDrop
  me.AcceptMacDataDrop( "ALFI" )

You really only need this one:

  me.AcceptRawDataDrop( "ALFI" )

Also, you should check to see if ALFI data is indeed available before you
ask for it - 

Instead of:

  if Obj <> nil then
    Return obj.text = "delete" or obj.PrivateRawData( "ALFI" ) = "delete" or
obj.MacData( "ALFI" ) = "delete" or obj.RawData("ALFI") = "delete"
  end if

This would be safer:

  if Obj <> nil then
     if Obj.RawDataAvailable("ALFI") then
        return obj.PrivateRawData("ALFI")
     end if
  end if

And just for safety's sake, I use lowercase four-character codes for things
like this, since uppercase ones are generally used by the OS.

Hopefully one or more of these things will get you going on Windows.

Good luck!

- John




_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>