29 #ifndef PT_FORMS_CANVASLAYOUT_H
30 #define PT_FORMS_CANVASLAYOUT_H
32 #include <Pt/Forms/Layout.h>
33 #include <Pt/Gfx/Point.h>
34 #include <Pt/Gfx/Size.h>
41 class PT_FORMS_API CanvasLayout :
public Layout
52 LayoutParams(
const Gfx::PointF& pos,
53 const Gfx::SizeF& size)
58 const Gfx::PointF& position()
const
61 const Gfx::SizeF& size()
const
72 virtual ~CanvasLayout();
74 void addItem(Control& control,
const LayoutParams& params);
76 void addItem(Control& control,
77 const Gfx::PointF& pos,
78 const Gfx::SizeF& size);
80 void removeItem(Control& control);
83 virtual void onRemoveControl(Control& control);
85 virtual Gfx::SizeF onMeasure(
const SizePolicy& policy);
87 virtual void onLayout(
const Gfx::RectF& rect);
90 typedef std::map<Control*, LayoutParams> ItemMap;
92 std::map<Control*, LayoutParams> _items;