New topic: Drag problems
<http://forums.realsoftware.com/viewtopic.php?t=26369> Page 1 of 1 [ 3 posts ] Previous topic | Next topic Author Message Kyan Post subject: Drag problemsPosted: Sun Feb 08, 2009 2:24 am Joined: Tue Aug 14, 2007 8:44 am Posts: 218 I am trying to understand what fires Dragexit. This may not be the solution to my problem actually, but still... I have a long, thin canvas on which I paint ovals. On mousedown, a new oval is painted under the cursor. If an oval is already there, clicking in that spot will erase it. But I'd rather that the user drag the oval off the canvas and have it go away in that manner. I guess something like the poof on the OS X dock. I've tried to figure out dragexit, but I can't even get it to fire. I thought it would fire when the user clicks in the canvas and drags outside the canvas and then releases the mouse. But I'm missing something big or apparently this is not the case. The LR is opaque on this one and there is not much to go on in the forums... _________________ RB 2007 r5 Standard Release. Top timhare Post subject: Re: Drag problemsPosted: Sun Feb 08, 2009 2:56 am Joined: Fri Jan 06, 2006 3:21 pm Posts: 4348 Location: Portland, OR USA In MouseDown, you have to initiate the drag and then return true. See DragItem for how to set up the drag. Certain events are only called if you return True from MouseDown; they don't happen normally. Tim Top Kyan Post subject: Re: Drag problemsPosted: Sun Feb 08, 2009 3:37 am Joined: Tue Aug 14, 2007 8:44 am Posts: 218 Thanks Tim, I did initiate it there, well, I tried. This is my mousedown code: Code:Dim d as DragItem d=NewDragItem( Me.left, Me.top, 32, 32) d.Picture = Button1 d.Drag return true But what do I put in dragexit so that when the dragitem is released outside the canvas, something happens? I guess I need to pass the dragitem there, but how? This doesn't work (dragexit): Code:If Obj.PictureAvailable then beep else End if _________________ RB 2007 r5 Standard Release. Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 3 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]
