}
+docstring InsetPhantom::toolTip(BufferView const & bv, int x, int y) const
+{
+ OutputParams rp(&buffer().params().encoding());
+ odocstringstream ods;
+ InsetText::plaintext(ods, rp);
+ docstring content_tip = ods.str();
+ // shorten it if necessary
+ if (content_tip.size() > 200)
+ content_tip = content_tip.substr(0, 200) + "...";
+ if (params_.type == InsetPhantomParams::Phantom)
+ return from_ascii("Phantom: ") + content_tip;
+ if (params_.type == InsetPhantomParams::HPhantom)
+ return from_ascii("HPhantom: ") + content_tip;
+ if (params_.type == InsetPhantomParams::VPhantom)
+ return from_ascii("VPhantom: ") + content_tip;
+}
+
+
int InsetPhantom::latex(odocstream & os, OutputParams const & runparams_in) const
{
OutputParams runparams(runparams_in);
///
docstring editMessage() const;
///
- InsetCode lyxCode() const { return PHANTOM_CODE; }
- ///
docstring name() const;
///
DisplayType display() const;
///
- bool noFontChange() const { return params_.type != InsetPhantomParams::Phantom; }
- ///
void metrics(MetricsInfo &, Dimension &) const;
///
void draw(PainterInfo & pi, int x, int y) const;
///
void doDispatch(Cursor & cur, FuncRequest & cmd);
///
- Inset * clone() const { return new InsetPhantom(*this); }
+ docstring toolTip(BufferView const & bv, int x, int y) const;
/// used by the constructors
void init();
///