31 #ifndef Pt_Forms_CheckBox_h
32 #define Pt_Forms_CheckBox_h
34 #include <Pt/Forms/Button.h>
35 #include <Pt/SmartPtr.h>
41 class PT_FORMS_API CheckBox :
public Button
61 void setState(State s);
63 bool isChecked()
const;
66 const Gfx::Brush& background()
const;
68 void setBackground(
const Gfx::Brush& b);
70 const Gfx::Pen& contour()
const;
72 void setContour(
const Gfx::Pen& p);
74 const Gfx::Color& textColor()
const;
76 void setTextColor(
const Gfx::Color& color);
78 const Gfx::Font& font()
const;
80 void setFont(
const Gfx::Font& font);
82 void setFontSize(std::size_t size);
84 void setFontWeight(Gfx::Font::Weight weight);
86 void setFontSlant(Gfx::Font::Slant slant);
88 void setRenderer(CheckBoxRenderer* renderer);
91 virtual Gfx::SizeF onMeasure(
const SizePolicy& policy);
93 virtual void onInvalidate();
95 virtual void onPressed();
97 virtual void onReleased();
99 virtual void onCanceled();
102 virtual void onPaint(PaintSurface& surface,
const Gfx::RectF& updateRect);
105 Gfx::Font getFont()
const;
108 enum FontOverride :
unsigned
111 OverrideWeight = 0x02,
112 OverrideSlant = 0x04,
118 FacetPtr<CheckBoxRenderer> _renderer;
121 AutoPtr<Gfx::Brush> _background;
122 AutoPtr<Gfx::Pen> _contour;
123 AutoPtr<Gfx::Color> _textColor;
124 Gfx::Font _customFont;
125 unsigned _fontOverride;