}
-InsetMathSpace::~InsetMathSpace()
-{
- hideDialogs("mathspace", this);
-}
-
-
Inset * InsetMathSpace::clone() const
{
return new InsetMathSpace(*this);
}
+void InsetMathSpace::htmlize(HtmlStream & ms) const
+{
+ SpaceInfo const & si = space_info[space_];
+ switch (si.kind) {
+ case InsetSpaceParams::THIN:
+ ms << from_ascii(" ");
+ break;
+ case InsetSpaceParams::MEDIUM:
+ ms << from_ascii(" ");
+ break;
+ case InsetSpaceParams::THICK:
+ ms << from_ascii(" ");
+ break;
+ case InsetSpaceParams::ENSKIP:
+ ms << from_ascii(" ");
+ break;
+ case InsetSpaceParams::QUAD:
+ ms << from_ascii(" ");
+ break;
+ case InsetSpaceParams::QQUAD:
+ ms << from_ascii("  ");
+ break;
+ case InsetSpaceParams::CUSTOM: {
+ string l = length_.asHTMLString();
+ ms << MTag("span", "width='" + l + "'")
+ << from_ascii(" ") << ETag("span");
+ break;
+ }
+ default:
+ break;
+ }
+}
+
+
void InsetMathSpace::normalize(NormalStream & os) const
{
os << "[space " << int(space_) << "] ";
}
-string const InsetMathSpace::createDialogStr() const
+InsetSpaceParams InsetMathSpace::params() const
{
LASSERT(space_info[space_].visible, /**/);
InsetSpaceParams isp(true);
isp.kind = space_info[space_].kind;
isp.length = GlueLength(length_);
- return InsetSpace::params2string(isp);
+ return isp;
}
bool InsetMathSpace::getStatus(Cursor & cur, FuncRequest const & cmd,
FuncStatus & status) const
{
- switch (cmd.action) {
+ switch (cmd.action()) {
// we handle these
case LFUN_INSET_MODIFY:
case LFUN_INSET_DIALOG_UPDATE:
void InsetMathSpace::doDispatch(Cursor & cur, FuncRequest & cmd)
{
- switch (cmd.action) {
+ switch (cmd.action()) {
case LFUN_INSET_MODIFY:
if (cmd.getArg(0) == "mathspace") {
MathData ar;
cur.undispatched();
break;
- case LFUN_INSET_DIALOG_UPDATE:
- cur.bv().updateDialog("mathspace", createDialogStr());
- break;
-
case LFUN_MOUSE_RELEASE:
if (cmd.button() == mouse_button::button1) {
- string const data = createDialogStr();
- cur.bv().showDialog("mathspace", data, this);
+ showInsetDialog(&cur.bv());
break;
}
cur.undispatched();