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

Ogre::GuiControl Class Reference

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

#include <OgreGuiControl.h>

Inheritance diagram for Ogre::GuiControl:

Inheritance graph
[legend]
Collaboration diagram for Ogre::GuiControl:

Collaboration graph
[legend]
List of all members.

Public Methods

 GuiControl (const String &name)
virtual ~GuiControl ()
void processEvent (InputEvent *e)
const StringgetActionCommand () const
void setActionCommand (const String &action)
bool isPressed () const
virtual void setPressed (bool b)
bool isEnabled () const
virtual void setEnabled (bool b)
bool isMouseWithin () const
virtual void setMouseWithin (bool b)
void processActionEvent (ActionEvent *e)
void addActionListener (ActionListener *l)
void removeActionListener (ActionListener *l)

Protected Methods

void fireActionPerformed ()

Protected Attributes

String mActionCommand
bool mPressed
bool mMouseWithin
bool mButtonDown
bool mEnabled
ActionListenermActionListener

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


Constructor & Destructor Documentation

Ogre::GuiControl::GuiControl const String   name
 

Definition at line 34 of file OgreGuiControl.cpp.

References mActionCommand, mEnabled, mMouseWithin, and mPressed.

virtual Ogre::GuiControl::~GuiControl   [virtual]
 

Definition at line 67 of file OgreGuiControl.h.


Member Function Documentation

void Ogre::ActionTarget::addActionListener ActionListener   l [inherited]
 

Definition at line 61 of file OgreActionTarget.cpp.

References Ogre::ActionTarget::mActionListener.

Referenced by Ogre::ScrollBarGuiElement::setDownButtonName(), and Ogre::ScrollBarGuiElement::setUpButtonName().

void Ogre::GuiControl::fireActionPerformed   [protected]
 

Definition at line 140 of file OgreGuiControl.cpp.

References getActionCommand(), and processEvent().

Referenced by processEvent().

const String & Ogre::GuiControl::getActionCommand   const
 

Definition at line 82 of file OgreGuiControl.cpp.

References mActionCommand.

Referenced by fireActionPerformed().

bool Ogre::GuiControl::isEnabled   const
 

Definition at line 106 of file OgreGuiControl.cpp.

References mEnabled.

bool Ogre::GuiControl::isMouseWithin   const
 

Definition at line 128 of file OgreGuiControl.cpp.

References mMouseWithin.

bool Ogre::GuiControl::isPressed   const
 

Definition at line 94 of file OgreGuiControl.cpp.

References mPressed.

void Ogre::ActionTarget::processActionEvent ActionEvent   e [inherited]
 

Definition at line 45 of file OgreActionTarget.cpp.

References Ogre::ActionListener::actionPerformed(), Ogre::InputEvent::getID(), and Ogre::ActionTarget::mActionListener.

Referenced by Ogre::GuiElement::processEvent(), and processEvent().

void Ogre::GuiControl::processEvent InputEvent   e [virtual]
 

Implements Ogre::EventTarget.

Definition at line 45 of file OgreGuiControl.cpp.

References fireActionPerformed(), Ogre::InputEvent::getID(), Ogre::InputEvent::isConsumed(), mEnabled, Ogre::ActionTarget::processActionEvent(), setMouseWithin(), and setPressed().

Referenced by fireActionPerformed().

void Ogre::ActionTarget::removeActionListener ActionListener   l [inherited]
 

Definition at line 71 of file OgreActionTarget.cpp.

References Ogre::ActionTarget::mActionListener.

void Ogre::GuiControl::setActionCommand const String   action
 

Definition at line 88 of file OgreGuiControl.cpp.

References mActionCommand.

void Ogre::GuiControl::setEnabled bool    b [virtual]
 

Definition at line 112 of file OgreGuiControl.cpp.

References mButtonDown, mEnabled, mMouseWithin, and mPressed.

void Ogre::GuiControl::setMouseWithin bool    b [virtual]
 

Definition at line 134 of file OgreGuiControl.cpp.

References mMouseWithin.

Referenced by processEvent().

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

Definition at line 100 of file OgreGuiControl.cpp.

References mPressed.

Referenced by processEvent().


Member Data Documentation

String Ogre::GuiControl::mActionCommand [protected]
 

Definition at line 57 of file OgreGuiControl.h.

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

ActionListener* Ogre::ActionTarget::mActionListener [protected, inherited]
 

Definition at line 58 of file OgreActionTarget.h.

Referenced by Ogre::ActionTarget::ActionTarget(), Ogre::ActionTarget::addActionListener(), Ogre::ActionTarget::processActionEvent(), and Ogre::ActionTarget::removeActionListener().

bool Ogre::GuiControl::mButtonDown [protected]
 

Definition at line 60 of file OgreGuiControl.h.

Referenced by setEnabled().

bool Ogre::GuiControl::mEnabled [protected]
 

Definition at line 61 of file OgreGuiControl.h.

Referenced by GuiControl(), isEnabled(), processEvent(), and setEnabled().

bool Ogre::GuiControl::mMouseWithin [protected]
 

Definition at line 59 of file OgreGuiControl.h.

Referenced by GuiControl(), isMouseWithin(), setEnabled(), and setMouseWithin().

bool Ogre::GuiControl::mPressed [protected]
 

Definition at line 58 of file OgreGuiControl.h.

Referenced by GuiControl(), isPressed(), setEnabled(), and setPressed().


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

Copyright © 2002-2003 by The OGRE Team
Last modified Wed Jan 21 00:17:33 2004