3 #include "button_inset.h"
4 #include "math_support.h"
5 #include "frontends/Painter.h"
12 ButtonInset::ButtonInset()
17 void ButtonInset::metrics(MathMetricsInfo & mi) const
19 MathFontSetChanger dummy(mi.base, "textnormal");
21 MathNestInset::metrics(mi);
22 width_ = xcell(0).width() + xcell(1).width() + 4;
23 ascent_ = max(xcell(0).ascent(), xcell(1).ascent());
24 descent_ = max(xcell(0).descent(), xcell(1).descent());
26 string s = screenLabel();
27 mathed_string_dim(mi.base.font,
28 s, ascent_, descent_, width_);
34 void ButtonInset::draw(MathPainterInfo & pi, int x, int y) const
36 MathFontSetChanger dummy(pi.base, "textnormal");
38 xcell(0).draw(pi, x, y);
39 xcell(1).draw(pi, x + xcell(0).width() + 2, y);
40 mathed_draw_framebox(pi, x, y, this);
42 pi.pain.buttonText(x + 2, y, screenLabel(),