Drag & drop controls inside a scroller

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
JosepM
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 344
Joined: Tue Jul 20, 2010 12:40 pm

Drag & drop controls inside a scroller

Post by JosepM » Wed Oct 17, 2012 1:46 am

Hi,

I need help to drag and drop controls inside a scroller.
Someone have any experience about? Grab me don't work nor the classic drag and drop operations.

Salut,
Josep M

JosepM
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 344
Joined: Tue Jul 20, 2010 12:40 pm

Re: Drag & drop controls inside a scroller

Post by JosepM » Wed Oct 17, 2012 7:36 am

Hi,

I found a great sample from Scoot Rossi showing the misteries of drag and drop

http://www.tactilemedia.com/site_files/ ... ampler.rev

That run fine on iOS, but using the same inside the scroller no.

Code: Select all

local allowDrag
on mouseDown
  put (the mouseH - left of me),(the mouseV - top of me) into allowDrag
end mouseDown

on mouseMove x,y
  if allowDrag = "" then exit mouseMove
  set topLeft of me to \
      (x - item 1 of allowDrag) & "," & (y - item 2 of allowDrag)
  # if within(grc box1,loc of me) then put "You hit box 1" into fld  status
  # if within(grc box2,loc of me) then put "You hit box 2" into fld status
  put "" into fld status
  if intersect(me,grc box1) then put "You hit box 1" into fld status
  if intersect(me,grc box2) then put "You hit box 2" into fld status
end mouseMove

on mouseUp
  put empty into fld status
  put "" into allowDrag
end mouseUp

on mouseRelease
  mouseUp
end mouseRelease

This is the code inside of the button. The control move only a few pixels and stop...

Any idea?

Salut,
Josep M

Post Reply