* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
- * Copyright 1995-1999 The LyX Team.
+ * Copyright 1995-2000 The LyX Team.
*
* ====================================================== */
#include "buffer.h"
#include "support/lstrings.h"
#include "Painter.h"
+#include "font.h"
+
+using std::ostream;
+using std::endl;
/* Info, used for the Info boxes */
int InsetInfo::ascent(Painter &, LyXFont const & font) const
{
- return font.maxAscent() + 1;
+ return lyxfont::maxAscent(font) + 1;
}
int InsetInfo::descent(Painter &, LyXFont const & font) const
{
- return font.maxDescent() + 1;
+ return lyxfont::maxDescent(font) + 1;
}
int InsetInfo::width(Painter &, LyXFont const & font) const
{
- return 6 + font.textWidth(_("Note"), strlen(_("Note")));
+ return 6 + lyxfont::width(_("Note"), font);
}
LyXFont font(f);
/* Info-insets are never LaTeX, so just correct the font */
- font.setLatex(LyXFont::OFF);
-
+ font.setLatex(LyXFont::OFF).setColor(LColor::note);
+
// Draw as "Note" in a yellow box
x += 1;
pain.fillRectangle(int(x), baseline - ascent(pain, font) + 1,
width(pain, font) - 2,
- ascent(pain, font) + descent(pain, font) - 2);
+ ascent(pain, font) + descent(pain, font) - 2,
+ LColor::notebg);
pain.rectangle(int(x), baseline - ascent(pain, font) + 1,
width(pain, font) - 2,
- ascent(pain, font) + descent(pain, font) - 2);
+ ascent(pain, font) + descent(pain, font) - 2,
+ LColor::noteframe);
pain.text(int(x + 2), baseline, _("Note"), font);
x += width(pain, font) - 1;
}
-int InsetInfo::Latex(ostream &, signed char /*fragile*/) const
+int InsetInfo::Latex(ostream &,
+ bool /*fragile*/, bool /*free_spc*/) const
{
return 0;
}
-int InsetInfo::Latex(string &, signed char /*fragile*/) const
+int InsetInfo::Ascii(ostream &) const
{
return 0;
}
-int InsetInfo::Linuxdoc(string &) const
+int InsetInfo::Linuxdoc(ostream &) const
{
return 0;
}
-int InsetInfo::DocBook(string &) const
+int InsetInfo::DocBook(ostream &) const
{
return 0;
}
-unsigned char InsetInfo::Editable() const
+Inset::EDITABLE InsetInfo::Editable() const
{
- return 1;
+ return IS_EDITABLE;
}
}
+char const * InsetInfo::EditMessage() const
+{
+ return _("Opened note");
+}
+
+
void InsetInfo::Edit(BufferView *bv, int, int, unsigned int)
{
static int ow = -1, oh;