26#ifndef TGUI_TAB_CONTAINER_HPP
27#define TGUI_TAB_CONTAINER_HPP
30#include <TGUI/SubwidgetContainer.hpp>
31#include <TGUI/Widgets/Tabs.hpp>
32#include <TGUI/Widgets/Panel.hpp>
48 typedef std::shared_ptr<TabContainer>
Ptr;
49 typedef std::shared_ptr<const TabContainer>
ConstPtr;
59 TabContainer(
const char* typeName =
"TabContainer",
bool initRenderer =
true);
102 using SubwidgetContainer::setSize;
160#ifndef TGUI_REMOVE_DEPRECATED_CODE
168 TGUI_DEPRECATED(
"Use addTab instead") void addPanel(
Panel::
Ptr ptr, const
String& name,
bool select = true);
180 TGUI_DEPRECATED("Use insertTab instead")
bool insertPanel(
Panel::
Ptr ptr, const
String& name, std::
size_t index,
bool select = true);
188 TGUI_DEPRECATED("Use removeTab instead")
void removePanel(
Panel::
Ptr ptr);
197 void select(std::size_t index,
bool genEvents =
true);
278 return std::make_shared<TabContainer>(*
this);
285 void load(
const std::unique_ptr<DataIO::Node>& node,
const LoadingRenderersMap& renderers)
override;
309 std::vector<Panel::Ptr> m_panels;
Class to store the position or size of a widget.
Definition Layout.hpp:262
Class to store the left, top, width or height of a widget.
Definition Layout.hpp:50
Group of widgets that has a background color and optional borders.
Definition Panel.hpp:41
std::shared_ptr< Panel > Ptr
Shared widget pointer.
Definition Panel.hpp:44
Signal to which the user can subscribe to get callbacks from.
Definition Signal.hpp:371
Wrapper class to store strings.
Definition String.hpp:79
TabContainer widget.
Definition TabContainer.hpp:45
std::shared_ptr< const TabContainer > ConstPtr
Shared constant widget pointer.
Definition TabContainer.hpp:49
bool changeTabText(std::size_t index, const String &text)
Changes the text of one of the tabs.
Panel::Ptr getPanel(int index)
Returns the panel with given index.
int getSelectedIndex() const
Returns index of the selected panel.
TabsRenderer * getTabsRenderer()
Returns the renderer of tabs part of widget.
Tabs::Ptr getTabs()
Returns internal tabs widget.
bool removeTab(std::size_t index)
Removes a tab and its corresponding panel with a given index.
std::size_t getPanelCount() const
Returns the number of holded panels.
String getTabText(std::size_t index) const
Gets the text of one of the tabs.
static TabContainer::Ptr create(const Layout2d &size={ "100%", "100%" })
Creates a new tab container widget.
TabsRenderer * getTabsSharedRenderer()
Returns the renderer of tabs part of widget.
Panel::Ptr addTab(const String &name, bool select=true)
Adds a new tab and corresponding panel.
Panel::Ptr getSelected()
Returns the selected panel or nullptr.
Widget::Ptr clone() const override
Makes a copy of the widget if you don't know its exact type.
Definition TabContainer.hpp:276
bool removeTab(const String &text)
Removes a tab and its corresponding panel, given the text of the tab.
void load(const std::unique_ptr< DataIO::Node > &node, const LoadingRenderersMap &renderers) override
Loads the widget from a tree of nodes.
Panel::Ptr insertTab(std::size_t index, const String &name, bool select=true)
Inserts a new tab and panel somewhere between the existing ones.
static TabContainer::Ptr copy(TabContainer::ConstPtr tabContainer)
Makes a copy of another tab container.
int getIndex(Panel::Ptr ptr)
Returns index of the specified panel.
void setSize(const Layout2d &size) override
Changes the size of the tab container.
void select(std::size_t index, bool genEvents=true)
Sets selection to panel.
void setTabsHeight(Layout height)
Changes the height of tabs part of the widget.
std::shared_ptr< TabContainer > Ptr
Shared widget pointer.
Definition TabContainer.hpp:48
Definition TabsRenderer.hpp:37
std::shared_ptr< Tabs > Ptr
Shared widget pointer.
Definition Tabs.hpp:48
Namespace that contains all TGUI functions and classes.
Definition AbsoluteOrRelativeValue.hpp:36