2 #include "command_inset.h"
3 #include "math_mathmlstream.h"
4 #include "funcrequest.h"
8 CommandInset::CommandInset(string const & name)
17 InsetBase * CommandInset::clone() const
19 return new CommandInset(*this);
23 void CommandInset::metrics(MetricsInfo & mi, Dimension & dim) const
27 button_.update(screenLabel(), true);
29 button_.metrics(mi, dim);
33 void CommandInset::draw(PainterInfo & pi, int x, int y) const
35 button_.draw(pi, x, y);
39 CommandInset::dispatch(FuncRequest const & cmd, idx_type & idx, pos_type & pos)
43 return MathNestInset::dispatch(cmd, idx, pos);
49 void CommandInset::write(WriteStream & os) const
51 os << '\\' << name_.c_str();
53 os << '[' << cell(1) << ']';
54 os << '{' << cell(0) << '}';
58 string const CommandInset::screenLabel() const
64 string const CommandInset::createDialogStr(string const & name) const
67 data << name << " LatexCommand ";
68 WriteStream wsdata(data);
70 wsdata << "\n\\end_inset\n\n";
71 return STRCONV(data.str());