30 #ifndef Pt_Forms_ScrollLayout_H
31 #define Pt_Forms_ScrollLayout_H
33 #include <Pt/Forms/Api.h>
34 #include <Pt/Forms/Layout.h>
35 #include <Pt/Forms/ScrollBar.h>
41 class PT_FORMS_API ScrollLayout :
public Layout
48 virtual ~ScrollLayout();
50 void enableScrolling(
bool scrollX,
bool scrollY);
52 double maximumX()
const;
54 double maximumY()
const;
56 void scrollX(
double xpos);
58 void scrollY(
double ypos);
60 double scrollPosX()
const;
62 double scrollPosY()
const;
68 void addItem(Control& control);
70 void removeItem(Control& control);
72 void setContentMode(SizePolicy::Mode hmode, SizePolicy::Mode vmode);
75 virtual Gfx::SizeF onMeasure(
const SizePolicy& policy);
77 virtual void onLayout(
const Gfx::RectF& rect);
80 virtual bool onMouseEvent(
const MouseEvent& ev);
82 virtual bool onTouchEvent(
const TouchEvent& ev);
84 virtual bool onScrollEvent(
const ScrollEvent& ev);
89 SizePolicy::Mode _hmode;
90 SizePolicy::Mode _vmode;
91 Gfx::PointF _scrollPos;
104 #endif // include guard