2 * \file render_button.C
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Angus Leeming
8 * Full author contact details are available in file CREDITS.
13 #include "render_button.h"
16 #include "metricsinfo.h"
18 #include "frontends/font_metrics.h"
19 #include "frontends/Painter.h"
24 RenderButton::RenderButton()
29 RenderBase * RenderButton::clone() const
31 return new RenderButton(*this);
35 void RenderButton::update(string const & text, bool editable)
42 void RenderButton::metrics(MetricsInfo &, Dimension & dim) const
44 LyXFont font(LyXFont::ALL_SANE);
48 font_metrics::buttonText(text_, font, dim.wid, dim.asc, dim.des);
50 font_metrics::rectText(text_, font, dim.wid, dim.asc, dim.des);
56 void RenderButton::draw(PainterInfo & pi, int x, int y) const
58 // Draw it as a box with the LaTeX text
59 LyXFont font(LyXFont::ALL_SANE);
60 font.setColor(LColor::command);
64 pi.pain.buttonText(x + 2, y, text_, font);
66 pi.pain.rectText(x + 2, y, text_, font,
67 LColor::commandbg, LColor::commandframe);