DUtilsCV::GUI::MouseHandler Class Reference
#include <GUI.h>
List of all members.
Detailed Description
Synchronous mouse event handler
- Note:
- Important! this class is still non thread aware, so race conditions can occur. Apart from that, it is fully functional
Constructor & Destructor Documentation
GUI::MouseHandler::MouseHandler |
( |
|
) |
|
Creates the handler without attaching it to any window
GUI::MouseHandler::~MouseHandler |
( |
|
) |
[virtual] |
Member Function Documentation
void GUI::MouseHandler::attach |
( |
const tWinHandler & |
hwnd, |
|
|
const std::vector< int > & |
events = std::vector<int>() | |
|
) |
| | |
Attaches the handler to a window. It can only be attached once
- Parameters:
-
| hwnd | window |
| events | (optional) events to listen to. If not given, the existing list of valid events is not modified, except if it was empty. In that case, all the events are added, even mouse move. |
bool DUtilsCV::GUI::MouseHandler::attached |
( |
|
) |
const [inline] |
Says if the mouse handler is already attached to some window
- Returns:
- true iif attached
void GUI::MouseHandler::attachToClicks |
( |
const tWinHandler & |
hwnd |
) |
|
Attaches the handler to a window and makes it listen to left single clicks only
- Parameters:
-
void GUI::MouseHandler::attachToMotions |
( |
const tWinHandler & |
hwnd |
) |
|
Attaches the handler to a window and makes it listen to mouse movements only
- Parameters:
-
void GUI::MouseHandler::callbackHandlerFunction |
( |
int |
event, |
|
|
int |
x, |
|
|
int |
y, |
|
|
int |
flags, |
|
|
void * |
pMouseHandler | |
|
) |
| | [static, protected] |
Callback function invoked when there is a new mouse event
- Parameters:
-
| event | |
| x | |
| y | |
| falgs | |
| pMouseHandler | pointer to the MouseHandler parent |
bool DUtilsCV::GUI::MouseHandler::empty |
( |
|
) |
const [inline] |
Says whether there is some event to get
- Returns:
- true iif no event available
bool GUI::MouseHandler::get |
( |
tEvent & |
event |
) |
|
Gets the next event from the queue
- Parameters:
-
| event | (out) event fetched |
- Returns:
- false iif queue was empty and no event could be retrieved
void GUI::MouseHandler::ignore |
( |
int |
event |
) |
|
Stops listening to some event
- Parameters:
-
void GUI::MouseHandler::listen |
( |
int |
event |
) |
|
Adds an event to listen to
- Parameters:
-
void GUI::MouseHandler::listenToAll |
( |
|
) |
|
Adds all the events to the list of valid events
The documentation for this class was generated from the following files: