26#ifndef TGUI_BOX_LAYOUT_HPP
27#define TGUI_BOX_LAYOUT_HPP
29#include <TGUI/Widgets/Panel.hpp>
43 typedef std::shared_ptr<BoxLayout>
Ptr;
44 typedef std::shared_ptr<const BoxLayout>
ConstPtr;
290 virtual void updateWidgetPositions() = 0;
296 virtual void draw(sf::RenderTarget& target, sf::RenderStates states)
const override;
Abstract class for box layout containers.
Definition: BoxLayout.hpp:40
float getFixedSize(const Widget::Ptr &widget)
Returns the size of a widget when it has a constant value.
std::shared_ptr< BoxLayout > Ptr
Shared widget pointer.
Definition: BoxLayout.hpp:43
bool insertSpace(std::size_t index, float ratio=1)
Insert a space to the layout and immediately set its ratio.
bool setFixedSize(const Widget::Ptr &widget, float size)
Set the size of a widget to a constant value.
float getRatio(const Widget::Ptr &widget)
Returns the ratio of a widget.
std::vector< float > m_widgetsFixedSizes
The fixed size for each widget. 0 means a variable size.
Definition: BoxLayout.hpp:303
bool remove(const tgui::Widget::Ptr &widget) override
Removes a single widget that was added to the container.
bool insert(std::size_t index, const tgui::Widget::Ptr &widget, const sf::String &widgetName="")
Insert a widget to the layout.
BoxLayout()
Default constructor.
virtual void setFont(const Font &font) override
Changes the font the child widgets.
void removeAllWidgets() override
Removes all widgets that were added to the container.
float getRatio(std::size_t index)
Returns the ratio of a widget.
bool setRatio(const Widget::Ptr &widget, float ratio)
Change the ratio of a widget.
Widget::Ptr get(std::size_t index)
Returns the widget at the given index in the layout.
bool setRatio(std::size_t index, float ratio)
Change the ratio of a widget. The ratio is the size that will have a widget relatively to others....
float getFixedSize(std::size_t index)
Returns the size of a widget when it has a constant value.
std::vector< float > m_widgetsRatio
The ratio of each widget.
Definition: BoxLayout.hpp:302
bool setFixedSize(std::size_t index, float size)
Set the size of a widget to a constant value.
void addSpace(float ratio=1)
Adds a space at the end of the layout and immediately set its ratio.
void add(const tgui::Widget::Ptr &widget, const sf::String &widgetName="") override
Adds a widget at the end of the layout.
std::shared_ptr< const BoxLayout > ConstPtr
Shared constant widget pointer.
Definition: BoxLayout.hpp:44
virtual void setSize(const Layout2d &size) override
Changes the size of the layout.
bool remove(std::size_t index)
Removes a single widget that was added to the container.
Class to store the position or size of a widget.
Definition: Layout.hpp:255
Panel widget.
Definition: Panel.hpp:61
Namespace that contains all TGUI functions and classes.
Definition: Animation.hpp:34