30#include <TGUI/Container.hpp>
64 typedef std::shared_ptr<Panel>
Ptr;
117 return std::static_pointer_cast<PanelRenderer>(m_renderer);
129 m_backgroundColor = backgroundColor;
141 return m_backgroundColor;
148 virtual bool mouseOnWidget(
float x,
float y)
const override;
153 virtual void leftMousePressed(
float x,
float y)
override;
158 virtual void leftMouseReleased(
float x,
float y)
override;
169 return std::make_shared<Panel>(*
this);
176 virtual void draw(sf::RenderTarget& target, sf::RenderStates states)
const override;
182 sf::Color m_backgroundColor = {220, 220, 220};
187 friend class PanelRenderer;
216 virtual void setProperty(std::string property,
const std::string& value)
override;
282 virtual std::shared_ptr<WidgetRenderer> clone(
Widget* widget)
override;
290 sf::Color m_borderColor;
Implicit converter for colors.
Definition: Color.hpp:40
Container widget.
Definition: Container.hpp:48
Class to store the position or size of a widget.
Definition: Layout.hpp:255
Class to store the left, top, width or height of a widget.
Definition: Layout.hpp:121
Implicit converter for settable properties.
Definition: ObjectConverter.hpp:43
Definition: Panel.hpp:195
virtual std::map< std::string, ObjectConverter > getPropertyValuePairs() const override
Get a map with all properties and their values.
PanelRenderer(Panel *panel)
Constructor.
Definition: Panel.hpp:204
void setBorderColor(const Color &color)
Changes the color of the borders.
virtual ObjectConverter getProperty(std::string property) const override
Retrieve the value of a certain property.
virtual void setProperty(std::string property, ObjectConverter &&value) override
Change a property of the renderer.
virtual void setProperty(std::string property, const std::string &value) override
Change a property of the renderer.
void setBackgroundColor(const Color &color)
Changes the background color of the panel.
Panel widget.
Definition: Panel.hpp:61
Panel(const Layout &width, const Layout &height)
Constructor.
static Panel::Ptr copy(Panel::ConstPtr panel)
Makes a copy of another panel.
std::shared_ptr< Panel > Ptr
Shared widget pointer.
Definition: Panel.hpp:64
static Panel::Ptr create(Layout2d size={100, 100})
Creates a new panel widget.
Panel(const Layout2d &size={100, 100})
Default constructor.
std::shared_ptr< PanelRenderer > getRenderer() const
Returns the renderer, which gives access to functions that determine how the widget is displayed.
Definition: Panel.hpp:115
virtual Widget::Ptr clone() const override
Makes a copy of the widget if you don't know its exact type.
Definition: Panel.hpp:167
const sf::Color & getBackgroundColor() const
Returns the background color of the panel.
Definition: Panel.hpp:139
std::shared_ptr< const Panel > ConstPtr
Shared constant widget pointer.
Definition: Panel.hpp:65
void setBackgroundColor(const Color &backgroundColor)
Changes the background color of the panel.
Definition: Panel.hpp:127
Namespace that contains all TGUI functions and classes.
Definition: Animation.hpp:34