Using "grab" we all have to resort to something like this:
Code: Select all
on mouseDown
grab the target
end mouseDown
Code: Select all
on mouseMove
if the mouseLoc is within the rect of image "SomeImage" then
# do stuff here
end if
end mouseMove
Moderator: Klaus
Code: Select all
on mouseDown
grab the target
end mouseDown
Code: Select all
on mouseMove
if the mouseLoc is within the rect of image "SomeImage" then
# do stuff here
end if
end mouseMove
You can use mousecontrol()something, that returns the name of the object under the mouse
It doesn't work.If the mouse button is down, the mouseControl function returns the control that was clicked, even if the mouse has moved to another control.
http://quality.livecode.com/show_bug.cgi?id=1832trevix wrote:It all come to this:
Is there a logical, rational, impassable reason why in LC most mouse messages are not sent while the mouse is down?
Probably not.Is there a logical, rational, impassable reason why in LC most mouse messages are not sent while the mouse is down ?
Try the mouseControl function.trevix wrote:As for the mouseMove, I always find my self having to do a repeat loop inside it, trough all the controls, to find find out the "within the rect". I mean...is different if you want to know if the MouseLoc is on top of control X, or you want to know the name of the control under the MouseLoc
Code: Select all
global gStarted
on mouseDown
put true into gStarted
end mouseDown
On MouseUp
put false into gStarted
end MouseUp
Code: Select all
global gStarted
On mouseMove newMouseH,newMouseV
if gStarted then
set the loc of btn "ButtonDrag" to (newMouseH,newMouseV)
get controlAtLoc((newMouseH,newMouseV))
if it is not empty then
put the short name of it into msg
end if
end if
end mouseMove