26#ifndef TGUI_MESSAGE_BOX_HPP
27#define TGUI_MESSAGE_BOX_HPP
30#include <TGUI/Widgets/Label.hpp>
31#include <TGUI/Widgets/Button.hpp>
32#include <TGUI/Widgets/ChildWindow.hpp>
38 class MessageBoxRenderer;
55 typedef std::shared_ptr<MessageBox>
Ptr;
56 typedef std::shared_ptr<const MessageBox>
ConstPtr;
113 return std::static_pointer_cast<MessageBoxRenderer>(m_renderer);
148 return m_label->getText();
208 virtual void reload(
const std::string& primary =
"",
const std::string& secondary =
"",
bool force =
false)
override;
216 return std::make_shared<MessageBox>(*
this);
223 std::string m_loadedThemeFile;
224 std::string m_buttonClassName;
226 std::vector<Button::Ptr> m_buttons;
228 Label::Ptr m_label = std::make_shared<Label>();
230 unsigned int m_textSize = 16;
261 virtual void setProperty(std::string property,
const std::string& value)
override;
314 virtual std::shared_ptr<WidgetRenderer> clone(
Widget* widget)
override;
Definition: ChildWindow.hpp:587
Child window widget.
Definition: ChildWindow.hpp:61
Implicit converter for colors.
Definition: Color.hpp:40
std::shared_ptr< Label > Ptr
Shared widget pointer.
Definition: Label.hpp:53
Definition: MessageBox.hpp:239
virtual std::map< std::string, ObjectConverter > getPropertyValuePairs() const override
Get a map with all properties and their values.
virtual void setProperty(std::string property, const std::string &value) override
Change a property of the renderer.
virtual void setProperty(std::string property, ObjectConverter &&value) override
Change a property of the renderer.
virtual ObjectConverter getProperty(std::string property) const override
Retrieve the value of a certain property.
MessageBoxRenderer(MessageBox *messageBox)
Constructor.
Definition: MessageBox.hpp:248
void setTextColor(const Color &color)
Changes the color of the text.
Message box widget.
Definition: MessageBox.hpp:52
static MessageBox::Ptr create()
Creates a new message box widget.
virtual void reload(const std::string &primary="", const std::string &secondary="", bool force=false) override
Reload the widget.
sf::String getText() const
Return the text of the message box.
Definition: MessageBox.hpp:146
unsigned int getTextSize() const
Returns the size of the text.
Definition: MessageBox.hpp:169
MessageBox(const MessageBox ©)
Copy constructor.
void setText(const sf::String &text)
Change the text of the message box.
virtual void setFont(const Font &font) override
Changes the font of the text in the widget and its children.
virtual Widget::Ptr clone() const override
Makes a copy of the widget if you don't know its exact type.
Definition: MessageBox.hpp:214
std::shared_ptr< MessageBox > Ptr
Shared widget pointer.
Definition: MessageBox.hpp:55
void setTextSize(unsigned int size)
Changes the character size of the text.
std::shared_ptr< const MessageBox > ConstPtr
Shared constant widget pointer.
Definition: MessageBox.hpp:56
std::shared_ptr< MessageBoxRenderer > getRenderer() const
Returns the renderer, which gives access to functions that determine how the widget is displayed.
Definition: MessageBox.hpp:111
void addButton(const sf::String &buttonCaption)
Add a button to the message box.
static MessageBox::Ptr copy(MessageBox::ConstPtr messageBox)
Makes a copy of another message box.
Implicit converter for settable properties.
Definition: ObjectConverter.hpp:43
Namespace that contains all TGUI functions and classes.
Definition: Animation.hpp:34