30 #ifndef Pt_Forms_ProgressBar_H
31 #define Pt_Forms_ProgressBar_H
33 #include <Pt/Forms/Control.h>
34 #include <Pt/SmartPtr.h>
35 #include <Pt/Signal.h>
41 class PT_FORMS_API ProgressBar :
public Control
49 virtual ~ProgressBar();
55 void setRange(
int minpos,
int maxpos);
61 float progress()
const;
65 Signal<int>& valueChanged();
68 const Gfx::Brush& background()
const;
70 void setBackground(
const Gfx::Brush& b);
72 const Gfx::Color& foreground()
const;
74 void setForeground(
const Gfx::Color& b);
76 const Gfx::Pen& contour()
const;
78 void setContour(
const Gfx::Pen& p);
80 const Gfx::Color& textColor()
const;
82 void setTextColor(
const Gfx::Color& color);
84 const Gfx::Font& font()
const;
86 void setFont(
const Gfx::Font& font);
88 void setFontSize(std::size_t size);
90 void setFontWeight(Gfx::Font::Weight weight);
92 void setFontSlant(Gfx::Font::Slant slant);
94 void setRenderer(ProgressBarRenderer* renderer);
97 virtual Gfx::SizeF onMeasure(
const SizePolicy& policy);
99 virtual void onInvalidate();
101 virtual void onPaint(PaintSurface& surface,
const Gfx::RectF& updateRect);
104 Gfx::Font getFont()
const;
107 enum FontOverride :
unsigned
110 OverrideWeight = 0x02,
111 OverrideSlant = 0x04,
115 Signal<int> _valueChanged;
120 AutoPtr<Gfx::Brush> _background;
121 AutoPtr<Gfx::Color> _foreground;
122 AutoPtr<Gfx::Pen> _contour;
123 AutoPtr<Gfx::Color> _textColor;
124 Gfx::Font _customFont;
125 unsigned _fontOverride;
127 FacetPtr<ProgressBarRenderer> _renderer;
130 Gfx::Brush _backgroundBrush;
131 Gfx::Brush _foregroundBrush;
132 Gfx::Pen _contourPen;