using std::string;
using std::istringstream;
-using std::ostream;
using std::ostringstream;
}
-bool InsetCommand::metrics(MetricsInfo & mi, Dimension & dim) const
+void InsetCommand::metrics(MetricsInfo & mi, Dimension & dim) const
{
if (updateButtonLabel_) {
updateButtonLabel_ = false;
- button_.update(getScreenLabel(*mi.base.bv->buffer()),
+ button_.update(getScreenLabel(mi.base.bv->buffer()),
editable() != NOT_EDITABLE);
}
button_.metrics(mi, dim);
- bool const changed = dim_ != dim;
- dim_ = dim;
- return changed;
}
void InsetCommand::draw(PainterInfo & pi, int x, int y) const
{
- setPosCache(pi, x, y);
button_.setRenderState(mouse_hover_);
button_.draw(pi, x, y);
}
}
case LFUN_MOUSE_RELEASE: {
- if (!mailer_name_.empty() && !cur.selection())
- InsetCommandMailer(mailer_name_, *this).showDialog(&cur.bv());
+ if (!cur.selection())
+ edit(cur, true);
break;
}
}
+void InsetCommand::edit(Cursor & cur, bool)
+{
+ if (!mailer_name_.empty())
+ InsetCommandMailer(mailer_name_, *this).showDialog(&cur.bv());
+}
+
+
void InsetCommand::replaceContents(std::string const & from, string const & to)
{
if (getContents() == from)
// by Text::readInset
string id;
lex >> id;
- if (!lex || id != "LatexCommand")
+ if (!lex || id != "CommandInset")
return print_mailer_error("InsetCommandMailer", in, 2, "LatexCommand");
params.read(lex);