New topic: Is Drag And Drop broken ?
<http://forums.realsoftware.com/viewtopic.php?t=11808> Page 1 of 1 [ 8 posts ] Previous topic | Next topic Author Message Trumpet Post subject: Is Drag And Drop broken ?Posted: Fri Mar 02, 2007 6:11 am Joined: Fri Mar 02, 2007 6:04 am Posts: 4 I can't for the life of me get drag and drop to work correctly between two canvasses. The image seems to drag across no problem but when it is displayed it is tiny. About a quarter of the size it should be. Any help would be very greatly appreciated. TIA. I have this code in the canvas to drag from: Code:Dim d as DragItem d=NewDragItem( Me.left, Me.top, Me.width, Me.height) d.picture= me.backdrop d.Drag //Allow the drag That's in the mousedown or mousedrag event. And in the canvas to drag to, I have this: Code:Me.AcceptPictureDrop in the Open event and this: Code:if obj.pictureAvailable then Me.Backdrop = obj.picture end if in the Dropobject event. Top jack Post subject: Posted: Fri Mar 02, 2007 7:05 am Joined: Sat Oct 01, 2005 6:52 pm Posts: 1024 hmm...I don't see anything in your code that changes the size. It works fine for me on 2007R1 on OSX using a large PICT image. Is the second canvas the same size as the first? If it's larger, then is it too large for the original image to fill as backdrop? If its an issue like that, you could create a picture object and assign your drop object to it, then scale it up before assigning it to the backdrop of the second canvas. Top Trumpet Post subject: Posted: Fri Mar 02, 2007 7:10 am Joined: Fri Mar 02, 2007 6:04 am Posts: 4 Hi Jack, thanks for trying to help. The second canvas is about 60% larger but the dropped image is absolutely tiny. So it's not just that it looks too small... it has actually shrunk. I'm using RB2007 R1 on OSX also. The images are .png files. Could that be a problem? Top mrebar Post subject: Posted: Fri Mar 02, 2007 9:24 am Joined: Wed Feb 15, 2006 1:30 pm Posts: 2279 Location: U.S.A (often) Spokane, Eugene, Pago Pago Quote:The images are .png files. Could that be a problem? Shouldn't be a problem. Once they're drawn to the Canvas, they're just a bitmap image. Michael Top Trumpet Post subject: Posted: Fri Mar 02, 2007 11:10 am Joined: Fri Mar 02, 2007 6:04 am Posts: 4 That's really weird then. Would anyone else using RB2007 R1 and OS X 10.4.8 on an Intel Mac be cool enough to verify if this is happening for them or not? I would really appreciate that. All you have to do is create two canvases with the code I posted above which is pretty much straight from the language reference. And then see if the drag and drop works properly. If no one else get this then I'm completely at a loss Top Trumpet Post subject: Grrraaagh... Still happeningPosted: Fri Jun 15, 2007 7:12 am Joined: Fri Mar 02, 2007 6:04 am Posts: 4 This is driving me insaaane Could someone please confirm I'm not going mad? I compiled the exact code above and the image is shrinking in the final built app. At least on my computer it is. You can download it here and see for yourself. Any help would be very greatly appreciated. Top tomis Post subject: Re: Grrraaagh... Still happeningPosted: Fri Jun 15, 2007 5:10 pm Joined: Thu Jul 27, 2006 6:31 pm Posts: 1289 Location: Monterey, CA Trumpet wrote: I compiled the exact code above and the image is shrinking in the final built app. At least on my computer it is. You can download it here and see for yourself. Any help would be very greatly appreciated. I'd think it would be more helpful if you uploaded the source code of said program so people can try it with different versions of RB and tweak the code around to see what might be causing the problem. That being said, from the code you posted you shouldn't have a problem. That is, assuming there isn't some other code going on that you've forgotten about. I know that's happened to me before. Top Piper Post subject: Re: Is Drag And Drop broken ?Posted: Mon Jan 05, 2009 9:06 pm Joined: Mon Jan 05, 2009 8:44 pm Posts: 1 I am also having the same problem (image shrinks between the time of start of drag from source to dropping at destination) and was hoping for some insights... My code looks exactly the same as the original one indicated above -- except I'm trying to drag between two ImageWells instead of two canvases (seemed simpler dealing with ImageWells since I'm a newbie..). My two imagewells are reasonably larger (223x182) than the actual image I'm trying to drag (120x90). Both my source and destination ImageWell are the same size. My image is a jpeg. I have this additional info: I have multiple OSs and versions available to me and have tried it on all 3 available to me. I see this problem on RB2007 R3 on OSX 10.4.9. I still see the problem on RB2008 R3 OSX10.4.9. However, it worked just FINE on RB2008 R3 on Win XP SP2 machine... Unfortunately, I need this to work on a Mac envt on RB2008 R3... I threw in some "trace" statements to another window to see if I could glean any additional info (basically, just retrieving the object's height before and during the drag). The original height of my image was 120x90 (I obtained this info just before creating the new DragItem using me.image.width and me.image.height). In my DropObject event handler of the destination ImageWell, I obtained the width and height again via obj.picture.width and obj.picture.height just before I checked PictureAvailable(). It was already changed at that point to 36x48. I am so puzzled as to why this is happening and what I can do to prevent this!! Any help would be appreciated! Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 8 posts ] -- Over 900 classes with 18000 functions in one REALbasic plug-in. The Monkeybread Software Realbasic Plugin v8.1. <http://www.monkeybreadsoftware.de/realbasic/plugins.shtml> [email protected]
