From e900790be8e18d7a427f734b0a878ca2fe8f7428 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Uwe=20St=C3=B6hr?= Date: Sun, 1 Feb 2009 20:18:52 +0000 Subject: [PATCH] - InsetPhantom.h: remove unneeded declarations - InsetPhantom.cpp: add tooltips git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28311 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/insets/InsetPhantom.cpp | 18 ++++++++++++++++++ src/insets/InsetPhantom.h | 6 +----- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/src/insets/InsetPhantom.cpp b/src/insets/InsetPhantom.cpp index 65634ef455..07728ea3d3 100644 --- a/src/insets/InsetPhantom.cpp +++ b/src/insets/InsetPhantom.cpp @@ -303,6 +303,24 @@ bool InsetPhantom::getStatus(Cursor & cur, FuncRequest const & cmd, } +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); diff --git a/src/insets/InsetPhantom.h b/src/insets/InsetPhantom.h index 0b69bc879b..e1e976b823 100644 --- a/src/insets/InsetPhantom.h +++ b/src/insets/InsetPhantom.h @@ -60,14 +60,10 @@ private: /// 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; @@ -90,7 +86,7 @@ private: /// 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(); /// -- 2.39.5