26#ifndef TGUI_WINDOW_HPP
27#define TGUI_WINDOW_HPP
32#include <TGUI/Container.hpp>
63 Gui(sf::RenderWindow& window);
74 Gui(sf::RenderTarget& window);
80 Gui(
const Gui& copy) =
delete;
86 Gui& operator=(
const Gui& right) =
delete;
197 m_container->setFont(font);
209 return m_container->getFont();
221 return m_container->getWidgets();
233 return m_container->getWidgetNames();
295 typename T::Ptr
get(
const sf::String& widgetName,
bool recursive =
false)
const
297 return m_container->get<T>(widgetName, recursive);
452 void updateTime(
const sf::Time& elapsedTime);
462 sf::RenderTarget* m_window;
464 #if SFML_VERSION_MAJOR == 2 && SFML_VERSION_MINOR < 5
466 bool m_accessToWindow;
470 GuiContainer::Ptr m_container = std::make_shared<GuiContainer>();
473 sf::Time m_tooltipTime;
474 bool m_tooltipPossible =
false;
475 sf::Vector2f m_lastMousePos;
Gui class.
Definition: Gui.hpp:43
const std::vector< sf::String > & getWidgetNames()
Returns a list of the names of all the widgets.
Definition: Gui.hpp:231
void draw()
Draws all the widgets that were added to the gui.
void setWindow(sf::RenderTarget &window)
Set the target on which the gui should be drawn.
void setWindow(sf::RenderWindow &window)
Set the window on which the gui should be drawn.
GuiContainer::Ptr getContainer() const
Returns the internal container of the Gui.
Definition: Gui.hpp:183
std::string getWidgetName(const Widget::Ptr &widget) const
Returns the name of a widget.
void setFont(const Font &font)
Changes the global font.
Definition: Gui.hpp:195
const sf::View & getView() const
Return the view that is currently used by the gui.
Definition: Gui.hpp:134
Gui()
Default constructor.
bool handleEvent(sf::Event event)
Passes the event to the widgets.
void saveWidgetsToStream(std::stringstream &stream)
Save this the child widgets to a text file.
const std::vector< Widget::Ptr > & getWidgets()
Returns a list of all the widgets.
Definition: Gui.hpp:219
void setOpacity(float opacity)
Changes the opacity of all widgets.
float getOpacity() const
Returns the opacity of all the widgets.
void saveWidgetsToFile(const std::string &filename)
Save the child widgets to a text file.
void focusWidget(const Widget::Ptr &widget)
Focuses a widget.
bool setWidgetName(const Widget::Ptr &widget, const std::string &name)
Changes the name of a widget.
Widget::Ptr get(const sf::String &widgetName, bool recursive=false) const
Returns a pointer to an earlier created widget.
void loadWidgetsFromStream(std::stringstream &stream)
Load the child widgets from a string stream.
void unfocusWidgets()
Unfocus all the widgets.
T::Ptr get(const sf::String &widgetName, bool recursive=false) const
Returns a pointer to an earlier created widget.
Definition: Gui.hpp:295
void add(const Widget::Ptr &widgetPtr, const sf::String &widgetName="")
Adds a widget to the container.
Gui(sf::RenderTarget &window)
Construct the gui and set the target on which the gui should be drawn.
void focusNextWidget()
Focuses the next widget.
sf::RenderTarget * getWindow() const
Returns the window on which the gui is being drawn.
Definition: Gui.hpp:113
std::shared_ptr< sf::Font > getFont() const
Returns the global font.
Definition: Gui.hpp:207
Gui(sf::RenderWindow &window)
Construct the gui and set the window on which the gui should be drawn.
void loadWidgetsFromFile(const std::string &filename)
Load the child widgets from a text file.
void setView(const sf::View &view)
Change the view that is used by the gui.
void focusPreviousWidget()
Focuses the previous widget.
void uncheckRadioButtons()
Uncheck all the radio buttons.
sf::Vector2f getSize() const
Returns the size of the container.
bool remove(const Widget::Ptr &widget)
Removes a single widget that was added to the container.
void removeAllWidgets()
Removes all widgets that were added to the container.
Namespace that contains all TGUI functions and classes.
Definition: Animation.hpp:34