Page 1 of 1
Can LC Copy a group into Scroller group? - Solved
Posted: Thu May 14, 2020 1:26 pm
by DR White
Can LC copy a group "ClipBoard_NO" into a specfic location
of a group "lorem" in the scrooler of this
stack with a button?
Small test stack is attached.
Thanks,
David
Re: Can LC Copy a group into Scroller group?
Posted: Thu May 14, 2020 1:54 pm
by dunbarx
Hi,
I see this is a new twist on the other thread. Try this in the button script of your sample stack:
Code: Select all
on mouseUp
clone grp "clipBoard_NO" as "XYZ"
set the loc of grp "XYZ" to the loc of grp "scrollArea"
end mouseUp
Now this simply sets the loc of the new group to the loc of the target group. In the other thread I had the feeling that the scroll of the target group was also of importance. Is this still so/
Craig
Re: Can LC Copy a group into Scroller group?
Posted: Thu May 14, 2020 2:05 pm
by DR White
Craig,
The location of the inserted group into the scroller group has to be specific. The inserted groups need to form a rung of
PLC (programmable Logic Controller) code and look something like:
|
|-----| |----------| |-------( )------|
Thanks
Re: Can LC Copy a group into Scroller group?
Posted: Thu May 14, 2020 2:21 pm
by dunbarx
To any others here, note that the construction "last group" still is not supported by LiveCode. The handler:
Code: Select all
on mouseUp
clone grp "clipBoard_NO"
set the loc of last group to the loc of grp "scrollArea"
end mouseUp
fails, as it always has, because LC does not allow the keyWord "last" to work with groups. It has no issue with any other control. I thought this had been fixed, since this was the first attempt I made for Dr White.
Craig
Re: Can LC Copy a group into Scroller group?
Posted: Thu May 14, 2020 2:26 pm
by dunbarx
The location of the inserted group into the scroller group has to be specific.
I figured as much all along. But you have given no information at all about how those locs are to be set. I had thought that it involved the scroll of the group.
Are successive clones to be stacked somehow? What property of any kind is to be the measure of setting these locs? I just don't have a clue.
Craig
Re: Can LC Copy a group into Scroller group?
Posted: Thu May 14, 2020 2:34 pm
by Klaus
Hi all,
here a workaround:
dunbarx wrote: ↑Thu May 14, 2020 2:21 pm
To any others here, note that the construction "last group" still is not supported by LiveCode:
Code: Select all
on mouseUp
clone grp "clipBoard_NO"
set the loc of grp (the num of grps) to the loc of grp "scrollArea"
end mouseUp
Best
Klaus
Re: Can LC Copy a group into Scroller group?
Posted: Thu May 14, 2020 2:37 pm
by DR White
The user will scroll to the insertion point and touch the point that the group will be inserted.
Re: Can LC Copy a group into Scroller group?
Posted: Thu May 14, 2020 3:40 pm
by dunbarx
Dr. White.
Aha.
It is your intention that the user clone the group, then scroll, and then click at the desired loc. The clone jumps to the clickLoc.
So are we done if the loc of the last group (which can only be identified with either Klaus' kluge or the naming thing that I wrote about) is set to the clickLoc?
Craig
Re: Can LC Copy a group into Scroller group?
Posted: Thu May 14, 2020 3:46 pm
by jacque
The clone command puts the long name or ID in the "it" variable.
Re: Can LC Copy a group into Scroller group?
Posted: Thu May 14, 2020 3:58 pm
by DR White
dunbarx wrote: ↑Thu May 14, 2020 3:40 pm
t is your intention that the user clone the group, then scroll, and then click at the desired loc. The clone jumps to the clickLoc.
Yes.
Why are you using "clone" instead of "copy"?
I don't understand how it would be done.
Could you use the stack that I attached and show me an example?
Thanks
Re: Can LC Copy a group into Scroller group?
Posted: Thu May 14, 2020 6:34 pm
by dunbarx
Why are you using "clone" instead of "copy"?
Both would work. I used "clone" because that command allows you to name the new, er, copy at creation time.
Put this into the script of group "scrollArea":
Code: Select all
on mouseUp
put the clickLoc into tLoc
clone grp "clipBoard_NO" as "XYZ"
set the loc of grp "XYZ" to tLoc
end mouseUp
This does not address the "x" value of the final loc of the new group. If you go this route, you will want to manage the successive new names of the new groups. There are likely other tweaks required as well.
Craig
Re: Can LC Copy a group into Scroller group?
Posted: Thu May 14, 2020 7:54 pm
by DR White
Did not work.
After the the group is cloned to location, it dose not scroll with the scroller.
It's like it did not become part of the scrolling group.
Re: Can LC Copy a group into Scroller group? - Solved
Posted: Thu May 14, 2020 8:16 pm
by DR White
Craig and Klaus,
Thanks so much your help. You provided me with the
information to get me to the code below that seems to work.
on mouseUp
put the clickLoc into tLoc
clone grp "clipBoard_NO" as "XYZ"
copy grp "XYZ" to grp "scrollArea"
set loc of grp "XYZ" to tLoc
end mouseUp
The LC Team is the BEST,
David
Re: Can LC Copy a group into Scroller group?
Posted: Thu May 14, 2020 9:32 pm
by dunbarx
David.
Glad you found a way. I did not know about the new group having to scroll after it was created. Know that you can "copy" a control directly into any group. See the dictionary. This will shorten your handler a bit.
Craig