7 #include "button_inset.h"
8 #include "math_support.h"
9 #include "math_metricsinfo.h"
10 #include "frontends/Painter.h"
17 ButtonInset::ButtonInset()
22 void ButtonInset::metrics(MathMetricsInfo & mi) const
24 MathFontSetChanger dummy(mi.base, "textnormal");
26 MathNestInset::metrics(mi);
27 dim_.w = cell(0).width() + cell(1).width() + 4;
28 dim_.a = max(cell(0).ascent(), cell(1).ascent());
29 dim_.d = max(cell(0).descent(), cell(1).descent());
31 mathed_string_dim(mi.base.font, screenLabel(), dim_);
37 void ButtonInset::draw(MathPainterInfo & pi, int x, int y) const
39 MathFontSetChanger dummy(pi.base, "textnormal");
41 cell(0).draw(pi, x, y);
42 cell(1).draw(pi, x + cell(0).width() + 2, y);
43 mathed_draw_framebox(pi, x, y, this);
45 pi.pain.buttonText(x + 2, y, screenLabel(), pi.base.font);