TGUI  v0.5.2
 All Classes Namespaces Functions Variables Enumerations Enumerator Pages
Window.hpp
1 //
3 // TGUI - Texus's Graphical User Interface
4 // Copyright (C) 2012 Bruno Van de Velde (VDV_B@hotmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24 
25 
26 #ifndef _TGUI_WINDOW_INCLUDED_
27 #define _TGUI_WINDOW_INCLUDED_
28 
30 
31 namespace tgui
32 {
34 
35  struct TGUI_API Window : public Group, sf::RenderWindow
36  {
40  Window();
41 
42 
46  Window(sf::VideoMode mode, const std::string& title, sf::Uint32 style = sf::Style::Default, const sf::ContextSettings& settings = sf::ContextSettings());
47 
51  explicit Window(sf::WindowHandle handle, const sf::ContextSettings& settings = sf::ContextSettings());
52 
53 
57  virtual ~Window();
58 
59 
65  virtual void handleEvent(sf::Event event);
66 
67 
71  virtual void drawGUI();
72 
73 
91  virtual bool getCallback(Callback& callback);
92 
93 
95  // TGUI uses this function internally to handle object callbacks.
96  // When you allow an object to pass callbacks then this function is called to tell the window about the callback.
97  // You can use this function to fake an object callback.
99  virtual void addCallback(const Callback& callback);
100 
101 
103  protected:
104 
105  // This will store all object callbacks until you pop them with getCallback
106  std::queue<Callback> m_Callback;
107 
108  // The internal clock which is used for animation of objects
109  sf::Clock m_Clock;
110 
112  };
113 
115 
116 }
117 
119 
120 #endif //_TGUI_WINDOW_INCLUDED_
When you receive an action callback from an object then this struct will be passed as parameter...
Definition: Objects.hpp:362
Parent struct for objects that store multiple objects.
Definition: Group.hpp:38
Definition: Window.hpp:35