Re: Using groups - geometry management

2000-09-08 Thread David Bovill

Progress (details of the use of names and groups):

You can target a nested group by simply specifying one of it's owners (you
don't need the whole hierarchy). Therefore to fix the problem that occurs
when are two objects with the same name inside different groups:

  put "Test" into fld "Title" of group "Write"

works even if there is another field "Title" in group "Read". This works
even when fl "Title" is in fact inside another group and then inside the
group "Write" - you don't need to specify all the nesting in order to safely
specify the field - which is nice.

I now use syntax like this

  put topGroupId() into myGroupId
  put "Working" into fld "Write Subject" of group id myGroupId
  -- put "Error" into fld "Write Subject" -- would go into the wrong field

I can then place a function in the top group that I want to be able to clone
and place wherever I want, and not have to worry about the names of other
objects on the card.

The following function in the script of the top groups object then
identifies the group, allowing it to act as an independent object:

function topGroupId
  return the short id of me
end topGroupId

 

 From: David Bovill [EMAIL PROTECTED]
 Reply-To: [EMAIL PROTECTED]
 Date: Thu, 07 Sep 2000 12:08:25 +0100
 To: [EMAIL PROTECTED]
 Subject: Using groups - geometry management
 
 I have the idea that I can use groups to simplify the task of complex
 geometry management. The aim is to have each group act as an independent
 object, so that groups can be added or subtracted without having to change
 any of the other existing groups.
 
 The strategy is:
 1) For each group to have a "resizeStack" handler
 2) Each "resizeStack" handler sets the position of every within the
 group unless it is a group, in which case it send a "resizeStack" message to
 the group.
 
 At the moment the problem I am having is that if I clone the group, the
 scripts within the group seem to affect objects outside the group which
 naturally enough now have the same name. Renaming the group does not help.
 Of course renaming all 40 or so objects solves the problem, as would using
 long names of id's. I was just wandering if there was a simple way of
 restricting the action of a groups scripts to the groups contents?
 
 Would it work in general to add "of me" to the short name of any object
 referenced. Does this work with objects nested within groups in the group
 concerned?
 
 As always, any help appreciated, I'm working on a complex group and it could
 take me a whole day to find out that some unforeseen problem with a naming
 strategy brakes the entire strategy.
 
 Ta
 
 
 
 Archives: http://www.mail-archive.com/metacard%40lists.best.com/
 Info: http://www.xworlds.com/metacard/mailinglist.htm
 Please send bug reports to [EMAIL PROTECTED], not this list.


Archives: http://www.mail-archive.com/metacard%40lists.best.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to [EMAIL PROTECTED], not this list.




Re: Using groups - geometry management

2000-09-07 Thread Scott Raney

On Thu, 7 Sep 2000, David Bovill wrote:

 I have the idea that I can use groups to simplify the task of complex
 geometry management. The aim is to have each group act as an independent
 object, so that groups can be added or subtracted without having to change
 any of the other existing groups.
 
 The strategy is:
 1) For each group to have a "resizeStack" handler
 2) Each "resizeStack" handler sets the position of every within the
 group unless it is a group, in which case it send a "resizeStack" message to
 the group.

Note that first level groups (those directly on the card) will
automatically get this message, so all you need to do is be sure to
pass it in each handler so that the next group down will get it.

Be very careful sending a standard message to any object and
especially to child objects: you may find yourself in an infinite loop
if the child doesn't handle the message and it makes its way back up
to the parent object (which resends it...).  It'd probably be better
to make up another message to send to the nested groups.

 At the moment the problem I am having is that if I clone the group, the
 scripts within the group seem to affect objects outside the group which
 naturally enough now have the same name. Renaming the group does not help.
 Of course renaming all 40 or so objects solves the problem, as would using
 long names of id's. I was just wandering if there was a simple way of
 restricting the action of a groups scripts to the groups contents?
 
 Would it work in general to add "of me" to the short name of any object
 referenced. Does this work with objects nested within groups in the group
 concerned?

It should, yes.

 As always, any help appreciated, I'm working on a complex group and it could
 take me a whole day to find out that some unforeseen problem with a naming
 strategy brakes the entire strategy.

Another feature that might be useful is the groupNames and groupIDs
properties of cards.  They return a list of the group objects on that
card, so you can deal with those first level groups separately.
  Regards,
Scott

 Ta


Scott Raney  [EMAIL PROTECTED]  http://www.metacard.com
MetaCard: You know, there's an easier way to do that...


Archives: http://www.mail-archive.com/metacard%40lists.best.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to [EMAIL PROTECTED], not this list.