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

Moteur3D::UIBaseComponent Class Reference

This class is the base class for all the UI windows components. More...

#include <UIBaseComponent.h>

Inheritance diagram for Moteur3D::UIBaseComponent:

Moteur3D::UICButton Moteur3D::UICLabel Moteur3D::UICCloseButton List of all members.

Public Member Functions

 UIBaseComponent (UIBaseWindow *window)
 Constructor. Needs the window that will embed the instance.
 ~UIBaseComponent ()
 Destructor.
virtual void SetPosition (int x, int y)
 Sets the component's current position. 0,0 is the top-left corner of the window.
virtual void SetSize (int x, int y)
 Sets the component's current size.
virtual int GetWidth ()
 Gets the component's current X size.
virtual int GetHeight ()
 Gets the component's current Y size.
virtual int GetPositionX ()
 Gets the component's current X position.
virtual int GetPositionY ()
 Gets the component's current Y position.

Protected Member Functions

virtual bool IsMouseInbound (const MouseInformations *mouseInfo)
 checks if the mouse is above the component or not. You might want to change the algorithm if you want non-rectangular components.
virtual bool WasMouseInbound (const MouseInformations *mouseInfo)
 checks if the mouse was above the component or not. You might want to change the algorithm if you want non-rectangular components.
virtual void OnDisplay ()=0
 Event called when the component needs to be displayed. Override it if you want custom graphics for your component (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. Each window will check, if the mouse is in its bounds, if it affects a component.
virtual bool OnMouseMove (const MouseInformations *mouseInfo)
 This function is called when the mouse moves 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. Each window will check, if the mouse is in its bounds, if it affects a component.
void SendMessage (UICMessage message, int infos)
 Sends a message to the embedding window.

Protected Attributes

int m_PosX
 Component's position. 0,0 is the top-left corner of the window.
int m_PosY
int m_Width
 Component's size.
int m_Height
UIBaseWindowm_Window
 Embedding window.

Friends

class UIBaseWindow

Detailed Description

This class is the base class for all the UI windows components.


Constructor & Destructor Documentation

Moteur3D::UIBaseComponent::UIBaseComponent UIBaseWindow window  )  [inline]
 

Constructor. Needs the window that will embed the instance.

Moteur3D::UIBaseComponent::~UIBaseComponent  )  [inline]
 

Destructor.


Member Function Documentation

virtual int Moteur3D::UIBaseComponent::GetHeight  )  [inline, virtual]
 

Gets the component's current Y size.

virtual int Moteur3D::UIBaseComponent::GetPositionX  )  [inline, virtual]
 

Gets the component's current X position.

virtual int Moteur3D::UIBaseComponent::GetPositionY  )  [inline, virtual]
 

Gets the component's current Y position.

virtual int Moteur3D::UIBaseComponent::GetWidth  )  [inline, virtual]
 

Gets the component's current X size.

virtual bool Moteur3D::UIBaseComponent::IsMouseInbound const MouseInformations mouseInfo  )  [inline, protected, virtual]
 

checks if the mouse is above the component or not. You might want to change the algorithm if you want non-rectangular components.

Parameters:
mouseInfo Mouse informations, such as position, button states etc.

virtual void Moteur3D::UIBaseComponent::OnDisplay  )  [protected, pure virtual]
 

Event called when the component needs to be displayed. Override it if you want custom graphics for your component (and you probably will).

Implemented in Moteur3D::UICButton, Moteur3D::UICCloseButton, and Moteur3D::UICLabel.

virtual bool Moteur3D::UIBaseComponent::OnMouseButton const MouseInformations mouseInfo,
MouseButton  button,
bool  buttonDown
[inline, 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. Each window will check, if the mouse is in its bounds, if it affects a component.

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.

Reimplemented in Moteur3D::UICButton.

virtual bool Moteur3D::UIBaseComponent::OnMouseMove const MouseInformations mouseInfo  )  [inline, protected, virtual]
 

This function is called when the mouse moves 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. Each window will check, if the mouse is in its bounds, if it affects a component.

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

Reimplemented in Moteur3D::UICButton.

void Moteur3D::UIBaseComponent::SendMessage UICMessage  message,
int  infos
[protected]
 

Sends a message to the embedding window.

Parameters:
message Message identifier.
infos additional informations, may be anything depending on the component.

virtual void Moteur3D::UIBaseComponent::SetPosition int  x,
int  y
[inline, virtual]
 

Sets the component's current position. 0,0 is the top-left corner of the window.

virtual void Moteur3D::UIBaseComponent::SetSize int  x,
int  y
[inline, virtual]
 

Sets the component's current size.

virtual bool Moteur3D::UIBaseComponent::WasMouseInbound const MouseInformations mouseInfo  )  [inline, protected, virtual]
 

checks if the mouse was above the component or not. You might want to change the algorithm if you want non-rectangular components.

Parameters:
mouseInfo Mouse informations, such as position, button states etc.


Friends And Related Function Documentation

friend class UIBaseWindow [friend]
 


Member Data Documentation

int Moteur3D::UIBaseComponent::m_Height [protected]
 

int Moteur3D::UIBaseComponent::m_PosX [protected]
 

Component's position. 0,0 is the top-left corner of the window.

int Moteur3D::UIBaseComponent::m_PosY [protected]
 

int Moteur3D::UIBaseComponent::m_Width [protected]
 

Component's size.

UIBaseWindow* Moteur3D::UIBaseComponent::m_Window [protected]
 

Embedding window.


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