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
-
magice
- Posts: 457
- Joined: Wed Mar 18, 2009 12:57 am
Post
by magice » Fri Jan 02, 2015 10:55 pm
a have a script that clones a template group of fields based on a user controlled number of data entries and places each newly created group below the previous. Now I need to create a scrollbar for when the number of groups exceed the length of the stack. It was my thought to group all of the dynamically created groups into a master group and then set the vScrollbar and hScrollbar to true. The group command however does not seem to like my syntax.
Code: Select all
repeat with i= 1 to the number of groups in cd 1
put the short name of grp i of cd 1 into tName
put tName&&"and "before tGList
end repeat
delete the last word in tGList
group tGlist --Here it hangs it doesn't seem to like "group id xxx and group id xxx etc"
put it into tMasterGroup
set the vScrollbar of tMasterGroup to true
set the hScrollbar of tMasterGroup to true
How would be a better way of doing this?
-
magice
- Posts: 457
- Joined: Wed Mar 18, 2009 12:57 am
Post
by magice » Sat Jan 03, 2015 4:11 am
Never mind, after fighting with this for awhile I has one of those "I'm such an idiot" moments and realized that the scroll bars would not work anyway because they will be the height of the master group not the height of the stack. So I just ended up scripting a separate scroll bar object to do the job. I should have just done that in the first place.
-
Klaus
- Posts: 14199
- Joined: Sat Apr 08, 2006 8:41 am
-
Contact:
Post
by Klaus » Sat Jan 03, 2015 1:03 pm
Hi Magice,
this should work also:
Code: Select all
...
put it into tMasterGroup
set the vScrollbar of tMasterGroup to true
set the hScrollbar of tMasterGroup to true
set the rect of tMasterGroup to the rect of this cd
set the lockloc of tMasterGroup to TRUE
...
Another way of grouping excisting object is to do somethig like this:
Code: Select all
...
repeat with i = 1 to the number of groups OF cd 1
set the SELECTED of grp i OF cd 1 to TRUE
end repeat
## Now all groups are selected:
GROUP
## Done! Now DE-select everything again:
select empty
## :-)
...
Best
Klaus