27#include <guichan/font.hpp>
33 setWidth(skin.getMinWidth() + 2 * skin.padding + skin.spacing + getFont()->getWidth(caption));
34 setHeight(skin.getMinHeight() + 2 * skin.padding);
47 skin.
draw(g, widgetState);
49 if (
auto skinState = skin.getState(widgetState.
flags))
51 auto &textFormat = skinState->textFormat;
52 g->drawText(getCaption(),
53 skin.getMinWidth() + skin.padding + skin.spacing,
56 textFormat.bold ?
boldFont : getFont(),
void mouseEntered(gcn::MouseEvent &event) override
Called when the mouse enteres the widget area.
CheckBox(const std::string &caption, bool selected=false)
void draw(gcn::Graphics *graphics) override
Draws the caption, then calls drawBox to draw the check box.
void mouseExited(gcn::MouseEvent &event) override
Called when the mouse leaves the widget area.
A central point of control for graphics.
Theme * getTheme() const
The global GUI theme.
void draw(Graphics *graphics, const WidgetState &state) const
const Skin & getSkin(SkinType skinType) const
gcn::Font * boldFont
Bolded text font.