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.
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.
You can construct and destruct objects of this class.
![]() |
public:
virtual ~IMousePointerHandler()
Windows | OS/2 | AIX |
Yes | Yes | Ignored |
![]() |
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.
Windows | OS/2 | AIX |
Yes | Yes | Ignored |
A mouse-pointer handler provides a specific implementation for a mouse handler by overriding IMouseHandler virtual functions.
![]() |
protected:
virtual bool mousePointerChange(IMousePointerEvent& event)
This function processes a pointer-change event by sending it to the event window's owner window.
Windows | OS/2 | AIX |
Yes | Yes | Ignored |
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.
![]() |
public:
static IMousePointerHandler* defaultHandler()
Returns a pointer to the static object of this class.
Windows | OS/2 | AIX |
Yes | Yes | Ignored |
virtual ~IHandler()
virtual IString asDebugInfo() const
virtual IString asString() const
virtual IHandler& disable()
virtual IHandler& enable(bool enable = true)
virtual IHandler& handleEventsFor(IWindow* window)
IHandler()
bool isEnabled() const
virtual IHandler& stopHandlingEventsFor(IWindow* window)
static const Style allMouseMoves
static const Style classDefaultStyle
static const Style mouseEntersLeaves
static const Style noMouseMoves
static const Style someMouseMoves
virtual IEventResult defaultProcedure(IEvent& event)
virtual bool dispatchHandlerEvent(IEvent& event) = 0
virtual bool dispatchHandlerEvent(IEvent& event)
virtual bool mouseClicked(IMouseClickEvent& event)
virtual bool mouseEnter(IEvent& event)
virtual bool mouseLeave(IEvent& event)
virtual bool mouseMoved(IMouseEvent& event)