26#ifndef TGUI_BOX_LAYOUT_RATIOS_HPP
27#define TGUI_BOX_LAYOUT_RATIOS_HPP
29#include <TGUI/Widgets/BoxLayout.hpp>
43 typedef std::shared_ptr<BoxLayoutRatios>
Ptr;
44 typedef std::shared_ptr<const BoxLayoutRatios>
ConstPtr;
116 using BoxLayout::remove;
200 std::unique_ptr<DataIO::Node>
save(SavingRenderersMap& renderers)
const override;
206 void load(
const std::unique_ptr<DataIO::Node>& node,
const LoadingRenderersMap& renderers)
override;
212 std::vector<float> m_ratios;
Abstract class for box layout containers.
Definition BoxLayoutRatios.hpp:40
bool remove(std::size_t index) override
Removes a single widget that was added to the container.
bool setRatio(std::size_t index, float ratio)
Changes the ratio of a widget at a certain index.
void add(const Widget::Ptr &widget, float ratio, const String &widgetName="")
Adds a widget at the end of the layout.
bool setRatio(Widget::Ptr widget, float ratio)
Changes the ratio of a widget.
float getRatio(Widget::Ptr widget) const
Returns the ratio of a widget at a certain index.
void insert(std::size_t index, const Widget::Ptr &widget, const String &widgetName="") override
Inserts a widget to the layout.
std::shared_ptr< BoxLayoutRatios > Ptr
Shared widget pointer.
Definition BoxLayoutRatios.hpp:43
void load(const std::unique_ptr< DataIO::Node > &node, const LoadingRenderersMap &renderers) override
Loads the widget from a tree of nodes.
void removeAllWidgets() override
Removes all widgets that were added to the container.
void addSpace(float ratio)
Add an extra space after the last widget.
std::shared_ptr< const BoxLayoutRatios > ConstPtr
Shared constant widget pointer.
Definition BoxLayoutRatios.hpp:44
void insert(std::size_t index, const Widget::Ptr &widget, float ratio, const String &widgetName="")
Inserts a widget to the layout.
float getRatio(std::size_t index) const
Returns the ratio of a widget at a certain index.
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.
void insertSpace(std::size_t index, float ratio)
Insert an extra space between widgets.
void add(const Widget::Ptr &widget, const String &widgetName="") override
Adds a widget at the end of the layout.
Abstract class for box layout containers.
Definition BoxLayout.hpp:41
Wrapper class to store strings.
Definition String.hpp:79
Namespace that contains all TGUI functions and classes.
Definition AbsoluteOrRelativeValue.hpp:36