Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

simulate drag and drop?? URGENT

Status
Not open for further replies.

shades44

Programmer
Jun 14, 2004
25
CA
Hello,

I'm trying to simulate a drag and drop operation across frames. I have 4 frames and i want to be able to tell when:

1) the user's mouse button goes down in a specific frame (say frame 2)

2) it stays down as he moves it across to another specific frame (say frame 4)

3) he releases the mouse button anywhere over that frame (frame 4).

i want that sequence of events to trigger a function in frame 4 ( doThis() ) whereas any obstruction or variation to that sequence of event of any sort should not trigger doThis().

Any suggestions or sites i can take a look at would be greatly appreciated. I googled it but didnt find much!

Shady
 
i figured out a way that works nicely for those that are interested.. (the elements being dragged are not visible during the drag).

i'll call the frame where things are dropped the receiving frame and the frame where dragging commences the sending frame.

in the body of the receiving frame create a handler function that can be called from the sending frame, such as HandleDroppedObject(object). On the sending frame attatch an ondragend event to the elements you want to drag and in the handler for ondragend simply check that the mouse coordinates are over the receiving frame (when dragging has ended, ie. mouse button is released). If so then call receivingFrame.HandleDroppedObject(this).

If anyone is interested and this is confusing then contact me and i'll be happy to explain in greater detail.

Shady
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top