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> 35 #undef MessageBox // Windows.h defines MessageBox when NOMB isn't defined before including Windows.h 48 typedef std::shared_ptr<MessageBox>
Ptr;
49 typedef std::shared_ptr<const MessageBox>
ConstPtr;
67 static MessageBox::Ptr create(sf::String title =
"", sf::String text =
"", std::vector<sf::String> buttons = {});
130 void setText(
const sf::String& text);
139 const sf::String& getText()
const;
150 void setTextSize(
unsigned int size);
159 unsigned int getTextSize()
const;
171 void addButton(
const sf::String& buttonCaption);
180 std::vector<sf::String> getButtons()
const;
201 Signal& getSignal(std::string signalName)
override;
210 void rendererChanged(
const std::string& property)
override;
216 std::unique_ptr<DataIO::Node> save(SavingRenderersMap& renderers)
const override;
222 void load(
const std::unique_ptr<DataIO::Node>& node,
const LoadingRenderersMap& renderers)
override;
230 return std::make_shared<MessageBox>(*this);
240 void identifyLabelAndButtons();
246 SignalString onButtonPress = {
"ButtonPressed"};
252 std::string m_loadedThemeFile;
253 std::string m_buttonClassName;
255 std::vector<Button::Ptr> m_buttons;
259 unsigned int m_textSize = 16;
267 #endif // TGUI_MESSAGE_BOX_HPP Namespace that contains all TGUI functions and classes.
Definition: AbsoluteOrRelativeValue.hpp:36
Definition: MessageBoxRenderer.hpp:36
static Label::Ptr create(sf::String text="")
Creates a new label widget.
Child window widget.
Definition: ChildWindow.hpp:43
Widget::Ptr clone() const override
Makes a copy of the widget if you don't know its exact type.
Definition: MessageBox.hpp:228
std::shared_ptr< const MessageBox > ConstPtr
Shared constant widget pointer.
Definition: MessageBox.hpp:49
std::shared_ptr< Label > Ptr
Shared widget pointer.
Definition: Label.hpp:47
Signal to which the user can subscribe to get callbacks from.
Definition: Signal.hpp:59
std::shared_ptr< MessageBox > Ptr
Shared widget pointer.
Definition: MessageBox.hpp:48
Message box widget.
Definition: MessageBox.hpp:44