Helge Hafting wrote:

> After studying the code some more, I agree that InsetSpace is the better
> base for this.  quad, qquad, enskip and enspace are already implemented,
> there simply isn't any gui way (short of the command line) to add them.

There is a bug in bugzilla for the missing gui, don't remember the number.

> So this will certainly be the easier way, and I look to vspace only for
> details on
> the dialog box, and parsing of glue lengths.
> 
> But why do you want me to rename InsetSpace to InsetHspace?
> Why not simply extend it with the user defined hspace lengths?
> Is this for naming consistency with vspace, or something else?

Yes. It is not too important, but I thought it would be worth it, since you
change the file format anyway because of the new lengths.

> As for parsing of lengths - there seems to be an excellent routine
> for that in VSpace.  Horisontal spacing will use exactly the same
> lengths (2.5cm, -4in, . . .) so surely this can be reused.  What's the
> proper way of doing this?  Surely this part must be moved from the
> VSpace class and into something of its own - otherwise I'll have
> to copy&paste it. (Perhaps the first attempt will do that anyway,
> but it'd be nice to clean up the duplication too.)

No need to copy or move aything. The function you want is isValidLength and
already declared in src/lyxlength.h and uses a LyXLength, not a VSpace.
The really interesting thing is to extend LyXLength to handle user defined
lengths. How would that be done? Having a central place where the user
could define his own lengths, or simply allowing an arbitray unit for user
defined lengths?

> The final question is about hfill.  Currently, hfill is an inset of its
> own, not part of the space inset. The plan was to make hfill part of
> horizontal spacing, similiar to how vfill is part of vertical spacing.
> Doing this will alter the file format without anything new happening
> though.

Don't worry about the file format change. Implementing it in lyx2lyx will be
trivial. If there is a good reason for a change, just do it.

> But there is another alternative.  One of my next tasks will be
> to add other fills, such as dotfill and rulefill.  hfill could be grouped
> with those instead.
> 
> So what is most important - the fact that hfill is _blank_ and therefore
> a kind of hspace, or the fact that hfill is a _fill_ like those other
> fills?

I never needed the other fills, so I am not sure.


Georg

Reply via email to