Grouped Controls(Objects)

2014-03-08 Thread Terence Heaford
I have a group to which I add objects.

create field in group  “myGroup”

put the id of the last fld into tID

I then have a property of the group where I store the id called uObjectList

Then at some point I delete all the objects in uObjectList to clear out the 
group.

Is there a simpler way to do this?

Is it possible to get a list of objects contained in a group?


Thanks

Terry
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Grouped Controls(Objects)

2014-03-08 Thread Mark Schonewille

Hi Terry,

Why don't you simply delete the group and create a new one?

If you want to have a list of controls of a group, card or stack, you 
can use a repeat loop in a getProp handler:


getProp allControls
  repeat with x = 1 to the number of controls of the target
put the long id of control x of the target  cr after myList
  end repeat
  return char 1 to -2 of myList
end allControls

--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer
KvK: 50277553

Use Color Converter to convert CMYK, RGB, RAL, XYZ, H.Lab and other 
colour spaces. http://www.color-converter.com


Buy my new book Programming LiveCode for the Real Beginner 
http://qery.us/3fi


LiveCode on Facebook:
https://www.facebook.com/groups/runrev/

On 3/8/2014 13:14, Terence Heaford wrote:

I have a group to which I add objects.

create field in group  “myGroup”

put the id of the last fld into tID

I then have a property of the group where I store the id called uObjectList

Then at some point I delete all the objects in uObjectList to clear out the 
group.

Is there a simpler way to do this?

Is it possible to get a list of objects contained in a group?


Thanks

Terry



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


RE: Grouped Controls(Objects)

2014-03-08 Thread Mats Wilstrand
Hi Terry!

From 6.1 there are four new properties you can use for tasks like yours:

controlIDs reports the short IDs of all the controls of a card or group.
(undocumented)
controlNames reports the short names of all the controls of a card or
group. (undocumented)
childControlIDs reports the short IDs of all the direct children of a card
or group.
childControlNames reports the short names of all the direct children of a
card or group.

Requires a minimum of code to do what you want and does it fast:

on mouseUp
   repeat for each line tID in the controlIDs of grp myGroup
  delete control id tID
   end repeat
end mouseUp

We must thank the guys in the deep and dark mines of the C++ mountain for
contributing things like this!

Best regards
Mats

 -Original Message-
 From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On
 Behalf Of Terence Heaford
 Sent: den 8 mars 2014 13:15
 To: How to use LiveCode
 Subject: Grouped Controls(Objects)
 
 I have a group to which I add objects.
 
 create field in group  myGroup
 
 put the id of the last fld into tID
 
 I then have a property of the group where I store the id called
uObjectList
 
 Then at some point I delete all the objects in uObjectList to clear out
the
 group.
 
 Is there a simpler way to do this?
 
 Is it possible to get a list of objects contained in a group?
 
 
 Thanks
 
 Terry
 ___
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
subscription
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Grouped Controls(Objects)

2014-03-08 Thread Terence Heaford
Thanks Mark,

The group is actually a group that contains the methods for drawing bar, line 
and pie charts
and has 750 lines of script.

The objects I create in the group are lines, fields, rectangles etc. that are 
created to make up the charts.

I currently have a property that contains a list of the objects that I work 
through when deleting the charts.

I was hoping that a LC group had a property that returned a list of objects 
contained in the group.

I will try your script though.

Thanks

Terry

On 8 Mar 2014, at 12:23, Mark Schonewille m.schonewi...@economy-x-talk.com 
wrote:

 Why don't you simply delete the group and create a new one?
 
 If you want to have a list of controls of a group, card or stack, you can use 
 a repeat loop in a getProp handler:
 
 getProp allControls
  repeat with x = 1 to the number of controls of the target
put the long id of control x of the target  cr after myList
  end repeat
  return char 1 to -2 of myList
 end allControls

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Grouped Controls(Objects)

2014-03-08 Thread Terence Heaford
Sorry Mats, I did not read you reply as closely as I should.

Now realise that “childControlNames” is the documented version of 
“controlNames” etc.

Thanks again

Terry

On 8 Mar 2014, at 13:08, Mats Wilstrand mats.wilstr...@tapirsoft.com wrote:

 From 6.1 there are four new properties you can use for tasks like yours:
 
 controlIDs reports the short IDs of all the controls of a card or group.
 (undocumented)
 controlNames reports the short names of all the controls of a card or
 group. (undocumented)
 childControlIDs reports the short IDs of all the direct children of a card
 or group.
 childControlNames reports the short names of all the direct children of a
 card or group.

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode