On Monday 08 April 2002 11:58 am, Juergen Vigna wrote: > On 08-Apr-2002 Angus Leeming wrote: > > I was envisioning a collapsible inset much like InsetNote. No popups at > > all. > > And where would you put the "Caption" stuff? As much as I know we had an > input box for the subfigure caption in insetfig, hadn't we?
Yes and this is wrong, because the caption is not a fuction of the Figure but of something containing the figure. Let's call that something InsetSubcaption. (Incidentally, can people think of a "good" name for an inset that contains a caption and either a graphic or a table.) The problem is a little complicated because in buffer.C we do: } else if (tmptok == "Figure" || // Backward compatibility tmptok == "Graphics") { inset = new InsetGraphics; } ... inset->read(this, lex); and these may contain a caption. What we want is (pseudo-code): } else if (tmptok == "Figure" || // Backward compatibility tmptok == "Graphics") { if (ContainsSubcaption(lex)) // More backward compatibility inset = new InsetSubcaption; else inset = new InsetGraphics; } else if (tmptok == "Subcaption") { // All new files will be like this... inset = new InsetSubcaption; } ... inset->read(this, lex); > > As for the subfigure, subtable stuff, this is important only for LaTeX > > output right? Is it possible for the inset to know that it's parent inset > > is a figure float or a table float? > > if (owner() && owner()->owner() > && owner()->owner()->lyxCode == FLOAT_CODE > && (owner()->owner()->getInsetName() == "figure" > > || owner()->owner()->getInsetName() == "table")) > > { > } > > should work. Thanks, Jürgen. Angus