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>
33#include <TGUI/Renderers/MessageBoxRenderer.hpp>
48 typedef std::shared_ptr<MessageBox>
Ptr;
49 typedef std::shared_ptr<const MessageBox>
ConstPtr;
59 MessageBox(
const char* typeName =
"MessageBox",
bool initRenderer =
true);
200 void load(
const std::unique_ptr<DataIO::Node>& node,
const LoadingRenderersMap& renderers)
override;
221 void identifyLabelAndButtons();
227 void connectButtonPressSignal(std::size_t buttonIndex);
242 std::vector<Button::Ptr> m_buttons;
Child window widget.
Definition: ChildWindow.hpp:44
std::shared_ptr< Label > Ptr
Shared widget pointer.
Definition: Label.hpp:47
static Label::Ptr create(String text="")
Creates a new label widget.
Definition: MessageBoxRenderer.hpp:37
Message box widget.
Definition: MessageBox.hpp:45
std::vector< String > getButtons() const
Returns the caption of the buttons.
void load(const std::unique_ptr< DataIO::Node > &node, const LoadingRenderersMap &renderers) override
Loads the widget from a tree of nodes.
void updateTextSize() override
Called when the text size is changed (either by setTextSize or via the renderer)
static MessageBox::Ptr create(String title="", String text="", std::vector< String > buttons={})
Creates a new message box widget.
MessageBox(MessageBox &©)
Move constructor.
MessageBox(const MessageBox ©)
Copy constructor.
void setText(const String &text)
Changes the text of the message box.
const String & getText() const
Returns the text of the message box.
Signal & getSignal(String signalName) override
Retrieves a signal based on its name.
MessageBoxRenderer * getRenderer()
Returns the renderer, which gives access to functions that determine how the widget is displayed.
void rendererChanged(const String &property) override
Function called when one of the properties of the renderer is changed.
MessageBoxRenderer * getSharedRenderer()
Returns the renderer, which gives access to functions that determine how the widget is displayed.
std::shared_ptr< MessageBox > Ptr
Shared widget pointer.
Definition: MessageBox.hpp:48
void addButton(const String &buttonCaption)
Adds a button to the message box.
std::shared_ptr< const MessageBox > ConstPtr
Shared constant widget pointer.
Definition: MessageBox.hpp:49
Widget::Ptr clone() const override
Makes a copy of the widget if you don't know its exact type.
static MessageBox::Ptr copy(MessageBox::ConstPtr messageBox)
Makes a copy of another message box.
Signal to which the user can subscribe to get callbacks from.
Definition: Signal.hpp:58
Wrapper class to store strings.
Definition: String.hpp:79
Namespace that contains all TGUI functions and classes.
Definition: AbsoluteOrRelativeValue.hpp:36