* Licence details can be found in the file COPYING.
*
* \author various
- * \author André Pönitz
+ * \author André Pönitz
*
* Full author contact details are available in file CREDITS.
*/
#include "Lexer.h"
#include "MetricsInfo.h"
#include "OutputParams.h"
+#include "output_xhtml.h"
#include "Text.h"
#include "support/debug.h"
+#include "support/docstream.h"
#include "support/gettext.h"
#include "support/lassert.h"
InsetVSpace::InsetVSpace(VSpace const & space)
- : space_(space)
+ : Inset(0), space_(space)
{}
break;
}
- case LFUN_MOUSE_RELEASE:
- if (!cur.selection() && cmd.button() == mouse_button::button1)
- cur.bv().showDialog("vspace", params2string(space()),
- const_cast<InsetVSpace *>(this));
- break;
-
default:
Inset::doDispatch(cur, cmd);
break;
}
status.setEnabled(true);
return true;
+
default:
return Inset::getStatus(cur, cmd, status);
}
}
-void InsetVSpace::edit(Cursor & cur, bool, EntryDirection)
+bool InsetVSpace::showInsetDialog(BufferView * bv) const
{
- cur.bv().showDialog("vspace", params2string(space()),
+ bv->showDialog("vspace", params2string(space()),
const_cast<InsetVSpace *>(this));
+ return true;
}
}
+docstring InsetVSpace::xhtml(XHTMLStream &, OutputParams const &) const
+{
+ odocstringstream ods;
+ XHTMLStream xds(ods);
+ string const len = space_.asHTMLLength();
+ string const attr = "style='height:" + (len.empty() ? "1em" : len) + "'";
+ xds << StartTag("div", attr, true) << EndTag("div");
+ return ods.str();
+}
+
+
docstring InsetVSpace::contextMenu(BufferView const &, int, int) const
{
return from_ascii("context-vspace");