29 #ifndef Pt_Forms_TabView_H
30 #define Pt_Forms_TabView_H
32 #include <Pt/Forms/Control.h>
33 #include <Pt/Forms/TabViewStyle.h>
34 #include <Pt/Forms/StackLayout.h>
35 #include <Pt/Signal.h>
58 void setText(
const String& s)
68 {
return _measuredSize; }
71 { _measuredSize = s; }
79 bool isPressed()
const
80 {
return _isPressed; }
82 void setPressed(
bool b)
95 class PT_FORMS_API
TabView :
public Control
107 std::size_t size()
const;
109 void addTab(Control& control,
const Pt::String& title);
111 void removeTab(std::size_t n);
113 std::size_t current()
const;
115 void setCurrent(std::size_t n);
117 void setText(std::size_t n,
const Pt::String& title);
122 void setBackground(
bool enable);
126 void setFrame(
bool enable);
130 void setFontSize(std::size_t size);
142 void setRenderer(TabViewRenderer* renderer);
145 virtual void onProcessMouseEvent(
const MouseEvent& ev);
147 virtual void onProcessTouchEvent(
const TouchEvent& ev);
149 virtual void onInvalidate();
151 virtual Gfx::SizeF onMeasure(
const SizePolicy& policy);
153 virtual void onLayout(
const Gfx::RectF& rect);
159 const TabViewState& state);
164 const TabViewState& state);
170 TabViewRenderer& renderer);
173 TabViewRenderer& renderer,
177 TabViewRenderer& renderer,
181 TabViewRenderer& renderer,
185 const TabViewItemState& state);
189 void onControlRemoved(std::size_t n);
192 std::vector<TabViewItem> _tabs;
193 std::size_t _current;
196 TabViewStyle _tabViewStyle;
197 TabViewStyleOptions _tabViewOptions;
Core module.
Definition: Allocator.h:33
Attributes for the drawing of outlines.
Definition: Pen.h:54
Slant
Describes the requested font slant.
Definition: Font.h:76
Paint context.
Definition: PaintContext.h:45
Size with floating-point width and height.
Definition: Size.h:47
Point with floating-point X and Y coordinates.
Definition: Point.h:47
Weight
Describes the requested font weight.
Definition: Font.h:61
Font request used for text drawing and measurement.
Definition: Font.h:56
Standard color type.
Definition: Color.h:47
Unicode capable basic_string.
Definition: Api-String.h:44
Fill description for shapes and text.
Definition: Brush.h:145
Rect with floating-point coordinates.
Definition: Rect.h:47