$treeview $search $mathjax
Stratagus  2.2.7
$projectbrief
$projectbrief
$searchbox
-->
         _________ __                 __
        /   _____//  |_____________ _/  |______     ____  __ __  ______
        \_____  \\   __\_  __ \__  \\   __\__  \   / ___\|  |  \/  ___/
        /        \|  |  |  | \// __ \|  |  / __ \_/ /_/  >  |  /\___ \
       /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
               \/                  \/          \//_____/            \/
    ______________________                           ______________________
                          T H E   W A R   B E G I N S
                   Stratagus - A free fantasy real time strategy game engine

gcn::MouseListener Class Reference

#include <mouselistener.h>

Inheritance diagram for gcn::MouseListener:

gcn::Button gcn::CheckBox gcn::DropDown gcn::ListBox gcn::RadioButton gcn::ScrollArea gcn::Slider gcn::TextBox gcn::TextField gcn::Window

List of all members.


Public Member Functions

virtual ~MouseListener ()
virtual void mouseIn ()
virtual void mouseOut ()
virtual void mousePress (int, int, int)
virtual void mouseRelease (int, int, int)
virtual void mouseClick (int, int, int, int)
virtual void mouseWheelUp (int, int)
virtual void mouseWheelDown (int, int)
virtual void mouseMotion (int, int)

Protected Member Functions

 MouseListener ()

Detailed Description

Mouse listeners base class. 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

See also:
Widget::addMouseListener

Constructor & Destructor Documentation

virtual gcn::MouseListener::~MouseListener (  )  [inline, virtual]

Destructor.

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.


Member Function Documentation

virtual void gcn::MouseListener::mouseIn (  )  [inline, virtual]

Called when the mouse enters into the widget area.

virtual void gcn::MouseListener::mouseOut (  )  [inline, virtual]

Called when the mouse leaves the Widget area.

virtual void gcn::MouseListener::mousePress ( int  ,
int  ,
int   
) [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.

Parameters:
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, gcn::Window, ImageRadioButton, and ImageCheckBox.

virtual void gcn::MouseListener::mouseRelease ( int  ,
int  ,
int   
) [inline, virtual]

Called when a mouse button is released when the mouse is in the Widget area or if the Widget has focus.

Parameters:
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, gcn::Window, ImageRadioButton, and ImageCheckBox.

virtual void gcn::MouseListener::mouseClick ( int  ,
int  ,
int  ,
int   
) [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.

Parameters:
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, gcn::RadioButton, ImageRadioButton, and ImageCheckBox.

virtual void gcn::MouseListener::mouseWheelUp ( int  ,
int   
) [inline, virtual]

Called on a mouse wheel up when the mouse is in the Widget area or if the Widget has focus.

Parameters:
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.

virtual void gcn::MouseListener::mouseWheelDown ( int  ,
int   
) [inline, virtual]

Called on a mouse wheel down when the mouse is in the Widget area or if the Widget has focus.

Parameters:
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.

virtual void gcn::MouseListener::mouseMotion ( int  ,
int   
) [inline, virtual]

Called when the mouse moves and the mouse is in the Widget area or if the Widget has focus.

Parameters:
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, gcn::TextField, and gcn::Window.


The documentation for this class was generated from the following file:
(C) Copyright 1998-2012 by The Stratagus Project under the GNU General Public License.
All trademarks and copyrights on this page are owned by their respective owners.