Martin Vermeer wrote: > On Thu, Sep 18, 2003 at 10:51:21PM +0000, Angus Leeming spake thusly: >> >> Martin Vermeer wrote: >> >> > This patch adds support for rectangular frames containing one or more >> > paragraphs of text, at the width of the column, using the Note >> > infrastructure. >> > >> > It wouldn't be too hard to extend this to fancybox support. >> > >> > Does this look like the right thing to do? >> >> What has this got to do with 'Note'? Derive a new InsetBoxed from >> InsetCollapsable. >> >> -- >> Angus > > Okay, did just that. Here is the next attempt.
Returning to nit-picking mode: +InsetBox::InsetBox(BufferParams const & bp, string const & label) + : InsetCollapsable(bp) +{ + params_.type = label; + init(); + setButtonLabel(); +} init() calls setButtonLabel()... +InsetBox::~InsetBox() // MV MV... ;-) +void InsetBox::setButtonLabel() +{ + LyXFont font(LyXFont::ALL_SANE); + font.decSize(); + font.decSize(); + + if (params_.type == "Boxed") { + setLabel(_("Boxed")); + font.setColor(LColor::foreground); + setBackgroundColor(LColor::background); + } + setLabelFont(font); +} Can I ask, what types other than "Boxed" are there? +dispatch_result InsetBox::localDispatch(FuncRequest const & cmd) ... + case LFUN_INSET_MODIFY: { + InsetBoxParams params; + InsetBoxMailer::string2params(cmd.argument, params); + params_.type = params.type; + setButtonLabel(); + bv->updateInset(this); + return DISPATCHED; + } Question. Why doesn't InsetBoxMailer::string2params set the "type" -- Angus