26 #ifndef TGUI_WINDOW_HPP 27 #define TGUI_WINDOW_HPP 32 #include <TGUI/Container.hpp> 40 class TGUI_API
Gui :
public sf::NonCopyable
61 Gui(sf::RenderWindow& window);
72 Gui(sf::RenderTarget& window);
81 void setWindow(sf::RenderWindow& window);
90 void setWindow(sf::RenderTarget& window);
99 sf::RenderTarget* getWindow()
const;
117 bool handleEvent(sf::Event event,
bool resetView =
true);
131 void draw(
bool resetView =
true);
152 bool pollCallback(
Callback& callback);
163 bool hasFocus()
const;
174 sf::Vector2f getSize()
const;
201 bool setGlobalFont(
const std::string& filename);
212 void setGlobalFont(
const sf::Font& font);
223 const sf::Font& getGlobalFont()
const;
232 const std::vector< Widget::Ptr >& getWidgets();
241 const std::vector<sf::String>& getWidgetNames();
258 void add(
const Widget::Ptr& widgetPtr,
const sf::String& widgetName =
"");
278 Widget::Ptr get(
const sf::String& widgetName,
bool recursive =
false)
const;
300 typename T::Ptr
get(
const sf::String& widgetName,
bool recursive =
false)
const 302 return m_Container.get<T>(widgetName, recursive);
346 void removeAllWidgets();
358 bool setWidgetName(
const Widget::Ptr& widget,
const std::string& name);
371 bool getWidgetName(
const Widget::Ptr& widget, std::string& name)
const;
392 void focusNextWidget();
402 void focusPreviousWidget();
409 void unfocusWidgets();
416 void uncheckRadioButtons();
446 void bindGlobalCallback(std::function<
void(
const Callback&)> func);
459 template <
typename T>
462 m_Container.bindGlobalCallback(func, classPtr);
470 void unbindGlobalCallback();
488 bool loadWidgetsFromFile(
const std::string& filename);
501 bool saveWidgetsToFile(
const std::string& filename);
508 void updateTime(
const sf::Time& elapsedTime);
520 void addChildCallback(
const Callback& callback);
527 std::queue<Callback> m_Callback;
533 sf::RenderTarget* m_Window;
536 bool m_accessToWindow;
556 #endif // TGUI_WINDOW_HPP Namespace that contains all TGUI functions and classes.
Definition: AnimatedPicture.hpp:33
Definition: Callback.hpp:45
Definition: Container.hpp:571
Parent class for widgets that store multiple widgets.
Definition: Container.hpp:43
void bindGlobalCallback(void(T::*func)(const Callback &), const T *const classPtr)
Bind a function to the callbacks of all child widgets.
Definition: Gui.hpp:460