On Mon, Mar 29, 2004 at 12:07:41PM +0000, Angus Leeming spake thusly:
 
> LFUN_ALL_INSETS_TOGGLE ("open" || "close" || "toggle") <name>
> 
> Resulting in:
> 
> string action;
> string const inset_name = split(argument, action, ' ');
> InsetBase::Code const inset_code = InsetBase::translate(inset_name);
> 
> for (InsetIterator it(buffer()->inset()); it; ++it) {
>         if (inset_code == InsetBase::NO_CODE
>             || inset_code == it->inset->lyxCode())
>                 it->dispatch(FuncRequest(LFUN_INSET_TOGGLE, action));
> }
> 
> Then it is up to the inset to deal with the action as it chooses.
> 
> Presumably, if action == "toggle", the branch inset would do the
> equivalent of:
> 
> void InsetList::insetsOpenCloseBranch(Buffer const & buf)
 
This is not exactly 'toggle', which means 'open if it is closed, close
if it is open'.

Some more descriptive argument name... 'assign'?

- Martin

Attachment: pgp00000.pgp
Description: PGP signature

Reply via email to