1 #include "command_inset.h"
2 #include "math_mathmlstream.h"
3 #include "funcrequest.h"
9 CommandInset::CommandInset(string const & name)
18 auto_ptr<InsetBase> CommandInset::clone() const
20 return auto_ptr<InsetBase>(new CommandInset(*this));
24 void CommandInset::metrics(MetricsInfo & mi, Dimension & dim) const
28 button_.update(screenLabel(), true);
30 button_.metrics(mi, dim);
34 void CommandInset::draw(PainterInfo & pi, int x, int y) const
36 button_.draw(pi, x, y);
40 CommandInset::dispatch(FuncRequest const & cmd, idx_type & idx, pos_type & pos)
44 return MathNestInset::dispatch(cmd, idx, pos);
50 void CommandInset::write(WriteStream & os) const
52 os << '\\' << name_.c_str();
54 os << '[' << cell(1) << ']';
55 os << '{' << cell(0) << '}';
59 string const CommandInset::screenLabel() const
65 string const CommandInset::createDialogStr(string const & name) const
68 data << name << " LatexCommand ";
69 WriteStream wsdata(data);
71 wsdata << "\n\\end_inset\n\n";
72 return STRCONV(data.str());