IMouseClickConnectionTo

The IMouseClickConnectionTo class is a template class, derived from IMouseHandler, that processes mouse-click events. This class allows you to process mouse-click events in objects that do not derive from IMouseHandler without having to manually derive from IMouseHandler, override the mouseClicked function, and pass the events to the object.

To use the IMouseClickConnectionTo class to process mouse-click events, follow these steps:

  1. Instantiate the IMouseClickConnectionTo template with a class containing a member function whose signature and behavior are the same as IMouseHandler::mouseClicked.
  2. Construct an object of the new template class by passing the object and the address of the function handling the mouse-click events.
  3. Attach the template mouse-click handler by using IMouseHandler::handleEventsFor to pass the appropriate window to the mouse-click handler.

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


IMouseClickConnectionTo - Member Functions and Data by Group

Constructors & Destructor

You can construct and destruct IMouseClickConnectionTo objects.


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

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
IMouseClickConnectionTo
public:
IMouseClickConnectionTo( ATarget& target, ClickMemberFunction clickMemberFunction )

Constructs the IMouseClickConnectionTo object.

This constructor passes the IMouseHandler::noMouseMoves style to the IMouseHandler constructor.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Event Processing

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


[view class]
mouseClicked
protected:
virtual bool mouseClicked(IMouseClickEvent& event)

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

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


IMouseClickConnectionTo - Type Definitions


[view class]
ClickMemberFunction
typedef bool (ATarget::*ClickMemberFunction)(IMouseClickEvent&)

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

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


IMouseClickConnectionTo - Inherited Member Functions and Data

Inherited Public Functions

IHandler
IMouseHandler

Inherited Public Data

IMouseHandler

Inherited Protected Functions

IHandler
IMouseHandler

Inherited Protected Data