2 #include "button_inset.h"
3 #include "math_support.h"
4 #include "frontends/Painter.h"
7 ButtonInset::ButtonInset()
12 void ButtonInset::metrics(MathMetricsInfo & mi) const
14 MathFontSetChanger dummy(mi.base, "textnormal");
16 MathNestInset::metrics(mi);
17 width_ = xcell(0).width() + xcell(1).width() + 4;
18 ascent_ = max(xcell(0).ascent(), xcell(1).ascent());
19 descent_ = max(xcell(0).descent(), xcell(1).descent());
21 string s = screenLabel();
22 mathed_string_dim(mi.base.font,
23 s, ascent_, descent_, width_);
29 void ButtonInset::draw(MathPainterInfo & pi, int x, int y) const
31 MathFontSetChanger dummy(pi.base, "textnormal");
33 xcell(0).draw(pi, x, y);
34 xcell(1).draw(pi, x + xcell(0).width() + 2, y);
35 mathed_draw_framebox(pi, x, y, this);
37 pi.pain.buttonText(x + 2, y, screenLabel(),