Groups--field and graphic

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

Post Reply
laurpapo
Posts: 38
Joined: Thu Jun 21, 2012 4:25 pm

Groups--field and graphic

Post by laurpapo » Thu Jun 28, 2012 7:47 pm

Hello,

Another probably silly question for me to ask, but I'm having trouble changing something in my program. We have a templatefield all set up, which is used alot. The premise of the program is to allow users to create 'maps' or 'webs', by creating fields and linking them together (like a brainstorming cloud). We want to make the fields rounded, more like bubbles to make it kid friendly. From what I've read, the best way to do this would be to group an oval graphic and a field, while making the border of the field invisible. Perhaps I just don't understand the group command, but I'm having trouble doing this and making it so that the field and graphic move around and function as one object.

Any help would be greatly appreciated.

Thanks,

Laurel

Klaus
Posts: 14198
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Groups--field and graphic

Post by Klaus » Thu Jun 28, 2012 8:14 pm

Hi Laurel,

do you want to do the grouping by script or in the IDE?
In the IDE select all objects you want to group (SHIFT-click) and select "Group Selected" (CMD-G) from the "Object" menu.

Via script there are may ways :D
Need more info.

EDIT:
Just tested this in a button on a new card:

Code: Select all

on mouseUp
  create grp
  create grc in grp 1
  create fld in grp 1
end mouseUp
And it worked fine, a field in front of a graphic in a group!
Hint, hint: There is also "the templategroup"! :D


Best

Klaus

laurpapo
Posts: 38
Joined: Thu Jun 21, 2012 4:25 pm

Re: Groups--field and graphic

Post by laurpapo » Thu Jun 28, 2012 8:18 pm

Oh boy. I don't know what an IDE is...sorry. As I said, quite new/inept at this.

I think I want it in the script. What we have now is a button that creates new fields with all of the properties we want the fields to have. I would like to be able to press the button and have both the graphic and field appear (looking like one object, retaining the properties I've already given to the fields).

Does that make sense?

-Laurel

Klaus
Posts: 14198
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Groups--field and graphic

Post by Klaus » Thu Jun 28, 2012 8:20 pm

Looks like I was edinting my posting after you read it, read again, please :)

laurpapo
Posts: 38
Joined: Thu Jun 21, 2012 4:25 pm

Re: Groups--field and graphic

Post by laurpapo » Thu Jun 28, 2012 8:24 pm

I think with some tweaking of scripts, this should (hopefully!) work.

Thanks!

-Laurel

Klaus
Posts: 14198
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Groups--field and graphic

Post by Klaus » Thu Jun 28, 2012 8:34 pm

Hi Laurel,

sure this will work! :D

1. set props for the templategroup -> create grp
2. set props for the templategraphic -> create grc
3. set props for the templatefield -> create fld

The order is important!


Best

Klaus

Post Reply