#include <mouselistener.hpp>
Inheritance diagram for gcn::MouseListener:
Inorder to use this class you must inherit from it and implements it's functions. MouseListeners listen for mouse events on a Widgets. When a Widget recives a mouse event, the corresponding function in all it's mouse listeners will be
Definition at line 72 of file mouselistener.hpp.
Public Member Functions | |
virtual | ~MouseListener () |
Destructor. | |
virtual void | mouseIn () |
Called when the mouse enters into the widget area. | |
virtual void | mouseOut () |
Called when the mouse leaves the Widget area. | |
virtual void | mousePress (int x, int y, int button) |
Called when a mouse button is pressed when the mouse is in the Widget area or if the Widget has focus. | |
virtual void | mouseRelease (int x, int y, int button) |
Called when a mouse button is released when the mouse is in the Widget area or if the Widget has focus. | |
virtual void | mouseClick (int x, int y, int button, int count) |
Called when a mouse button is pressed and released (clicked) when the mouse is in the Widget area or if the Widget has focus. | |
virtual void | mouseWheelUp (int x, int y) |
Called on a mouse wheel up when the mouse is in the Widget area or if the Widget has focus. | |
virtual void | mouseWheelDown (int x, int y) |
Called on a mouse wheel down when the mouse is in the Widget area or if the Widget has focus. | |
virtual void | mouseMotion (int x, int y) |
Called when the mouse moves and the mouse is in the Widget area or if the Widget has focus. | |
Protected Member Functions | |
MouseListener () | |
Constructor. |
gcn::MouseListener::MouseListener | ( | ) | [inline, protected] |
Constructor.
You should not be able to make an instance of MouseListener, therefore its constructor is protected. To use MouseListener you must inherit from this class and implement it's functions.
Definition at line 176 of file mouselistener.hpp.
virtual void gcn::MouseListener::mouseClick | ( | int | x, | |
int | y, | |||
int | button, | |||
int | count | |||
) | [inline, virtual] |
Called when a mouse button is pressed and released (clicked) when the mouse is in the Widget area or if the Widget has focus.
x | the x coordinate of the mouse relative to the Widget itself. | |
y | the y coordinate of the mouse relative to the Widget itself. | |
button | the button clicked. | |
count | the number of clicks. |
Reimplemented in gcn::Button, gcn::CheckBox, and gcn::RadioButton.
Definition at line 132 of file mouselistener.hpp.
virtual void gcn::MouseListener::mouseMotion | ( | int | x, | |
int | y | |||
) | [inline, virtual] |
Called when the mouse moves and the mouse is in the Widget area or if the Widget has focus.
x | the x coordinate of the mouse relative to the Widget itself. | |
y | the y coordinate of the mouse relative to the Widget itself. |
Reimplemented in gcn::ScrollArea, gcn::Slider, and gcn::Window.
Definition at line 165 of file mouselistener.hpp.
virtual void gcn::MouseListener::mousePress | ( | int | x, | |
int | y, | |||
int | button | |||
) | [inline, virtual] |
Called when a mouse button is pressed when the mouse is in the Widget area or if the Widget has focus.
NOTE: A mouse press is NOT equal to a mouse click. Use mouseClickMessage to check for mouse clicks.
x | the x coordinate of the mouse relative to the Widget itself. | |
y | the y coordinate of the mouse relative to the Widget itself. | |
button | the button pressed. |
Reimplemented in gcn::Button, gcn::DropDown, gcn::ListBox, gcn::ScrollArea, gcn::Slider, gcn::TextBox, gcn::TextField, and gcn::Window.
Definition at line 104 of file mouselistener.hpp.
virtual void gcn::MouseListener::mouseRelease | ( | int | x, | |
int | y, | |||
int | button | |||
) | [inline, virtual] |
Called when a mouse button is released when the mouse is in the Widget area or if the Widget has focus.
x | the x coordinate of the mouse relative to the Widget itself. | |
y | the y coordinate of the mouse relative to the Widget itself. | |
button | the button released. |
Reimplemented in gcn::Button, gcn::DropDown, gcn::ScrollArea, gcn::Slider, and gcn::Window.
Definition at line 117 of file mouselistener.hpp.
virtual void gcn::MouseListener::mouseWheelDown | ( | int | x, | |
int | y | |||
) | [inline, virtual] |
Called on a mouse wheel down when the mouse is in the Widget area or if the Widget has focus.
x | the x coordinate of the mouse relative to the Widget itself. | |
y | the y coordinate of the mouse relative to the Widget itself. |
Reimplemented in gcn::ScrollArea.
Definition at line 154 of file mouselistener.hpp.
virtual void gcn::MouseListener::mouseWheelUp | ( | int | x, | |
int | y | |||
) | [inline, virtual] |
Called on a mouse wheel up when the mouse is in the Widget area or if the Widget has focus.
x | the x coordinate of the mouse relative to the Widget itself. | |
y | the y coordinate of the mouse relative to the Widget itself. |
Reimplemented in gcn::ScrollArea.
Definition at line 143 of file mouselistener.hpp.