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);
211 std::unique_ptr<DataIO::Node>
save(SavingRenderersMap& renderers)
const override;
217 void load(
const std::unique_ptr<DataIO::Node>& node,
const LoadingRenderersMap& renderers)
override;
225 return std::make_shared<MessageBox>(*
this);
235 void identifyLabelAndButtons();
241 void connectButtonPressSignal(std::size_t buttonIndex);
256 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
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 setTextSize(unsigned int size) override
Changes the character size of the text.
static MessageBox::Ptr create(String title="", String text="", std::vector< String > buttons={})
Creates a new message box widget.
std::unique_ptr< DataIO::Node > save(SavingRenderersMap &renderers) const override
Saves the widget as a tree node in order to save it to a file.
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.
Definition MessageBox.hpp:223
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