* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
- * Copyright 2000 The LyX Team.
+ * Copyright 2000-2001 The LyX Team.
*
* ====================================================== */
#include "BufferView.h"
#include "Painter.h"
#include "support/LAssert.h"
+#include "lyxfont.h"
+#include "font.h"
using std::ostream;
using std::endl;
int width;
int ascent;
int descent;
- string const s = getScreenLabel();
-
- if (Editable()) {
- bv->painter().buttonText(0, 0, s, font,
- false, width, ascent, descent);
+ string const s = getScreenLabel(bv->buffer());
+
+ if (editable()) {
+ lyxfont::buttonText(s, font, width, ascent, descent);
} else {
- bv->painter().rectText(0, 0, s, font,
- LColor::commandbg, LColor::commandframe,
- false, width, ascent, descent);
+ lyxfont::rectText(s, font, width, ascent, descent);
}
+
return ascent;
}
int width;
int ascent;
int descent;
- string const s = getScreenLabel();
-
- if (Editable()) {
- bv->painter().buttonText(0, 0, s, font,
- false, width, ascent, descent);
+ string const s = getScreenLabel(bv->buffer());
+
+ if (editable()) {
+ lyxfont::buttonText(s, font, width, ascent, descent);
} else {
- bv->painter().rectText(0, 0, s, font,
- LColor::commandbg, LColor::commandframe,
- false, width, ascent, descent);
+ lyxfont::rectText(s, font, width, ascent, descent);
}
+
return descent;
}
int width;
int ascent;
int descent;
- string const s = getScreenLabel();
-
- if (Editable()) {
- bv->painter().buttonText(0, 0, s, font,
- false, width, ascent, descent);
+ string const s = getScreenLabel(bv->buffer());
+
+ if (editable()) {
+ lyxfont::buttonText(s, font, width, ascent, descent);
} else {
- bv->painter().rectText(0, 0, s, font,
- LColor::commandbg, LColor::commandframe,
- false, width, ascent, descent);
+ lyxfont::rectText(s, font, width, ascent, descent);
}
+
return width + 4;
}
LyXFont font(LyXFont::ALL_SANE);
font.setColor(LColor::command).decSize();
- int width;
- string const s = getScreenLabel();
+ string const s = getScreenLabel(bv->buffer());
- if (Editable()) {
- pain.buttonText(int(x) + 2, baseline, s, font, true, width);
+ if (editable()) {
+ pain.buttonText(int(x) + 2, baseline, s, font);
} else {
pain.rectText(int(x) + 2, baseline, s, font,
- LColor::commandbg, LColor::commandframe,
- true, width);
+ LColor::commandbg, LColor::commandframe);
}
- x += width + 4;
+ x += width(bv, font);
}