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

Public Member Functions | Protected Member Functions | List of all members
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 LuaActionListener

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

◆ ~MouseListener()

virtual gcn::MouseListener::~MouseListener ( )
inlinevirtual

Destructor.

◆ MouseListener()

gcn::MouseListener::MouseListener ( )
inlineprotected

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

◆ mouseClick()

virtual void gcn::MouseListener::mouseClick ( int  ,
int  ,
int  ,
int   
)
inlinevirtual

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
xthe x coordinate of the mouse relative to the Widget itself.
ythe y coordinate of the mouse relative to the Widget itself.
buttonthe button clicked.
countthe number of clicks.

Reimplemented in LuaActionListener, gcn::RadioButton, ImageCheckBox, gcn::CheckBox, gcn::Button, and ImageRadioButton.

◆ mouseIn()

virtual void gcn::MouseListener::mouseIn ( )
inlinevirtual

Called when the mouse enters into the widget area.

Reimplemented in LuaActionListener.

◆ mouseMotion()

virtual void gcn::MouseListener::mouseMotion ( int  ,
int   
)
inlinevirtual

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

Parameters
xthe x coordinate of the mouse relative to the Widget itself.
ythe y coordinate of the mouse relative to the Widget itself.

Reimplemented in LuaActionListener, gcn::ScrollArea, gcn::Window, gcn::Slider, and gcn::TextField.

◆ mouseOut()

virtual void gcn::MouseListener::mouseOut ( )
inlinevirtual

Called when the mouse leaves the Widget area.

Reimplemented in LuaActionListener.

◆ mousePress()

virtual void gcn::MouseListener::mousePress ( int  ,
int  ,
int   
)
inlinevirtual

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
xthe x coordinate of the mouse relative to the Widget itself.
ythe y coordinate of the mouse relative to the Widget itself.
buttonthe button pressed.

Reimplemented in LuaActionListener, ImageListBox, gcn::ScrollArea, gcn::Window, gcn::TextBox, gcn::DropDown, gcn::Slider, ImageCheckBox, gcn::TextField, gcn::Button, gcn::ListBox, and ImageRadioButton.

◆ mouseRelease()

virtual void gcn::MouseListener::mouseRelease ( int  ,
int  ,
int   
)
inlinevirtual

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

Parameters
xthe x coordinate of the mouse relative to the Widget itself.
ythe y coordinate of the mouse relative to the Widget itself.
buttonthe button released.

Reimplemented in LuaActionListener, gcn::ScrollArea, gcn::Window, gcn::DropDown, gcn::Slider, ImageCheckBox, gcn::Button, and ImageRadioButton.

◆ mouseWheelDown()

virtual void gcn::MouseListener::mouseWheelDown ( int  ,
int   
)
inlinevirtual

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

Parameters
xthe x coordinate of the mouse relative to the Widget itself.
ythe y coordinate of the mouse relative to the Widget itself.

Reimplemented in LuaActionListener, and gcn::ScrollArea.

◆ mouseWheelUp()

virtual void gcn::MouseListener::mouseWheelUp ( int  ,
int   
)
inlinevirtual

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

Parameters
xthe x coordinate of the mouse relative to the Widget itself.
ythe y coordinate of the mouse relative to the Widget itself.

Reimplemented in LuaActionListener, and gcn::ScrollArea.


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.