____                _       __
    / __ )____  _____   | |     / /___ ___________
   / __  / __ \/ ___/   | | /| / / __ `/ ___/ ___/
  / /_/ / /_/ (__  )    | |/ |/ / /_/ / /  (__  )
 /_____/\____/____/     |__/|__/\__,_/_/  /____/

       A futuristic real-time strategy game.
          This file is part of Bos Wars.
(C) Copyright 2001-2007 by the Bos Wars and Stratagus Project. Distributed under the "GNU General Public License"

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 x, int y, int button)
virtual void mouseRelease (int x, int y, int button)
virtual void mouseClick (int x, int y, int button, int count)
virtual void mouseWheelUp (int x, int y)
virtual void mouseWheelDown (int x, int y)
virtual void mouseMotion (int x, int y)

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

Definition at line 72 of file mouselistener.h.


Constructor & Destructor Documentation

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

Destructor.

Definition at line 79 of file mouselistener.h.

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.h.


Member Function Documentation

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

Called when the mouse enters into the widget area.

Definition at line 84 of file mouselistener.h.

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

Called when the mouse leaves the Widget area.

Definition at line 89 of file mouselistener.h.

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.

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.

Definition at line 104 of file mouselistener.h.

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.

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.

Definition at line 117 of file mouselistener.h.

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.

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.

Definition at line 132 of file mouselistener.h.

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.

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.

Definition at line 143 of file mouselistener.h.

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.

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.

Definition at line 154 of file mouselistener.h.

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.

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.

Definition at line 165 of file mouselistener.h.


The documentation for this class was generated from the following file:

Generated on Sat Feb 21 00:28:26 2009 for Bos Wars by  doxygen 1.5.6