OpendTect-6_4
6.4
|
Public Member Functions | |
MouseEventHandler () | |
~MouseEventHandler () | |
void | triggerMovement (const MouseEvent &) |
void | triggerButtonPressed (const MouseEvent &) |
void | triggerButtonReleased (const MouseEvent &) |
void | triggerDoubleClick (const MouseEvent &) |
void | triggerWheel (const MouseEvent &) |
bool | hasEvent () const |
const MouseEvent & | event () const |
bool | isHandled () const |
void | setHandled (bool yn) |
Public Member Functions inherited from CallBacker | |
CallBacker () | |
CallBacker (const CallBacker &) | |
virtual | ~CallBacker () |
bool | attachCB (NotifierAccess &, const CallBack &, bool onlyifnew=false) |
bool | attachCB (NotifierAccess *notif, const CallBack &cb, bool onlyifnew=false) |
void | detachCB (NotifierAccess &, const CallBack &) |
void | detachCB (NotifierAccess *notif, const CallBack &cb) |
bool | isNotifierAttached (NotifierAccess *) const |
Only for debugging purposes, don't use. More... | |
Public Attributes | |
Notifier< MouseEventHandler > | buttonPressed |
Notifier< MouseEventHandler > | buttonReleased |
Notifier< MouseEventHandler > | movement |
Notifier< MouseEventHandler > | doubleClick |
Notifier< MouseEventHandler > | wheelMove |
Protected Member Functions | |
void | setEvent (const MouseEvent *) |
Protected Member Functions inherited from CallBacker | |
void | detachAllNotifiers () |
Call from the destructor of your inherited object. More... | |
Protected Attributes | |
MouseEvent * | event_ |
bool | ishandled_ |
Handles mouse events. An instance of the MouseEventHandler is provided by the object that detects the mouse-click, e.g. a gui or visualization object.
Once the event callback is recieved, it MUST check if someone else have handled the event and taken necessary actions. If it is not already handled, and your class handles it, it should set the isHandled flag to prevent other objects in the callback chain to handle the event. It is often a good idea to be very specific what events your function should handle to avoid interference with other objects that are in the callback chain. As an example, see the code below: The if-statement will only let right-clicks when no other mouse or keyboard button are pressed through.
MouseEventHandler::MouseEventHandler | ( | ) |
MouseEventHandler::~MouseEventHandler | ( | ) |
|
inline |
|
inline |
|
inline |
|
protected |
|
inline |
void MouseEventHandler::triggerButtonPressed | ( | const MouseEvent & | ) |
void MouseEventHandler::triggerButtonReleased | ( | const MouseEvent & | ) |
void MouseEventHandler::triggerDoubleClick | ( | const MouseEvent & | ) |
void MouseEventHandler::triggerMovement | ( | const MouseEvent & | ) |
void MouseEventHandler::triggerWheel | ( | const MouseEvent & | ) |
Notifier<MouseEventHandler> MouseEventHandler::buttonPressed |
Notifier<MouseEventHandler> MouseEventHandler::buttonReleased |
Notifier<MouseEventHandler> MouseEventHandler::doubleClick |
|
protected |
|
protected |
Notifier<MouseEventHandler> MouseEventHandler::movement |
Notifier<MouseEventHandler> MouseEventHandler::wheelMove |
Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B. V. 2019