Hi All,
I am having problems moving a line created by the end user into an already existing group.
This is the scenario:
I have a small group containing a really small image.
When the end user click on a button, (s)he can draw a line the size (s)he wants.
This is the code in the button:
on mouseUp
put the number of graphics of this card into tGraphicNo
choose graphic tool
--Creates a line with the following characteristics
set the style of the templateGraphic to "line"
set the lineSize of the templateGraphic to 2
set the endArrow of templateGraphic to true
set the startArrow of templateGraphic to true
set the arrowSize of templateGraphic to 4
set the foregroundColor of templateGraphic to "red"
-- put width and height of new line into variable
put the width of templateGraphic into tWidthGraphic
put the height of templateGraphic into tHeightGraphic
--name the new line
set the name of templateGraphic to "lineclone" & tGraphicNo
end mouseUp
Then I resize the group to be the same size as the line.
This is the code in the card:
on newGraphic
choose browse tool
clone group GLine
put the number of groups of this card into tGroupNo
set the name of last group to "LClone" & tGroupNo
set the invisible of group ("LClone" & tGroupNo) to false
--resize group
set the width of group ("Lclone" & tGroupNo) to the width of graphic ("lineclone" & tGraphicNo)
set the height of group ("Lclone" & tGroupNo) to the height of graphic ("lineclone" & tGraphicNo)
end newGraphic
Then, I need to put that line into the group.
I have tried with the put command, but it tells me that the group is not a container.
Then i have tried with the start/stop editing commands, but it doesnt work. If I put them into the button, it tells me that it cannot find the background. If I put it into the card, it tells me that it cannot find the background in the stop editing command.
Any ideas? Is there any other simpler way to do it?
Thanks
Marta
Putting a graphic into a group
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- VIP Livecode Opensource Backer
- Posts: 977
- Joined: Sat Apr 08, 2006 7:47 am
- Contact:
You can set the relayerGroupedControls global property to reue, and then change the layer of your newly created line graphic to move it into the group.
HTH,
Jan Schenkel.
HTH,
Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com
www.quartam.com
There's a bug in the "stop editing" command. *Don't* use the group name.
These work (usually):
This doesn't:
These work (usually):
Code: Select all
stop editing group
stop editing background
Code: Select all
stop editing group "LClone"