My Project
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Attributes | Static Protected Attributes | List of all members
ParaEngine::CGUIEvent Class Reference

Place of the. More...

#include <GUIEvent.h>

Inheritance diagram for ParaEngine::CGUIEvent:
ParaEngine::IObject ParaEngine::CRefCounted

Classes

struct  GUI_EVENT_KEYBOARD
 
struct  GUI_EVENT_MOUSE
 
struct  GUI_KEYBOARD_HOLDKEY
 
struct  GUI_SIMPLE_EVENT_MOUSE
 

Public Types

enum  GUI_EVENT_TYPE {
  NONE =0, SIMULATE =1, MOUSE =2, KEYBOARD =4,
  WINDOWS =1048576
}
 
enum  GUI_EVENT_STATE {
  GUIESNone =0, GUIESLeftNone =1, GUIESLeftDown =2, GUIESLeftClick =3,
  GUIESLeftDBClick =4, GUIESLeftMask =7, GUIESRightNone =8, GUIESRightDown =16,
  GUIESRightClick =24, GUIESRightDBClick =32, GUIESRightMask =56, GUIESMiddleNone =64,
  GUIESMiddleDown =128, GUIESMiddleClick =192, GUIESMiddleDBClick =256, GUIESMiddleMask =448,
  GUIESDragBegin =512, GUIESDragOver =1024, GUIESDragEnd =1536, GUIESDragMask =3584
}
 new 00000000000xxx: Left 00000000xxx000: Right 00000xxx000000: Middle 00xxx000000000: Drag xx000000000000: Key
 
enum  GUI_KEY_OPTION { DEFAULT =0, REPEAT_PRESSED_KEYS =1, IGNORE_UP_EVENTS =2, IGNORE_DOWN_EVENTS =4 }
 
- Public Types inherited from ParaEngine::IObject
typedef ParaEngine::weak_ptr< IObjectWeakPtr_type
 

Public Member Functions

bool IsMapTo (int eSrcEvent, int eDestEvent)
 
int GetTriggerEvent () const
 Set the CEventBinding object of this event. More...
 
bool InterpretMessage (MSG *msg, int option=0)
 
CEventBindingGetEventBindingObj ()
 
const CEventBindingGetConstEventBindingObj ()
 
bool IsMousePressed (int mouse)
 
string GetCharSequence ()
 gets a string of buffered char sequence
 
bool IsKeyPressed (int key)
 tests if the given key is pressed in the current key event
 
void SetBinding (IObjectDrag *obj)
 
void AddHoldKey (DWORD key, DWORD nTime)
 Add a holding key to the keyboard. More...
 
void Initialize ()
 
void UpdateKey (int option)
 
virtual int Release ()
 
virtual void Clone (IObject *obj) const
 Clone the object's contains to a pointer. More...
 
virtual IObjectClone () const
 Clone the object's contains and return a pointer to the newly created object. More...
 
virtual bool Equals (const IObject *obj) const
 Compare the object with another object. More...
 
void ResetState ()
 
MSG GenerateMessage ()
 
- Public Member Functions inherited from ParaEngine::IObject
virtual const ITypeGetType () const
 
virtual std::string ToString () const
 
WeakPtr_typeGetWeakReference ()
 get weak reference object. More...
 
virtual int ProcessObjectEvent (const ObjectEvent &event)
 this function is only used to backward compatibility of ParaObject:AddEvent() function. More...
 
- Public Member Functions inherited from ParaEngine::CRefCounted
void addref () const
 add reference count of the object. More...
 
bool delref () const
 decrease reference count of the object. More...
 
int GetRefCount () const
 get the reference count
 
CRefCountedAddToAutoReleasePool ()
 addref and releases the ownership sometime soon automatically (usually at the end of the current frame). More...
 

Static Public Member Functions

static CHAR GetChar (DWORD key)
 Interprets a char with reference to an input key state. More...
 
static void StaticInit ()
 

Public Attributes

GUI_EVENT_MOUSE m_mouse
 
GUI_EVENT_KEYBOARD m_keyboard
 
int m_nTime
 the time when the event happen, get using GetTickCount()
 
EventBinding_cow_type m_eventbinding
 

Static Public Attributes

static byte KeyStates [EventCount]
 

Protected Attributes

int m_nTriggerEvent
 
short m_eState
 
IObjectDragm_binding
 
- Protected Attributes inherited from ParaEngine::IObject
WeakPtr_type m_weak_reference
 
- Protected Attributes inherited from ParaEngine::CRefCounted
int m_refcount
 

Static Protected Attributes

static int m_nDragBeginDistance =EVENT_DRAG_DISTANCE
 
static int m_nDBClickInterval =EVENT_DOUBLECLICK_TIME
 

Detailed Description

Place of the.

Member Function Documentation

§ AddHoldKey()

void CGUIEvent::AddHoldKey ( DWORD  key,
DWORD  nTime 
)

Add a holding key to the keyboard.

Interprets the raw mouse or keyboard state to meaningful events.

The interpreted mouse events are Click, Double Click, Hover, Mouse Enter, Drag Begin, Drag Over, Drag End We advise user to call this to interpret mouse events because it's fast and convenient. However, we don't advise user to call this to interpret keyboard events because it's time consuming and we can only interpret two events.

§ Clone() [1/2]

void CGUIEvent::Clone ( IObject obj) const
virtual

Clone the object's contains to a pointer.

The caller should allocate the memory and pass the pointer to this function.. Inheritance should implement this function void Clone(IObject*) and IObject* Clone() should have the same behavior In some cases, if you want to avoid Dead Reference( one object is being referred to by many objects and you can't update all the references). It is possible to use this function to replace the contains at a given pointer. But this may result in memory leak if you do not implement this function carefully or misuse it.

Reimplemented from ParaEngine::IObject.

§ Clone() [2/2]

IObject * CGUIEvent::Clone ( ) const
virtual

Clone the object's contains and return a pointer to the newly created object.

The caller should free the memory of the return object. Inheritance should implement this function void Clone(IObject*) and IObject* Clone() should have the same behavior

Reimplemented from ParaEngine::IObject.

§ Equals()

bool CGUIEvent::Equals ( const IObject obj) const
virtual

Compare the object with another object.

Inheritance should implement this function

Reimplemented from ParaEngine::IObject.

§ GetChar()

CHAR CGUIEvent::GetChar ( DWORD  key)
static

Interprets a char with reference to an input key state.

Parameters
keyThe key needs to be interpret.
Returns
Return the interpret character. If the key is not a valid character (such as control keys), it will return a '\0'.

§ GetTriggerEvent()

int ParaEngine::CGUIEvent::GetTriggerEvent ( ) const
inline

Set the CEventBinding object of this event.

This function will delete the current CEventBinding object of this event and copies the new CEventBinding object using the Clone() method. So the caller should release the CEventBinding object it passed to this function.


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