IMouseMoveConnectionTo

The IMouseMoveConnectionTo class is a template class, derived from IMouseHandler, that processes mouse-movement events. This class allows you to process mouse-movement events in objects that do not derive from IMouseHandler without having to manually derive from IMouseHandler, override the mouseMoved, mouseEnter, or mouseLeave functions, and pass the events to the object.

To use the IMouseMoveConnectionTo class to process mouse-movement events, follow these steps:

  1. Instantiate the IMouseMoveConnectionTo template with a class containing member functions whose signature and behavior are the same as IMouseHandler::mouseMoved, IMouseHandler::mouseEnter, and IMouseHandler::mouseLeave.
  2. Construct an object of the new template class by passing the object and the address of all three functions handling the corresponding mouse events.
  3. Attach the template mouse handler by using IMouseHandler::handleEventsFor to pass the appropriate window to the mouse-movement handler.

You can also process one or two out of the three mouse events by specifying a null value on the constructor for the address of the members that you do not want to process.

You use an IMouseMoveConnectionTo object anywhere you use an IMouseHandler object. See the description of IMouseHandler for the uses and limitations of this class.


IMouseMoveConnectionTo - Member Functions and Data by Group

Constructors & Destructor

You can construct and destruct objects of this class.


[view class]
~IMouseMoveConnectionTo
public:
virtual ~IMouseMoveConnectionTo()

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
IMouseMoveConnectionTo
public:
IMouseMoveConnectionTo( ATarget& target, MoveMemberFunction moveMemberFunction = 0, EnterMemberFunction enterMemberFunction = 0, LeaveMemberFunction leaveMemberFunction = 0 )

Constructs the IMouseMoveConnectionTo object.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Event Processing

These members are overridden to route mouse-movement events to the target object that you provided on construction.


[view class]
mouseEnter
protected:
virtual bool mouseEnter(IEvent& event)

Processes events that signal when the mouse pointer has entered the window. This function is overridden to route these events to the enterMemberFunction function of the target object that you specified when constructing the handler. This function returns false if you did not provide an enterMemberFunction function.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
mouseLeave
protected:
virtual bool mouseLeave(IEvent& event)

Processes events that signal when the mouse pointer has exited the window. This function is overridden to route these events to the the leaveMemberFunction function of the target object that you specified when constructing the handler. This function returns false if you did not provide a leaveMemberFunction function.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
mouseMoved
protected:
virtual bool mouseMoved(IMouseEvent& event)

Overridden to route mouse-movement events to the moveMemberFunction function of the target object that you specified when constructing the handler. This function returns false if you did not provide a moveMemberFunction function.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


IMouseMoveConnectionTo - Type Definitions


[view class]
LeaveMemberFunction
typedef bool (ATarget::*LeaveMemberFunction)(IEvent&)

A pointer to a member function of class ATarget that takes a reference to an IEvent and returns a bool.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
EnterMemberFunction
typedef bool (ATarget::*EnterMemberFunction)(IEvent&)

A pointer to a member function of class ATarget that takes a reference to an IEvent and returns a bool.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
MoveMemberFunction
typedef bool (ATarget::*MoveMemberFunction)(IMouseEvent&)

A pointer to a member function of class ATarget that takes a reference to an IMouseEvent and returns a bool.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


IMouseMoveConnectionTo - Inherited Member Functions and Data

Inherited Public Functions

IHandler
IMouseHandler

Inherited Public Data

IMouseHandler

Inherited Protected Functions

IHandler
IMouseHandler

Inherited Protected Data