26 #ifndef TGUI_PANEL_HPP
27 #define TGUI_PANEL_HPP
30 #include <TGUI/Widgets/Group.hpp>
31 #include <TGUI/Renderers/PanelRenderer.hpp>
44 typedef std::shared_ptr<Panel>
Ptr;
133 void leftMousePressed(
Vector2f pos)
override;
138 void leftMouseReleased(
Vector2f pos)
override;
143 void rightMousePressed(
Vector2f pos)
override;
148 void rightMouseReleased(
Vector2f pos)
override;
153 void rightMouseButtonNoLongerDown()
override;
163 void draw(sf::RenderTarget& target, sf::RenderStates states)
const override;
195 return std::make_shared<Panel>(*
this);
202 SignalVector2f onMousePress = {
"MousePressed"};
203 SignalVector2f onMouseRelease = {
"MouseReleased"};
204 SignalVector2f onClick = {
"Clicked"};
206 SignalVector2f onRightMousePress = {
"RightMousePressed"};
207 SignalVector2f onRightMouseRelease = {
"RightMouseReleased"};
208 SignalVector2f onRightClick = {
"RightClicked"};
216 Color m_borderColorCached;
217 Color m_backgroundColorCached;
218 Sprite m_spriteBackground;
220 bool m_rightMouseDown =
false;
Wrapper for colors.
Definition: Color.hpp:49
Group widget.
Definition: Group.hpp:44
Class to store the position or size of a widget.
Definition: Layout.hpp:260
Definition: Outline.hpp:39
Definition: PanelRenderer.hpp:37
Group of widgets that has a background color and optional borders.
Definition: Panel.hpp:41
PanelRenderer * getSharedRenderer()
Returns the renderer, which gives access to functions that determine how the widget is displayed.
static Panel::Ptr copy(Panel::ConstPtr panel)
Makes a copy of another panel.
std::shared_ptr< Panel > Ptr
Shared widget pointer.
Definition: Panel.hpp:44
PanelRenderer * getRenderer()
Returns the renderer, which gives access to functions that determine how the widget is displayed.
Widget::Ptr clone() const override
Makes a copy of the widget if you don't know its exact type.
Definition: Panel.hpp:193
Vector2f getChildWidgetsOffset() const override
Returns the distance between the position of the container and a widget that would be drawn inside th...
void draw(sf::RenderTarget &target, sf::RenderStates states) const override
Draw the widget to a render target.
Vector2f getInnerSize() const override
Returns the space available for widgets inside the container.
void setSize(const Layout2d &size) override
Changes the size of the panel.
Panel(const Layout2d &size={"100%", "100%"})
Default constructor.
void rendererChanged(const std::string &property) override
Function called when one of the properties of the renderer is changed.
Signal & getSignal(std::string signalName) override
Retrieves a signal based on its name.
bool mouseOnWidget(Vector2f pos) const override
Returns whether the mouse position (which is relative to the parent widget) lies on top of the widget...
static Panel::Ptr create(Layout2d size={"100%", "100%"})
Creates a new panel widget.
std::shared_ptr< const Panel > ConstPtr
Shared constant widget pointer.
Definition: Panel.hpp:45
Signal to which the user can subscribe to get callbacks from.
Definition: Signal.hpp:231
Definition: Sprite.hpp:46
Definition: Vector2f.hpp:39
Namespace that contains all TGUI functions and classes.
Definition: AbsoluteOrRelativeValue.hpp:37