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 dim_.w = xcell(0).width() + xcell(1).width() + 4;
23 dim_.a = max(xcell(0).ascent(), xcell(1).ascent());
24 dim_.d = max(xcell(0).descent(), xcell(1).descent());
26 mathed_string_dim(mi.base.font, screenLabel(), dim_);
32 void ButtonInset::draw(MathPainterInfo & pi, int x, int y) const
34 MathFontSetChanger dummy(pi.base, "textnormal");
36 xcell(0).draw(pi, x, y);
37 xcell(1).draw(pi, x + xcell(0).width() + 2, y);
38 mathed_draw_framebox(pi, x, y, this);
40 pi.pain.buttonText(x + 2, y, screenLabel(),