2 * \file InsetMathCommand.cpp
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
8 * Full author contact details are available in file CREDITS.
13 #include "InsetMathCommand.h"
15 #include "MathStream.h"
16 #include "DispatchResult.h"
25 InsetMathCommand::InsetMathCommand(Buffer * buf, docstring const & name, bool needs_math_mode)
26 : InsetMathNest(buf, 2), name_(name), needs_math_mode_(needs_math_mode),
33 Inset * InsetMathCommand::clone() const
35 return new InsetMathCommand(*this);
39 void InsetMathCommand::metrics(MetricsInfo & mi, Dimension & dim) const
43 button_.update(screenLabel(), true, false);
45 button_.metrics(mi, dim);
49 Inset * InsetMathCommand::editXY(Cursor & cur, int /*x*/, int /*y*/)
56 void InsetMathCommand::draw(PainterInfo & pi, int x, int y) const
58 button_.draw(pi, x, y);
62 void InsetMathCommand::write(WriteStream & os) const
64 ModeSpecifier specifier(os, currentMode(), lockedMode(), asciiOnly());
65 MathEnsurer ensurer(os, needs_math_mode_);
68 os << '[' << cell(1) << ']';
69 os << '{' << cell(0) << '}';
73 docstring const InsetMathCommand::screenLabel() const