29 #ifndef Pt_Forms_TabView_H
30 #define Pt_Forms_TabView_H
32 #include <Pt/Forms/Control.h>
33 #include <Pt/Forms/StackLayout.h>
34 #include <Pt/Forms/DockingLayout.h>
35 #include <Pt/SmartPtr.h>
36 #include <Pt/Signal.h>
57 void setText(
const String& s)
66 bool isPressed()
const
67 {
return _isPressed; }
69 void setPressed(
bool b)
80 class PT_FORMS_API
TabBar :
public Control
92 std::size_t size()
const;
96 void removeTab(std::size_t n);
98 std::size_t current()
const;
100 void setCurrent(std::size_t n);
102 void setText(std::size_t n,
const Pt::String& title);
105 {
return _currentChanged; }
108 void setRenderer(TabViewRenderer* renderer);
111 virtual void onInvalidate();
113 virtual Gfx::SizeF onMeasure(
const SizePolicy& policy);
115 virtual void onLayout(
const Gfx::RectF& rect);
120 virtual bool onMouseEvent(
const MouseEvent& ev);
122 virtual bool onTouchEvent(
const TouchEvent& ev);
126 std::vector<TabItem> _tabs;
127 std::size_t _current;
129 FacetPtr<TabViewRenderer> _renderer;
132 Gfx::Brush _backgroundBrush;
133 Gfx::Brush _foregroundBrush;
144 typedef Control Base;
153 std::size_t size()
const;
155 void addTab(Control& control,
const Pt::String& title);
157 void removeTab(std::size_t n);
159 std::size_t current()
const;
161 void setCurrent(std::size_t n);
163 void setText(std::size_t n,
const Pt::String& title);
166 void setRenderer(TabViewRenderer* renderer);
169 virtual void onInvalidate();
171 virtual Gfx::SizeF onMeasure(
const SizePolicy& policy);
173 virtual void onLayout(
const Gfx::RectF& rect);
178 DockingLayout _layout;
182 FacetPtr<TabViewRenderer> _renderer;
185 Gfx::Brush _backgroundBrush;
186 Gfx::Brush _foregroundBrush;
Rect with floating-point coordinates.
Definition: Rect.h:44
Attributes for the drawing of outlines.
Definition: Pen.h:52
Size with floating-point width and height.
Definition: Size.h:44
Unicode capable basic_string.
Definition: String.h:42