My Project
|
Place of the. More...
#include <GUIEvent.h>
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 } |
![]() | |
typedef ParaEngine::weak_ptr< IObject > | WeakPtr_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) |
CEventBinding * | GetEventBindingObj () |
const CEventBinding * | GetConstEventBindingObj () |
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 IObject * | Clone () 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 () |
![]() | |
virtual const IType * | GetType () const |
virtual std::string | ToString () const |
WeakPtr_type & | GetWeakReference () |
get weak reference object. More... | |
virtual int | ProcessObjectEvent (const ObjectEvent &event) |
this function is only used to backward compatibility of ParaObject:AddEvent() function. More... | |
![]() | |
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 | |
CRefCounted * | AddToAutoReleasePool () |
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 |
IObjectDrag * | m_binding |
![]() | |
WeakPtr_type | m_weak_reference |
![]() | |
int | m_refcount |
Static Protected Attributes | |
static int | m_nDragBeginDistance =EVENT_DRAG_DISTANCE |
static int | m_nDBClickInterval =EVENT_DOUBLECLICK_TIME |
Place of the.
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.
|
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.
|
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.
|
virtual |
Compare the object with another object.
Inheritance should implement this function
Reimplemented from ParaEngine::IObject.
|
static |
Interprets a char with reference to an input key state.
key | The key needs to be interpret. |
|
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.