IMousePointerHandler

The IMousePointerHandler class sends mouse pointer events to the owner window of the window that the handler is attached to.

By default, the OS/2 and Windows operating systems send mouse pointer events to the owner of the window that the mouse is over. Typically, the owner window allows the default procedure of the window to handle mouse pointer events. The default behavior is to leave the mouse pointer unchanged.

It is often convenient to change the mouse pointer on a frame window-by-frame window basis so that child windows that exist in a frame window use the pointer specified for the frame window. You can change the mouse pointer for a frame window and its children by using IWindow::setMousePointer. To accomplish this behavior, all mouse pointer events that are generated for a frame window and its children must eventually be sent to the frame window. By attaching this handler to the children of a frame window, the mouse pointer events are sent up the owner chain where they can be handled by the frame window.

Open Class Library automatically attaches this handler to its controls that would not otherwise send the mouse pointer event to their owner window.

If you are creating your own control class that does not automatically send mouse pointer events to its owner window, you can get this functionality by attaching an IMousePointerHandler object to objects of your control class.

Except to propagate mouse pointer events up the owner window chain, you do not need to use this class to change the mouse pointer used by a window. To change the mouse pointer, either call IWindow::setMousePointer or create a class derived from IMouseHandler and override the virtual function mousePointerChange.

AIX Considerations

This handler performs no processing on Motif, other than to enable the window to receive a limited number of mouse movement events. IMousePointerHandler does this by passing the style IMouseHandler::someMouseMoves when calling the IMouseHandler constructor.


IMousePointerHandler - Member Functions and Data by Group

Constructors & Destructor

You can construct and destruct objects of this class.


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

Supported Platforms

Windows OS/2 AIX
Yes Yes Ignored


[view class]
IMousePointerHandler
public:
IMousePointerHandler()

Provides the default constructor.

There is no need for you to create an object of this class, however. Instead, use the static function IMousePointerHandler::defaultHandler to obtain a pointer to a static object of this class.

Supported Platforms

Windows OS/2 AIX
Yes Yes Ignored


Event Processing

A mouse-pointer handler provides a specific implementation for a mouse handler by overriding IMouseHandler virtual functions.


[view class]
mousePointerChange
protected:
virtual bool mousePointerChange(IMousePointerEvent& event)

This function processes a pointer-change event by sending it to the event window's owner window.

Supported Platforms

Windows OS/2 AIX
Yes Yes Ignored


Static Object

You can use this class by accessing a static object of this class. You can attach this object to the appropriate windows in your application.


[view class]
defaultHandler
public:
static IMousePointerHandler* defaultHandler()

Returns a pointer to the static object of this class.

Supported Platforms

Windows OS/2 AIX
Yes Yes Ignored


IMousePointerHandler - Inherited Member Functions and Data

Inherited Public Functions

IHandler
IMouseHandler

Inherited Public Data

IMouseHandler

Inherited Protected Functions

IHandler
IMouseHandler

Inherited Protected Data