3 #include "button_inset.h"
4 #include "math_support.h"
5 #include "math_metricsinfo.h"
6 #include "frontends/Painter.h"
13 ButtonInset::ButtonInset()
18 void ButtonInset::metrics(MathMetricsInfo & mi) const
20 MathFontSetChanger dummy(mi.base, "textnormal");
22 MathNestInset::metrics(mi);
23 dim_.w = cell(0).width() + cell(1).width() + 4;
24 dim_.a = max(cell(0).ascent(), cell(1).ascent());
25 dim_.d = max(cell(0).descent(), cell(1).descent());
27 mathed_string_dim(mi.base.font, screenLabel(), dim_);
33 void ButtonInset::draw(MathPainterInfo & pi, int x, int y) const
35 MathFontSetChanger dummy(pi.base, "textnormal");
37 cell(0).draw(pi, x, y);
38 cell(1).draw(pi, x + cell(0).width() + 2, y);
39 mathed_draw_framebox(pi, x, y, this);
41 pi.pain.buttonText(x + 2, y, screenLabel(), pi.base.font);