On Fri, 17 Oct 2003, Jean-Marc Lasgouttes wrote: > Alain> At the user level, my slant is somewhat different. I can change > Alain> the layout of a whole block (even by mistake), then change my > Alain> mind and go back to the original. With your approach, this will > Alain> imply to set back each "specifically aligned " paragraph that > Alain> by chance were temporary assimilated to the layout. > > Doesn't undo work for that? undo is useful only if you din't change anything else in the meanwhile.
> > Alain> So you have to create a layout instance for each combination > Alain> you encounter (and at first I imagined to create it dynamicaly, > Alain> without requiring a Style entry) and manage it when moving the > Alain> tabular across environments. > What do you mean by moving across environments? Copying a cell in a > column with different alignment? Not only. A tabular column is not a layout (neither a lextex environment) by itself. A tabular may be in a float, or even inligned (I don't know why it could be a good idea, though). Lot of things (fonts, etc..) are inherited from the environment. So copying a tabular from one layout to another would impose to manage all the "embeded layouts" coherently. A cell in a tabular may be considered as a paragraph, following or not the "defaults" for paragraph related parameters. That's what is done already, and seems reasonable so I was going on with it. > Andre', since you looked at that, what would be the right way to have > the column tell the cell what the default alignment is? Can we do that > through a LyXLayout, so that the paragraphs in a tabular work like > everything else? It could be done, but would imply much more work, and will not makes "tabular work like everything else", I guess. As I understand the present code, layouts are managed at one level, paragraphs at a lower one. I just propose to add one entry to the paragraphParameters struct, giving the "default alignment", either layout or block,right,...... The mechanism is really simple : if the context (eg insetTabular when dealing with fixed width columns) wants to specify a default alignment, it just change this "defaultAlignment entry from layout to something else. When a paragraph is set to a specific alignment, just set the "alignment" entry. Apart from slight modifications of access functions (in fact, giving access functions at the paragraph level instead of the paragrph->params level helps a bit) all present mechanisms remain unchanged : When outputing to latex, just check if the paragraph follows the default -> nothing to be done; When displaying on screen, check the actual alignment, no matter it comes from the default or is explicitely set. Btw, it was like this for 1.2 and 1.3; there were lot of changes in 1.4.0, I hope it remains true, I didn't check yet :-(. Hope this helps. Alain -- ******************************************************************* * Alain Castera * * IPNL - UCB Lyon 1 | e-mail : [EMAIL PROTECTED] * * Bat. Paul Dirac | or [EMAIL PROTECTED] * * Campus de la Doua | Telephone : (+33) 472448429 * * F69622 Villeurbanne CEDEX | Fax : (+33) 472448004 * *******************************************************************