4 #include "button_inset.h"
5 #include "math_support.h"
6 #include "math_metricsinfo.h"
7 #include "frontends/Painter.h"
14 ButtonInset::ButtonInset()
19 void ButtonInset::metrics(MathMetricsInfo & mi) const
21 MathFontSetChanger dummy(mi.base, "textnormal");
23 MathNestInset::metrics(mi);
24 dim_.w = cell(0).width() + cell(1).width() + 4;
25 dim_.a = max(cell(0).ascent(), cell(1).ascent());
26 dim_.d = max(cell(0).descent(), cell(1).descent());
28 mathed_string_dim(mi.base.font, screenLabel(), dim_);
34 void ButtonInset::draw(MathPainterInfo & pi, int x, int y) const
36 MathFontSetChanger dummy(pi.base, "textnormal");
38 cell(0).draw(pi, x, y);
39 cell(1).draw(pi, x + cell(0).width() + 2, y);
40 mathed_draw_framebox(pi, x, y, this);
42 pi.pain.buttonText(x + 2, y, screenLabel(), pi.base.font);