Looking for Help on a Project

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!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

bidgeeman
Posts: 495
Joined: Wed Feb 21, 2007 7:58 am
Location: Australia

Re: Looking for Help on a Project

Post by bidgeeman » Tue Jun 20, 2017 11:58 pm

Than you Klaus.
Sorry for the mislaid original post. It's good to see you are still here after so many years :)
Bidge

bidgeeman
Posts: 495
Joined: Wed Feb 21, 2007 7:58 am
Location: Australia

Re: Looking for Help on a Project

Post by bidgeeman » Wed Jun 21, 2017 5:43 am

"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.

Code: Select all

on mouseUp
set the iconPath of widget "SVG" to the iconPath of widget "Ribbon"
end mouseUp
Thanks
Bidge

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9250
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Looking for Help on a Project

Post by richmond62 » Wed Jun 21, 2017 10:26 am

Just COPY-PASTE the widget from stack 1 to stack 2 . . . . .

bidgeeman
Posts: 495
Joined: Wed Feb 21, 2007 7:58 am
Location: Australia

Re: Looking for Help on a Project

Post by bidgeeman » Sun Jun 25, 2017 6:31 am

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:

Code: Select all

on mouseUp
   set the imageSource of char 1 of line 1 of field "Numbers" to "Image.png" 
end mouseUp
How would I write this?

Thanks for any help once again.
Bidge

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9250
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Looking for Help on a Project

Post by richmond62 » Sun Jun 25, 2017 8:31 am

Well, I suppose you would set up a loop and number the images sequentially
as they come in and then set each one to the character of the same number.

bidgeeman
Posts: 495
Joined: Wed Feb 21, 2007 7:58 am
Location: Australia

Re: Looking for Help on a Project

Post by bidgeeman » Mon Jun 26, 2017 1:33 pm

Is it possible to have a larger group follow another smaller group on a drag command?

Thanks
Bidge

Klaus
Posts: 13793
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Looking for Help on a Project

Post by Klaus » Mon Jun 26, 2017 4:05 pm

Hi Bidge,
bidgeeman wrote:Is it possible to have a larger group follow another smaller group on a drag command?
yep, but will not work if using "... grab me ..."!

Put this into the script of your small group:

Code: Select all

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
Tested and works! :D


Best

Klaus

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2718
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: Looking for Help on a Project

Post by jmburnod » Mon Jun 26, 2017 7:12 pm

Hi Bidge,
Here is a stack which does the job using mousemove
Best regards
Jean-Marc
Attachments
stMoveGroupsTogether.zip
(2.08 KiB) Downloaded 359 times
Last edited by jmburnod on Mon Jun 26, 2017 7:58 pm, edited 1 time in total.
https://alternatic.ch

Randy Hengst
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 153
Joined: Thu Jun 29, 2006 4:16 pm

Re: Looking for Help on a Project

Post by Randy Hengst » Mon Jun 26, 2017 7:39 pm

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.

randy

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2718
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: Looking for Help on a Project

Post by jmburnod » Mon Jun 26, 2017 9:52 pm

Hi Randy,
Thanks for this.
I never used a grab command with mousemove message.
I believed mousemove doesn't work during a grab command :oops:
https://alternatic.ch

Randy Hengst
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 153
Joined: Thu Jun 29, 2006 4:16 pm

Re: Looking for Help on a Project

Post by Randy Hengst » Mon Jun 26, 2017 10:28 pm

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."

bidgeeman
Posts: 495
Joined: Wed Feb 21, 2007 7:58 am
Location: Australia

Re: Looking for Help on a Project

Post by bidgeeman » Tue Jun 27, 2017 12:25 am

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???

Thank you all again
Bidge

Randy Hengst
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 153
Joined: Thu Jun 29, 2006 4:16 pm

Re: Looking for Help on a Project

Post by Randy Hengst » Tue Jun 27, 2017 1:42 am

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

bidgeeman
Posts: 495
Joined: Wed Feb 21, 2007 7:58 am
Location: Australia

Re: Looking for Help on a Project

Post by bidgeeman » Tue Jun 27, 2017 1:54 am

Randy that worked perfectly thank you :)
Regards
Bidge

bidgeeman
Posts: 495
Joined: Wed Feb 21, 2007 7:58 am
Location: Australia

Re: Looking for Help on a Project

Post by bidgeeman » Tue Jun 27, 2017 5:50 am

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?

Thanks again for your help
Cheers
Bidge

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”