#include "gettext.h"
#include "lyx_gui_misc.h" // CancelCloseBoxCB
#include "Painter.h"
+#include "BufferView.h"
#include "font.h"
using std::ostream;
/* Error, used for the LaTeX-Error Messages */
+#if 0
InsetError::InsetError()
{
form = 0;
}
+#endif
InsetError::InsetError(string const & str)
- : contents(str)
-{
- form = 0;
-}
+ : contents(str), form(0)
+{}
InsetError::~InsetError()
}
-int InsetError::ascent(Painter &, LyXFont const & font) const
+int InsetError::ascent(BufferView *, LyXFont const & font) const
{
LyXFont efont;
efont.setSize(font.size()).decSize();
}
-int InsetError::descent(Painter &, LyXFont const & font) const
+int InsetError::descent(BufferView *, LyXFont const & font) const
{
LyXFont efont;
efont.setSize(font.size()).decSize();
}
-int InsetError::width(Painter &, LyXFont const & font) const
+int InsetError::width(BufferView *, LyXFont const & font) const
{
LyXFont efont;
efont.setSize(font.size()).decSize();
}
-void InsetError::draw(Painter & pain, LyXFont const & font,
- int baseline, float & x) const
+void InsetError::draw(BufferView * bv, LyXFont const & font,
+ int baseline, float & x, bool) const
{
+ Painter & pain = bv->painter();
LyXFont efont;
efont.setSize(font.size()).decSize();
efont.setColor(LColor::error);
// Draw as "Error" in a framed box
x += 1;
- pain.fillRectangle(int(x), baseline - ascent(pain, font) + 1,
- width(pain, font) - 2,
- ascent(pain, font) + descent(pain, font) - 2,
+ pain.fillRectangle(int(x), baseline - ascent(bv, font) + 1,
+ width(bv, font) - 2,
+ ascent(bv, font) + descent(bv, font) - 2,
LColor::insetbg);
- pain.rectangle(int(x), baseline - ascent(pain, font) + 1,
- width(pain, font) - 2,
- ascent(pain, font) + descent(pain, font) - 2,
+ pain.rectangle(int(x), baseline - ascent(bv, font) + 1,
+ width(bv, font) - 2,
+ ascent(bv, font) + descent(bv, font) - 2,
LColor::error);
pain.text(int(x + 2), baseline, _("Error"), efont);
- x += width(pain, font) - 1;
+ x += width(bv, font) - 1;
}
// A C wrapper
-extern "C" void C_InsetError_CloseErrorCB(FL_OBJECT * ob, long data)
+extern "C"
+void C_InsetError_CloseErrorCB(FL_OBJECT * ob, long data)
{
InsetError::CloseErrorCB(ob , data);
}