30 #include <TGUI/Container.hpp>
31 #include <SFML/Graphics/RenderWindow.hpp>
55 #if SFML_VERSION_MAJOR == 2 && SFML_VERSION_MINOR < 5
56 Gui(sf::RenderWindow& window);
75 Gui(sf::RenderTarget& target);
81 Gui(
const Gui& copy) =
delete;
87 Gui& operator=(
const Gui& right) =
delete;
89 #if SFML_VERSION_MAJOR == 2 && SFML_VERSION_MINOR < 5
90 void setTarget(sf::RenderWindow& window);
105 void setTarget(sf::RenderTarget& target);
114 sf::RenderTarget* getTarget()
const;
123 void setView(
const sf::View& view);
132 const sf::View& getView()
const;
146 bool handleEvent(sf::Event event);
152 void setTabKeyUsageEnabled(
bool enabled);
158 bool isTabKeyUsageEnabled()
const;
179 GuiContainer::Ptr getContainer()
const;
188 void setFont(
const Font& font);
197 std::shared_ptr<sf::Font> getFont()
const;
206 const std::vector<Widget::Ptr>& getWidgets()
const;
254 return m_container->get<T>(widgetName);
271 void removeAllWidgets();
278 bool focusNextWidget();
285 bool focusPreviousWidget();
291 void unfocusAllWidgets();
314 void uncheckRadioButtons();
323 void setOpacity(
float opacity);
332 float getOpacity()
const;
343 void setTextSize(
unsigned int size);
351 unsigned int getTextSize()
const;
360 void loadWidgetsFromFile(
const String& filename,
bool replaceExisting =
true);
369 void saveWidgetsToFile(
const String& filename);
378 void loadWidgetsFromStream(std::stringstream& stream,
bool replaceExisting =
true);
387 void loadWidgetsFromStream(std::stringstream&& stream,
bool replaceExisting =
true);
396 void saveWidgetsToStream(std::stringstream& stream)
const;
404 void updateTime(
Duration elapsedTime);
419 std::chrono::steady_clock::time_point m_lastUpdateTime;
422 sf::RenderTarget* m_target;
423 bool m_windowFocused =
true;
425 #if SFML_VERSION_MAJOR == 2 && SFML_VERSION_MINOR < 5
427 bool m_accessToWindow;
431 GuiContainer::Ptr m_container = std::make_shared<GuiContainer>();
435 bool m_tooltipPossible =
false;
438 sf::View m_view{{0, 0, 1, 1}};
440 bool m_TabKeyUsageEnabled =
true;
452 #endif // TGUI_GUI_HPP
Gui class.
Definition: Gui.hpp:43
T::Ptr get(const String &widgetName) const
Returns a pointer to an earlier created widget.
Definition: Gui.hpp:252
Namespace that contains all TGUI functions and classes.
Definition: AbsoluteOrRelativeValue.hpp:35
Wrapper for durations.
Definition: Duration.hpp:48
Wrapper class to store strings.
Definition: String.hpp:70