Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!
"SOLVED"
Can someone point me to the correct function to load an svg from one stack into a different widget from a button? I have been searching for hours going through threads but I can't find anything. Tried the code below with no luck.
Hi .
I am loading images into a text field. I want the images to load in order of selection rather than have them replace a specific character as per this code I am using from the dictionary:
local maydrag
on mousedown
put TRUE into maydrag
end mousedown
on mouseup
put false into maydrag
end mouseup
on mouserelease
put false into maydrag
end mouserelease
on mousemove x,y
if maydrag <> TRUE then
exit mousemove
end if
set the loc of grp "the small one" to x,y
set the topleft of grp "the follower" to the topright of grp "the small one"
end mousemove
I like Jean-Marc’s illustration… it provides quite a bit of flexibility. But, here is a super simple version that is much like Klaus’ script.
Place this script in the "leader group” -- "RedGroup" is the "follower group"
on mouseDown
grab me
end mouseDown
on mouseMove
set the loc of group "RedGroup" to the topRight of me
end mouseMove
This script also assumes that none of the controls contained in the group use mouseDown or mouseMove handlers. If you use a mouseDown in one of group controls, then make sure to pass it at the end of the handler.
The scipt has the advantage or disadvantage ... depending on your view … that the mouseMove handler acts a bit like a mouseEnter handler.
Assuming the two groups are not in their leading/following positions, when you move your mourse into the leading group, it following group will jump right into place… it will work like a mouseEnter handler. If the following group is already in its place, then you’ll not see the “jump."
Thank you all Klaus, jmburnod and Randy.
Those examples are brilliant. Can someone explain why you can't set the large group to attach to the loc of the topCenter of the small group? I tried to adjust the script and it appears this property cannot be set???
You’re right, there is no topCenter, topMiddle etc.. to get that effect in my example you could change the mouseMove to this:
on mouseMove
lock screen
set the loc of group "RedGroup" to the loc of me
set the top of group "RedGroup" to the bottom of me
unlock screen
end mouseMove
Hi "SOLVED" I had set the image layer to TOP
I have a problem and think it could be a bug? I have an image layer sitting over a few text fields.
Every time I load an image it jumps over to the top over the text fields? It doesn't appear to move in the project browser until I reload the project and then you can see it has elevated itself over the text fields.
Is there anyway to stop this?