TGUI  v0.5.2
 All Classes Namespaces Functions Variables Enumerations Enumerator Pages
Public Member Functions | List of all members
tgui::Window Struct Reference
Inheritance diagram for tgui::Window:
tgui::Group

Public Member Functions

 Window ()
 Default constructor. More...
 
 Window (sf::VideoMode mode, const std::string &title, sf::Uint32 style=sf::Style::Default, const sf::ContextSettings &settings=sf::ContextSettings())
 The constructor is just the same as the one from the sf::RenderWindow. More...
 
 Window (sf::WindowHandle handle, const sf::ContextSettings &settings=sf::ContextSettings())
 The constructor is just the same as the one from the sf::RenderWindow. More...
 
virtual ~Window ()
 Destructor. More...
 
virtual void handleEvent (sf::Event event)
 Passes the event to the objects. More...
 
virtual void drawGUI ()
 Draws all the objects that were added to the window. More...
 
virtual bool getCallback (Callback &callback)
 Get the next callback from the callback queue. More...
 
virtual void addCallback (const Callback &callback)
 Adds a callback to the list in tgui::Window. More...
 
- Public Member Functions inherited from tgui::Group
 Group ()
 Default constructor. More...
 
 Group (const Group &copy)
 Copy constructor. More...
 
virtual ~Group ()
 Destructor. More...
 
Groupoperator= (const Group &right)
 Overload of assignment operator. More...
 
template<typename T >
T * add (const sf::String &objectName="")
 Creates and adds an object to the group. More...
 
template<typename T >
T * get (const sf::String &objectName) const
 Returns a pointer to an earlier created object. More...
 
template<typename T >
T * copy (T *oldObject, const sf::String &newObjectName="")
 Makes a copy of any existing object and returns the pointer to the new object. More...
 
template<typename T >
T * copy (const sf::String &oldObjectName, const sf::String &newObjectName="")
 Makes a copy of any existing object and returns the pointer to the new object. More...
 
virtual bool loadObjectsFromFile (const std::string &filename)
 Loads a form from a file. More...
 
virtual std::vector< OBJECT * > & getObjects ()
 Returns a list of all the objects. More...
 
virtual std::vector< sf::String > & getObjectNames ()
 Returns a list of the names of all the objects. More...
 
virtual void remove (const sf::String &objectName)
 Removes a single object that was added to the group. More...
 
virtual void remove (OBJECT *object)
 Removes a single object that was added to the group. More...
 
virtual void removeAllObjects ()
 Removes all objects that were added to the group. More...
 
virtual void focusObject (OBJECT *const object)
 Focuses an object. More...
 
virtual void unfocusObject (OBJECT *const object)
 Unfocuses an object. More...
 
virtual void unfocusAllObjects ()
 Unfocuses all the objects. More...
 
virtual void uncheckRadioButtons ()
 Uncheck all the radio buttons. More...
 
virtual void updateTime (const sf::Time &elapsedTime)
 Update the internal clock to make animation possible. More...
 
virtual void moveObjectToFront (OBJECT *object)
 Places an object before all other objects. More...
 
virtual void moveObjectToBack (OBJECT *object)
 Places an object behind all other objects. More...
 

Additional Inherited Members

- Public Attributes inherited from tgui::Group
sf::Font globalFont
 The internal font, used by all objects by default. If not changed then this is the default SFML font. More...
 

Constructor & Destructor Documentation

tgui::Window::Window ( )

Default constructor.

tgui::Window::Window ( sf::VideoMode  mode,
const std::string &  title,
sf::Uint32  style = sf::Style::Default,
const sf::ContextSettings &  settings = sf::ContextSettings() 
)

The constructor is just the same as the one from the sf::RenderWindow.

tgui::Window::Window ( sf::WindowHandle  handle,
const sf::ContextSettings &  settings = sf::ContextSettings() 
)
explicit

The constructor is just the same as the one from the sf::RenderWindow.

virtual tgui::Window::~Window ( )
virtual

Destructor.

Member Function Documentation

virtual void tgui::Window::addCallback ( const Callback callback)
virtual

Adds a callback to the list in tgui::Window.

This callback can be obtained by calling the getCallback function of the window.

Implements tgui::Group.

virtual void tgui::Window::drawGUI ( )
virtual

Draws all the objects that were added to the window.

virtual bool tgui::Window::getCallback ( Callback callback)
virtual

Get the next callback from the callback queue.

This function works just like the PollEvent function from sfml.

The window stores the callback of all the objects. This function will return the next callback and then remove it from the queue.

Note that more than one callbacks may be present in the queue, thus you should always call this function in a loop to make sure that you process every callback.

Parameters
callbackAn empty tgui::Callback object that will be (partly) filled when there is a callback.
Returns
  • true when there is another callback. The callback parameter will be filled with information.
  • false when there is no callback. The callback parameter remains uninitialized and may not be used.
virtual void tgui::Window::handleEvent ( sf::Event  event)
virtual

Passes the event to the objects.

You should call this function in your event loop.


The documentation for this struct was generated from the following file: