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; 
 
   61        void add(
const Widget::Ptr& widget, 
const sf::String& widgetName = 
"") 
override;
 
   71        void add(
const Widget::Ptr& widget, 
float ratio, 
const sf::String& widgetName = 
"");
 
   85        void insert(std::size_t index, 
const Widget::Ptr& widget, 
const sf::String& widgetName = 
"") 
override;
 
  101        void insert(std::size_t index, 
const Widget::Ptr& widget, 
float ratio, 
const sf::String& widgetName = 
"");
 
  196        std::unique_ptr<DataIO::Node> 
save(SavingRenderersMap& renderers) 
const override;
 
  202        void load(
const std::unique_ptr<DataIO::Node>& node, 
const LoadingRenderersMap& renderers) 
override;
 
  208        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.
 
void add(const Widget::Ptr &widget, const sf::String &widgetName="") override
Adds a widget at the end of the layout.
 
bool setRatio(std::size_t index, float ratio)
Changes the ratio of a widget at a certain index.
 
void insert(std::size_t index, const Widget::Ptr &widget, const sf::String &widgetName="") override
Inserts a widget to 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.
 
std::shared_ptr< BoxLayoutRatios > Ptr
Shared widget pointer.
Definition: BoxLayoutRatios.hpp:43
 
void add(const Widget::Ptr &widget, float ratio, const sf::String &widgetName="")
Adds a widget at the end of the layout.
 
void insert(std::size_t index, const Widget::Ptr &widget, float ratio, const sf::String &widgetName="")
Inserts a widget to the layout.
 
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
 
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.
 
Abstract class for box layout containers.
Definition: BoxLayout.hpp:41
 
bool remove(const Widget::Ptr &widget) override
Removes a single widget that was added to the container.
 
Class to store the position or size of a widget.
Definition: Layout.hpp:260
 
Namespace that contains all TGUI functions and classes.
Definition: AbsoluteOrRelativeValue.hpp:37