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

PG_MessageObject Class Reference

Inheritance diagram for PG_MessageObject:

Inheritance graph
[legend]
Collaboration diagram for PG_MessageObject:

Collaboration graph
[legend]
List of all members.

Detailed Description

Base class of all objects (provides message handling).

Author:
Alexander Pipelka

Provides a message pump and global handlers for all other PG_MessageObject instances.


Public Member Functions

 PG_MessageObject ()
 Creates a PG_MessageObject.

virtual ~PG_MessageObject ()
 Destroys a PG_MessageObject and removes it from the global object list.

void EnableReceiver (bool enable)
 This function enables or disables receiving of SDL_Event messages.

PG_MessageObjectSetCapture ()
 Set a message capture for this object.

void ReleaseCapture ()
 Releases a previous capture.

PG_MessageObjectGetCapture ()
 Return the current capture object.

PG_MessageObjectSetInputFocus ()
 Set an inputfocus for this object.

void ReleaseInputFocus ()
 Release the inputfocus.

bool IsEnabled ()
 Check if the object can receive messages.

virtual bool ProcessEvent (const SDL_Event *event)
 Sends an event directly to an object.


Public Attributes

SignalActive sigActive
SignalKeyDown sigKeyDown
SignalKeyUp sigKeyUp
SignalMouseMotion sigMouseMotion
SignalMouseButtonDown sigMouseButtonDown
SignalMouseButtonUp sigMouseButtonUp
SignalSysWM sigSysWM
SignalVideoResize sigVideoResize
SignalQuit sigQuit

Protected Member Functions

virtual bool eventActive (const SDL_ActiveEvent *active)
 Overridable Eventhandler for the SDL_ActiveEvent message.

virtual bool eventKeyDown (const SDL_KeyboardEvent *key)
 Overridable Eventhandler for a SDL_KeyboardEvent message.

virtual bool eventKeyUp (const SDL_KeyboardEvent *key)
 Overridable Eventhandler for a SDL_KeyboardEvent message.

virtual bool eventMouseMotion (const SDL_MouseMotionEvent *motion)
 Overridable Eventhandler for a SDL_MouseMotionEvent message.

virtual bool eventMouseButtonDown (const SDL_MouseButtonEvent *button)
 Overridable Eventhandler for a SDL_MouseButtonEvent message.

virtual bool eventMouseButtonUp (const SDL_MouseButtonEvent *button)
 Overridable Eventhandler for a SDL_MouseButtonEvent message.

virtual bool eventQuit (int id, PG_MessageObject *widget, unsigned long data)
 Overridable Eventhandler for a SDL_QuitEvent message.

virtual bool eventQuitModal (int id, PG_MessageObject *widget, unsigned long data)
 Overridable Eventhandler for a MSG_QUITMODAL message.

virtual bool eventSysWM (const SDL_SysWMEvent *syswm)
 Overridable Eventhandler for a SDL_SysWMEvent message.

virtual bool eventResize (const SDL_ResizeEvent *event)
 Overridable Eventhandler for a SDL_ResizeEvent message.

virtual void eventInputFocusLost (PG_MessageObject *newfocus)
virtual bool AcceptEvent (const SDL_Event *event)
 Overridable message filter function.


Static Protected Attributes

PG_MessageObjectcaptureObject


Constructor & Destructor Documentation

PG_MessageObject::PG_MessageObject  ) 
 

Creates a PG_MessageObject.

virtual PG_MessageObject::~PG_MessageObject  )  [virtual]
 

Destroys a PG_MessageObject and removes it from the global object list.


Member Function Documentation

virtual bool PG_MessageObject::AcceptEvent const SDL_Event *  event  )  [protected, virtual]
 

Overridable message filter function.

Derivated classes can filter special events. The default implementation returns 'false' which indicates that this message is not processed by this object.

Parameters:
event SDL_Event message
Returns:
Notifies the message pump if this message is processed by this object or it should be routed to the next message receiver.

Reimplemented in PG_Widget.

void PG_MessageObject::EnableReceiver bool  enable  ) 
 

This function enables or disables receiving of SDL_Event messages.

Parameters:
enable Enable or disable the ability of receiving messages. When set to false no event handlers will be called for this object

virtual bool PG_MessageObject::eventActive const SDL_ActiveEvent *  active  )  [protected, virtual]
 

Overridable Eventhandler for the SDL_ActiveEvent message.

The default implementation returns 'false' which indicates that this message is not processed by this object.

Parameters:
active SDL_ActiveEvent message
Returns:
Notifies the message pump if this message is processed by this object or it should be routed to the next message receiver.

virtual void PG_MessageObject::eventInputFocusLost PG_MessageObject newfocus  )  [protected, virtual]
 

Reimplemented in PG_LineEdit.

virtual bool PG_MessageObject::eventKeyDown const SDL_KeyboardEvent *  key  )  [protected, virtual]
 

Overridable Eventhandler for a SDL_KeyboardEvent message.

This handler is called when a key changed it's state from unpressed to pressed. The default implementation returns 'false' which indicates that this message is not processed by this object.

Parameters:
key SDL_KeyboardEvent message
Returns:
Notifies the message pump if this message is processed by this object or it should be routed to the next message receiver.

Reimplemented in PG_Application, PG_LineEdit, PG_MultiLineEdit, and PG_PopupMenu.

virtual bool PG_MessageObject::eventKeyUp const SDL_KeyboardEvent *  key  )  [protected, virtual]
 

Overridable Eventhandler for a SDL_KeyboardEvent message.

This handler is called when a key changed it's state from pressed to unpressed. The default implementation returns 'false' which indicates that this message is not processed by this object.

Parameters:
key SDL_KeyboardEvent message
Returns:
Notifies the message pump if this message is processed by this object or it should be routed to the next message receiver.

Reimplemented in PG_Application.

virtual bool PG_MessageObject::eventMouseButtonDown const SDL_MouseButtonEvent *  button  )  [protected, virtual]
 

Overridable Eventhandler for a SDL_MouseButtonEvent message.

This handler is called when a mouse button is pressed. The default implementation returns 'false' which indicates that this message is not processed by this object.

Parameters:
button SDL_MouseButtonEvent message
Returns:
Notifies the message pump if this message is processed by this object or it should be routed to the next message receiver.

Reimplemented in PG_Button, PG_ListBox, PG_MaskEdit, PG_MultiLineEdit, PG_PopupMenu, PG_ScrollBar, PG_WidgetDnD, and PG_Window.

virtual bool PG_MessageObject::eventMouseButtonUp const SDL_MouseButtonEvent *  button  )  [protected, virtual]
 

Overridable Eventhandler for a SDL_MouseButtonEvent message.

This handler is called when a mouse button is released. The default implementation returns 'false' which indicates that this message is not processed by this object.

Parameters:
button SDL_MouseButtonEvent message
Returns:
Notifies the message pump if this message is processed by this object or it should be routed to the next message receiver.

Reimplemented in PG_Button, PG_CheckButton, PG_LineEdit, PG_ListBox, PG_ListBoxBaseItem, PG_MultiLineEdit, PG_PopupMenu, PG_RadioButton, PG_ScrollBar, PG_Slider, PG_WidgetDnD, and PG_Window.

virtual bool PG_MessageObject::eventMouseMotion const SDL_MouseMotionEvent *  motion  )  [protected, virtual]
 

Overridable Eventhandler for a SDL_MouseMotionEvent message.

This handler is called when mouse movement is detected. The default implementation returns 'false' which indicates that this message is not processed by this object.

Parameters:
motion SDL_MouseMotionEvent message
Returns:
Notifies the message pump if this message is processed by this object or it should be routed to the next message receiver.

Reimplemented in PG_ListBox, PG_MultiLineEdit, PG_PopupMenu, PG_ScrollBar, PG_WidgetDnD, and PG_Window.

virtual bool PG_MessageObject::eventQuit int  id,
PG_MessageObject widget,
unsigned long  data
[protected, virtual]
 

Overridable Eventhandler for a SDL_QuitEvent message.

The default implementation returns 'false' which indicates that this message is not processed by this object.

Parameters:
id id of the sending widget
widget pointer to the widget
data event specific data
Returns:
Notifies the message pump if this message is processed by this object or it should be routed to the next message receiver.

Reimplemented in PG_Application.

virtual bool PG_MessageObject::eventQuitModal int  id,
PG_MessageObject widget,
unsigned long  data
[protected, virtual]
 

Overridable Eventhandler for a MSG_QUITMODAL message.

The default implementation returns 'false' which indicates that this message is not processed by this object.

Parameters:
id id of the sending widget
widget pointer to the widget
data event specific data
Returns:
Notifies the message pump if this message is processed by this object or it should be routed to the next message receiver.

Reimplemented in PG_Widget.

virtual bool PG_MessageObject::eventResize const SDL_ResizeEvent *  event  )  [protected, virtual]
 

Overridable Eventhandler for a SDL_ResizeEvent message.

The default implementation returns 'false' which indicates that this message is not processed by this object.

Parameters:
event SDL_ResizeEvent message
Returns:
Notifies the message pump if this message is processed by this object or it should be routed to the next message receiver.

Reimplemented in PG_Application.

virtual bool PG_MessageObject::eventSysWM const SDL_SysWMEvent *  syswm  )  [protected, virtual]
 

Overridable Eventhandler for a SDL_SysWMEvent message.

The default implementation returns 'false' which indicates that this message is not processed by this object.

Parameters:
syswm SDL_SysWMEvent message
Returns:
Notifies the message pump if this message is processed by this object or it should be routed to the next message receiver.

PG_MessageObject* PG_MessageObject::GetCapture  ) 
 

Return the current capture object.

bool PG_MessageObject::IsEnabled  ) 
 

Check if the object can receive messages.

Returns:
true/false returns true when the object can receive messages or false if not.

virtual bool PG_MessageObject::ProcessEvent const SDL_Event *  event  )  [virtual]
 

Sends an event directly to an object.

Parameters:
event SDL_Event message
Returns:
Notifies the message pump if this message is processed by this object or it should be routed to the next message receiver.

void PG_MessageObject::ReleaseCapture  ) 
 

Releases a previous capture.

void PG_MessageObject::ReleaseInputFocus  ) 
 

Release the inputfocus.

PG_MessageObject* PG_MessageObject::SetCapture  ) 
 

Set a message capture for this object.

This object will receive all SDL_Event messages regardless if it is able to process them or not.

PG_MessageObject* PG_MessageObject::SetInputFocus  ) 
 

Set an inputfocus for this object.

Returns:
pointer to the object that had the inputfocus till now If the inputfocus is set all key events will be sent to this object


Member Data Documentation

PG_MessageObject* PG_MessageObject::captureObject [static, protected]
 

SignalActive PG_MessageObject::sigActive
 

SignalKeyDown PG_MessageObject::sigKeyDown
 

SignalKeyUp PG_MessageObject::sigKeyUp
 

SignalMouseButtonDown PG_MessageObject::sigMouseButtonDown
 

SignalMouseButtonUp PG_MessageObject::sigMouseButtonUp
 

SignalMouseMotion PG_MessageObject::sigMouseMotion
 

SignalQuit PG_MessageObject::sigQuit
 

SignalSysWM PG_MessageObject::sigSysWM
 

SignalVideoResize PG_MessageObject::sigVideoResize
 



The ParaGUI Project - Alexander Pipelka