My Project
Public Member Functions | List of all members
ParaEngine::CEventHandler Class Reference

event handler More...

#include <EventHandler.h>

Inheritance diagram for ParaEngine::CEventHandler:

Public Member Functions

virtual int OnEvent (const IEvent *event, const string &sScriptCode)
 the callback function, when a given event is fired. More...
 
const string & GetCode () const
 
const string & GetFileName () const
 
void SetScript (const string &sScript)
 
bool Equals (const CEventHandler &e) const
 
bool Equals (const string &sID) const
 
bool IsMouseEvent () const
 
bool IsKeyEvent () const
 
bool IsEditorEvent () const
 
bool IsSystemEvent () const
 
bool IsNetworkEvent () const
 
bool IsTouchEvent () const
 
bool IsEvent (int nEventType) const
 
DWORD GetType ()
 get the event type. More...
 
 CEventHandler (DWORD nType, const string &sID, const string &sScript)
 
 CEventHandler (const string &sID, const string &sScript)
 

Detailed Description

event handler

Constructor & Destructor Documentation

§ CEventHandler()

CEventHandler::CEventHandler ( const string &  sID,
const string &  sScript 
)
Parameters
sIDif sID begins with "_m" it is treated as a mouse click event, except that if sID begins with "_mm" it is treated as a mouse move event. if sID begins with "_md" it is treated as a mouse down event. if sID begins with "_mu" it is treated as a mouse up event. if sID begins with "_k" it is treated as a key down event. if sID begins with "_ku" it is treated as a key up event. if sID begins with "_n" it is treated as a networking event. if sID begins with "_s" it is treated as a system event. if sID begins with "_e" it is treated as a editor event.

Member Function Documentation

§ GetType()

DWORD ParaEngine::CEventHandler::GetType ( )
inline

get the event type.

§ OnEvent()

int CEventHandler::OnEvent ( const IEvent event,
const string &  sScriptCode 
)
virtual

the callback function, when a given event is fired.

Parameters
eventthe input event object to the callback.
sScriptCodethis is usually event.ToScriptCode(); It just avoid the callback to call event.ToScriptCode() to recompute script code.
Returns
: same as NPL.activate return value.

The documentation for this class was generated from the following files: