Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Ogre::GuiPressable Class Reference

The listener interface for receiving "interesting" mouse events (press, release, click, enter, and exit) on a component. More...

#include <OgreGuiPressable.h>

Inheritance diagram for Ogre::GuiPressable:

Inheritance graph
[legend]
List of all members.

Public Methods

 GuiPressable (const String &name)
virtual ~GuiPressable ()
void setSource (GuiElement *source)
const StringgetActionCommand () const
void setActionCommand (const String &action)
bool isPressed () const
virtual void setPressed (bool b)
void mouseClicked (MouseEvent *e)
 Invoked when the mouse has been clicked on a component.

void mouseEntered (MouseEvent *e)
 Invoked when the mouse enters a component.

void mouseExited (MouseEvent *e)
 Invoked when the mouse exits a component.

void mousePressed (MouseEvent *e)
 Invoked when a mouse button has been pressed on a component.

void mouseReleased (MouseEvent *e)
 Invoked when a mouse button has been released on a component.

virtual void mouseDragEntered (MouseEvent *e)
virtual void mouseDragExited (MouseEvent *e)
virtual void mouseDragDropped (MouseEvent *e)
virtual bool isMulticaster () const
 Returns whether or not the listener is a multicaster.


Protected Methods

void fireActionPerformed ()

Protected Attributes

String mActionCommand
bool mPressed
bool mButtonDown
GuiElementmSource

Detailed Description

The listener interface for receiving "interesting" mouse events (press, release, click, enter, and exit) on a component.

(To track mouse moves and mouse drags, use the MouseMotionListener.)

The class that is interested in processing a mouse event either implements this interface (and all the methods it contains) or extends the abstract MouseAdapter class (overriding only the methods of interest).

The listener object created from that class is then registered with a component using the component's addMouseListener method. A mouse event is generated when the mouse is pressed, released clicked (pressed and released). A mouse event is also generated when the mouse cursor enters or leaves a component. When a mouse event occurs the relevant method in the listener object is invoked, and the MouseEvent is passed to it.

Definition at line 54 of file OgreGuiPressable.h.


Constructor & Destructor Documentation

Ogre::GuiPressable::GuiPressable const String   name
 

Definition at line 35 of file OgreGuiPressable.cpp.

References mActionCommand, mPressed, and Ogre::String.

virtual Ogre::GuiPressable::~GuiPressable   [virtual]
 

Definition at line 66 of file OgreGuiPressable.h.


Member Function Documentation

void Ogre::GuiPressable::fireActionPerformed   [protected]
 

Definition at line 73 of file OgreGuiPressable.cpp.

References getActionCommand(), mSource, and Ogre::GuiElement::processEvent().

Referenced by mouseClicked(), and Ogre::PopupMenuGuiElement::mouseReleased().

const String & Ogre::GuiPressable::getActionCommand   const
 

Definition at line 49 of file OgreGuiPressable.cpp.

References mActionCommand, and Ogre::String.

Referenced by fireActionPerformed().

virtual bool Ogre::EventListener::isMulticaster   const [virtual, inherited]
 

Returns whether or not the listener is a multicaster.

Reimplemented in Ogre::EventMulticaster.

Definition at line 65 of file OgreEventListeners.h.

Referenced by Ogre::EventMulticaster::convertListenerToMulti(), and Ogre::EventMulticaster::removeInternal().

bool Ogre::GuiPressable::isPressed   const
 

Definition at line 61 of file OgreGuiPressable.cpp.

References mPressed.

Referenced by Ogre::PopupMenuGuiElement::mouseMoved(), Ogre::ButtonGuiElement::updateMaterials(), and Ogre::BorderButtonGuiElement::updateMaterials().

void Ogre::GuiPressable::mouseClicked MouseEvent   e [virtual]
 

Invoked when the mouse has been clicked on a component.

Implements Ogre::MouseListener.

Definition at line 81 of file OgreGuiPressable.cpp.

References fireActionPerformed().

virtual void Ogre::MouseListener::mouseDragDropped MouseEvent   e [virtual, inherited]
 

Definition at line 104 of file OgreEventListeners.h.

Referenced by Ogre::MouseTarget::processMouseEvent().

virtual void Ogre::MouseListener::mouseDragEntered MouseEvent   e [virtual, inherited]
 

Definition at line 102 of file OgreEventListeners.h.

Referenced by Ogre::MouseTarget::processMouseEvent().

virtual void Ogre::MouseListener::mouseDragExited MouseEvent   e [virtual, inherited]
 

Definition at line 103 of file OgreEventListeners.h.

Referenced by Ogre::MouseTarget::processMouseEvent().

void Ogre::GuiPressable::mouseEntered MouseEvent   e [virtual]
 

Invoked when the mouse enters a component.

Implements Ogre::MouseListener.

Definition at line 85 of file OgreGuiPressable.cpp.

void Ogre::GuiPressable::mouseExited MouseEvent   e [virtual]
 

Invoked when the mouse exits a component.

Implements Ogre::MouseListener.

Definition at line 88 of file OgreGuiPressable.cpp.

void Ogre::GuiPressable::mousePressed MouseEvent   e [virtual]
 

Invoked when a mouse button has been pressed on a component.

Implements Ogre::MouseListener.

Definition at line 91 of file OgreGuiPressable.cpp.

References setPressed().

void Ogre::GuiPressable::mouseReleased MouseEvent   e [virtual]
 

Invoked when a mouse button has been released on a component.

Implements Ogre::MouseListener.

Definition at line 95 of file OgreGuiPressable.cpp.

References setPressed().

void Ogre::GuiPressable::setActionCommand const String   action
 

Definition at line 55 of file OgreGuiPressable.cpp.

References mActionCommand, and Ogre::String.

Referenced by Ogre::PopupMenuGuiElement::mouseReleased().

void Ogre::GuiPressable::setPressed bool    b [virtual]
 

Definition at line 67 of file OgreGuiPressable.cpp.

References mPressed.

Referenced by mousePressed(), mouseReleased(), Ogre::BorderButtonGuiElement::setBorderUpMaterialName(), and Ogre::ButtonGuiElement::setUpMaterialName().

void Ogre::GuiPressable::setSource GuiElement   source
 

Definition at line 40 of file OgreGuiPressable.cpp.

References Ogre::MouseTarget::addMouseListener(), and mSource.

Referenced by Ogre::BorderButtonGuiElement::BorderButtonGuiElement(), Ogre::ButtonGuiElement::ButtonGuiElement(), and Ogre::PopupMenuGuiElement::PopupMenuGuiElement().


Member Data Documentation

String Ogre::GuiPressable::mActionCommand [protected]
 

Definition at line 57 of file OgreGuiPressable.h.

Referenced by getActionCommand(), GuiPressable(), and setActionCommand().

bool Ogre::GuiPressable::mButtonDown [protected]
 

Reimplemented in Ogre::ButtonGuiElement.

Definition at line 59 of file OgreGuiPressable.h.

Referenced by Ogre::BorderButtonGuiElement::BorderButtonGuiElement(), and Ogre::BorderButtonGuiElement::updateMaterials().

bool Ogre::GuiPressable::mPressed [protected]
 

Definition at line 58 of file OgreGuiPressable.h.

Referenced by GuiPressable(), isPressed(), and setPressed().

GuiElement* Ogre::GuiPressable::mSource [protected]
 

Definition at line 60 of file OgreGuiPressable.h.

Referenced by fireActionPerformed(), and setSource().


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

Copyright © 2002-2003 by The OGRE Team
Last modified Sun Nov 28 19:51:02 2004