]> git.lyx.org Git - features.git/commitdiff
* src/inset/InsetNomencl.cpp:
authorJürgen Spitzmüller <spitz@lyx.org>
Sat, 23 Aug 2008 15:02:44 +0000 (15:02 +0000)
committerJürgen Spitzmüller <spitz@lyx.org>
Sat, 23 Aug 2008 15:02:44 +0000 (15:02 +0000)
- implemet inset tooltip.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26227 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/InsetNewline.cpp
src/insets/InsetNomencl.cpp
src/insets/InsetNomencl.h

index 62be1d3ca87e2f909b1cab6929de57236768d743..7133f554b0afb5f1302c6da9467acd22c7f6ad2e 100644 (file)
@@ -13,6 +13,7 @@
 
 #include "InsetNewline.h"
 
+#include "Buffer.h"
 #include "Dimension.h"
 #include "FuncRequest.h"
 #include "FuncStatus.h"
@@ -142,6 +143,8 @@ ColorCode InsetNewline::ColorName() const
 
 int InsetNewline::latex(odocstream & os, OutputParams const &) const
 {
+       LYXERR0("Code: " << buffer().inset().lyxCode());
+       
        switch (params_.kind) {
                case InsetNewlineParams::NEWLINE:
                        os << "\\\\\n";
index dc5e2489e37c898b94b8b0acf4a88a402b1cd37b..b3a3cb30ec0987e3851b66fad2c17d319c502ba8 100644 (file)
 
 #include "support/docstream.h"
 #include "support/gettext.h"
+#include "support/lstrings.h"
 
 using namespace std;
+using namespace lyx::support;
 
 namespace lyx {
 
 
 /////////////////////////////////////////////////////////////////////
 //
-// InsetPrintNomencl
+// InsetNomencl
 //
 /////////////////////////////////////////////////////////////////////
 
@@ -66,6 +68,18 @@ docstring InsetNomencl::screenLabel() const
 }
 
 
+docstring InsetNomencl::toolTip(BufferView const & /*bv*/, int /*x*/, int /*y*/) const
+{
+       docstring tip = _("Nomenclature Symbol: ") + getParam("symbol") + "\n";
+       tip += _("Description: ") + "\t"
+               + subst(getParam("description"), from_ascii("\\\\"), from_ascii("\n\t"));
+       if (!getParam("prefix").empty())
+               tip += "\n" + _("Sorting: ") + getParam("prefix");
+       return tip;
+}
+
+
+
 int InsetNomencl::docbook(odocstream & os, OutputParams const &) const
 {
        os << "<glossterm linkend=\"" << nomenclature_entry_id << "\">"
index 9fc64bcf11716bdc5df719604cd6ba6bfb67a9fd..677daa84ee0d2393b350c9c96983aa44cd429542 100644 (file)
@@ -30,6 +30,8 @@ public:
        ///
        docstring screenLabel() const;
        ///
+       docstring toolTip(BufferView const & bv, int x, int y) const;
+       ///
        EDITABLE editable() const { return IS_EDITABLE; }
        /// Updates needed features for this inset.
        void validate(LaTeXFeatures & features) const;