Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Moteur3D::UserInterface Class Reference

this class is responsible for the management of the whole 2D interface management. It include adding and removing windows, checking mouse events and focus change, as well as displaying windows. It must be linked to the window manager. More...

#include <UserInterface.h>

List of all members.

Public Member Functions

 UserInterface ()
 Constructor.
 ~UserInterface ()
 Destructor.
void AddWindow (UIBaseWindow *window)
 Adds a window to the interface.
void RemoveWindow (UIBaseWindow *window)
 Removes a window from the interface.
void FocusOn (UIBaseWindow *window)
 Gives the focus to the window given as an argument (it must have already been added via AddWindow).
void CloseWindow (UIBaseWindow *window)
 Closes the window given as an argument. Note that this will effect just before next draw, and the window's memory will be freed by the user interface.

Protected Member Functions

virtual void OnDisplay ()
 Event called when the interface needs to be displayed (after rendering the scene). Override it if you want custom graphics for your window (and you probably will).
virtual bool OnMouseButton (const MouseInformations *mouseInfo, MouseButton button, bool buttonDown)
 This function is called when a mouse button is pressed or released inside the window's borders. When this happens, the user interface will check (in focus order) if one of the windows can handle the event. This is why the function must return a bool : once the interface has found a window that handles the click, it stops it search (so every window is not checked) and returns true. If no window handles the click, then the Window instance triggers an event (OnMouseButton) to its event manager (i.e. Application).
virtual bool OnMouseMove (MouseInformations *mouseInfo)
 This function is called when the mouse is moved inside the window's borders. When this happens, the user interface will check (in focus order) if one of the windows can handle the event. This is why the function must return a bool : once the interface has found a window that handles the move, it stops it search (so every window is not checked) and returns true. If no window handles the click, then the Window instance triggers an event (OnMouseButton) to its event manager (i.e. Application).
virtual void OnResize (int width, int height)
 This function is called each time the windows is resized, or the window is switched between fullscreen and windowed mode.

Protected Attributes

int m_Height
 Current window's height and width (not including borders).
int m_Width

Private Attributes

list< UIBaseWindow * > m_Windows
 List of windows the interface handles.
list< UIBaseWindow * > m_RemoveWindows
 List of windows the interface will have to destroy before next draw.

Friends

class Window


Detailed Description

this class is responsible for the management of the whole 2D interface management. It include adding and removing windows, checking mouse events and focus change, as well as displaying windows. It must be linked to the window manager.


Constructor & Destructor Documentation

Moteur3D::UserInterface::UserInterface  ) 
 

Constructor.

Moteur3D::UserInterface::~UserInterface  ) 
 

Destructor.


Member Function Documentation

void Moteur3D::UserInterface::AddWindow UIBaseWindow window  ) 
 

Adds a window to the interface.

void Moteur3D::UserInterface::CloseWindow UIBaseWindow window  ) 
 

Closes the window given as an argument. Note that this will effect just before next draw, and the window's memory will be freed by the user interface.

void Moteur3D::UserInterface::FocusOn UIBaseWindow window  ) 
 

Gives the focus to the window given as an argument (it must have already been added via AddWindow).

virtual void Moteur3D::UserInterface::OnDisplay  )  [protected, virtual]
 

Event called when the interface needs to be displayed (after rendering the scene). Override it if you want custom graphics for your window (and you probably will).

virtual bool Moteur3D::UserInterface::OnMouseButton const MouseInformations mouseInfo,
MouseButton  button,
bool  buttonDown
[protected, virtual]
 

This function is called when a mouse button is pressed or released inside the window's borders. When this happens, the user interface will check (in focus order) if one of the windows can handle the event. This is why the function must return a bool : once the interface has found a window that handles the click, it stops it search (so every window is not checked) and returns true. If no window handles the click, then the Window instance triggers an event (OnMouseButton) to its event manager (i.e. Application).

Parameters:
mouseInfo Mouse informations, such as position, button states etc.
button Mouse button that is concerned.
buttonDown true if the button is being pressed, otherwise false.
Returns:
True if the current window handles the event, false otherwise.

virtual bool Moteur3D::UserInterface::OnMouseMove MouseInformations mouseInfo  )  [protected, virtual]
 

This function is called when the mouse is moved inside the window's borders. When this happens, the user interface will check (in focus order) if one of the windows can handle the event. This is why the function must return a bool : once the interface has found a window that handles the move, it stops it search (so every window is not checked) and returns true. If no window handles the click, then the Window instance triggers an event (OnMouseButton) to its event manager (i.e. Application).

Parameters:
mouseInfo Mouse informations, such as position, button states etc.
Returns:
True if the current window handles the event, false otherwise.

virtual void Moteur3D::UserInterface::OnResize int  width,
int  height
[protected, virtual]
 

This function is called each time the windows is resized, or the window is switched between fullscreen and windowed mode.

void Moteur3D::UserInterface::RemoveWindow UIBaseWindow window  ) 
 

Removes a window from the interface.


Friends And Related Function Documentation

friend class Window [friend]
 


Member Data Documentation

int Moteur3D::UserInterface::m_Height [protected]
 

Current window's height and width (not including borders).

list<UIBaseWindow*> Moteur3D::UserInterface::m_RemoveWindows [private]
 

List of windows the interface will have to destroy before next draw.

int Moteur3D::UserInterface::m_Width [protected]
 

list<UIBaseWindow*> Moteur3D::UserInterface::m_Windows [private]
 

List of windows the interface handles.


The documentation for this class was generated from the following file:
Generated on Sat Oct 15 15:05:52 2005 for Moteur3D by  doxygen 1.4.4