30 #ifndef Pt_Forms_Panel_H
31 #define Pt_Forms_Panel_H
33 #include <Pt/Forms/Control.h>
34 #include <Pt/Forms/Alignment.h>
35 #include <Pt/Forms/Icon.h>
36 #include <Pt/Forms/PixmapSurface.h>
37 #include <Pt/Gfx/Color.h>
38 #include <Pt/Gfx/Brush.h>
39 #include <Pt/SmartPtr.h>
45 class PT_FORMS_API Panel :
public Control
54 void setIcon(
const Icon& icon,
const Gfx::SizeF& iconSize, Alignment align = Alignment::Center);
56 Control* content()
const;
58 void setContent(Control* control);
61 const Gfx::Brush* background()
const;
63 void setBackground(
const Gfx::Brush& b);
65 void setBackground(
bool b);
67 const Gfx::Pen* contour()
const;
69 void setContour(
const Gfx::Pen& pen);
71 void setFrame(
bool b);
73 void setRenderer(PanelRenderer* renderer);
76 virtual void onRemoveControl(Control& control);
78 virtual void onInvalidate();
80 virtual Gfx::SizeF onMeasure(
const SizePolicy& policy);
82 virtual void onLayout(
const Gfx::RectF& rect);
84 virtual void onPaint(PaintSurface& surface,
const Gfx::RectF& updateRect);
86 virtual void onPaintContent(PaintSurface& surface, Gfx::Painter& painter);
91 FacetPtr<PanelRenderer> _renderer;
94 AutoPtr<Gfx::Brush> _background;
97 AutoPtr<Gfx::Pen> _contour;
101 Gfx::SizeF _iconSize;
102 PixmapSurface _picture;
103 Alignment _imageAlignment;