Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Drag and drop - avoid overlapping boxes (Read 1402 times)
srlevitt
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 16
Joined: Mar 27th, 2007
Drag and drop - avoid overlapping boxes
Mar 27th, 2007 at 1:08pm
Print Post  
I implemented a drag and drop system similar to the one in the demo. I have a requirement that the box being dragged onto the chart must be visible, rather than just use the standard copy cursor. The other requirement is that you cannot drop a new box overlapping an existing box. In the dragOver event handler, I move the new box to the mouse coordinates. I change the effects cursor to be either "copy" or "none" depending on overlaps. However, if the user releases the mouse button whilst the cursor is "none", the new box remains where it is. What I really want to do in this situation is delete the new box, but I cannot trap the mouse up event. Has anyone got any example code I can crib? or a hint or two.
Thanks, Steve.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Drag and drop - avoid overlapping boxes
Reply #1 - Mar 27th, 2007 at 1:35pm
Print Post  
Hello Steve,

You could check the result returned by the DoDragDrop method, and if the return value is None, remove the new box.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
srlevitt
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 16
Joined: Mar 27th, 2007
Re: Drag and drop - avoid overlapping boxes
Reply #2 - Mar 28th, 2007 at 5:56am
Print Post  
Yes, of course! Thanks.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint