28#include <TGUI/Widgets/TabsBase.hpp>
29#include <TGUI/Text.hpp>
43 class TGUI_API Tabs :
public TabsBase
47 using Ptr = std::shared_ptr<Tabs>;
59 explicit Tabs(
const char* typeName =
StaticWidgetType,
bool initRenderer =
true);
173 void mouseMoved(Vector2f pos)
override;
189 void recalculateTabsSize()
override;
194 TGUI_NODISCARD std::unique_ptr<DataIO::Node>
save(SavingRenderersMap& renderers)
const override;
199 void load(
const std::unique_ptr<DataIO::Node>& node,
const LoadingRenderersMap& renderers)
override;
209 float m_maximumTabWidth = 0;
210 float m_minimumTabWidth = 0;
211 bool m_autoSize =
true;
Base class for render targets.
Definition BackendRenderTarget.hpp:46
Class to store the position or size of a widget.
Definition Layout.hpp:321
void setAutoSize(bool autoSize)
Changes whether the tabs are auto-sized or not.
static constexpr const char StaticWidgetType[]
Type name of the widget.
Definition Tabs.hpp:50
static Tabs::Ptr create()
Creates a new tabs widget.
void draw(BackendRenderTarget &target, RenderStates states) const override
Draw the widget to a render target.
void load(const std::unique_ptr< DataIO::Node > &node, const LoadingRenderersMap &renderers) override
Loads the widget from a tree of nodes.
std::shared_ptr< const Tabs > ConstPtr
Shared constant widget pointer.
Definition Tabs.hpp:48
static Tabs::Ptr copy(const Tabs::ConstPtr &tab)
Makes a copy of another tab.
float getMinimumTabWidth() const
Returns the minimum tab width of the tabs.
void setMaximumTabWidth(float maximumWidth)
Changes the maximum tab width of the tabs.
std::shared_ptr< Tabs > Ptr
Shared widget pointer.
Definition Tabs.hpp:47
void setTabHeight(float height)
Changes the height of the tabs.
void setMinimumTabWidth(float minimumWidth)
Changes the minimum tab width of the tabs.
void setSize(const Layout2d &size) override
Changes the area used by the tabs.
Widget::Ptr clone() const override
Makes a copy of the widget if you don't know its exact type.
bool leftMousePressed(Vector2f pos) override
Called by the parent when the left mouse button goes down on top of the widget.
bool getAutoSize() const
Returns whether the tabs are auto-sized or not.
std::unique_ptr< DataIO::Node > save(SavingRenderersMap &renderers) const override
Saves the widget as a tree node in order to save it to a file.
float getMaximumTabWidth() const
Returns the maximum tab width of the tabs.
Namespace that contains all TGUI functions and classes.
Definition AbsoluteOrRelativeValue.hpp:36
States used for drawing.
Definition RenderStates.hpp:38