25#ifndef TGUI_BOX_LAYOUT_RATIOS_HPP
26#define TGUI_BOX_LAYOUT_RATIOS_HPP
28#include <TGUI/Widgets/BoxLayout.hpp>
32TGUI_MODULE_EXPORT
namespace tgui
42 using Ptr = std::shared_ptr<BoxLayoutRatios>;
43 using ConstPtr = std::shared_ptr<const BoxLayoutRatios>;
129 using BoxLayout::remove;
197 TGUI_NODISCARD
float getRatio(std::size_t index)
const;
205 TGUI_NODISCARD std::unique_ptr<DataIO::Node>
save(SavingRenderersMap& renderers)
const override;
210 void load(
const std::unique_ptr<DataIO::Node>& node,
const LoadingRenderersMap& renderers)
override;
215 std::vector<float> m_ratios;
Abstract class for box layout containers.
Definition BoxLayoutRatios.hpp:39
bool remove(std::size_t index) override
Removes a single widget that was added to the container.
float getRatio(const Widget::Ptr &widget) const
Returns the ratio of a widget at a certain index.
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(const Widget::Ptr &widget, float ratio)
Changes the ratio of a widget.
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:42
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.
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.
std::shared_ptr< const BoxLayoutRatios > ConstPtr
Shared constant widget pointer.
Definition BoxLayoutRatios.hpp:43
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:40
Wrapper class to store strings.
Definition String.hpp:96
Namespace that contains all TGUI functions and classes.
Definition AbsoluteOrRelativeValue.hpp:38