The IScrollHandler class handles events resulting from a user interacting with an IScrollBar object, such as when the user clicks on the down scroll button of a scroll bar.
Create a handler derived from IScrollHandler and attach it to a scroll bar's owner window. You can do this by calling IHandler::handleEventsFor to pass the owner window to the scroll handler.
When the scroll handler receives a scroll event, it creates an IScrollEvent object and routes that object to the appropriate IScrollHandler virtual function. Override these virtual functions to supply your own specialized processing of a scroll event.
The return value from the virtual functions specifies whether the scroll event is passed on for additional processing, as follows:
Scroll events are not dispatched to the IScrollBar object itself, but to the IScrollBar's owner window.
The Motif scroll bar has slightly different characteristics than the OS/2 and Windows scroll bars. The Presentation Manager and Windows scroll box does not automatically scroll to a new position when the user requests a change in position, unless the user drags the scroll box. The IScrollHandler can move the scroll box by calling moveScrollBox with the IScrollEvent object.
In contrast, the Motif version of the scroll bar uses the XmScrollBar widget, which automatically moves the scroll box to its new position before the event is dispatched to this handler.
You can obtain portable code by always calling moveScrollBox and using the IScrollEvent to determine the new position. The Presentation Manager and Windows versions move the scroll box to the new location and the Motif version moves the scroll box to its current position.
Constructors & DestructorYou can construct and destruct objects of this class.
![]() |
public:
virtual ~IScrollHandler()
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
![]() |
public:
IScrollHandler()
This is the default constructor and accepts no parameters.
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
Event DispatchingEvent-dispatching members evaluate an event to determine if it is appropriate for this handler object to process it. If it is, it calls the virtual function used to process the event.
![]() |
protected:
virtual bool dispatchHandlerEvent(IEvent& event)
If a scroll event is received, the appropriate virtual function is called.
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
Event ProcessingEvent-processing members must be supplied to process a scroll event. You can override these virtual members in a derived class.
![]() |
protected:
virtual bool lineDown(IScrollEvent& event)
Scrolls down one line. Derived classes implement this function to process a scroll event that a user initiates by selecting the down scroll button of a vertical scroll bar.
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
![]() |
protected:
virtual bool lineLeft(IScrollEvent& event)
Scrolls left one line. Derived classes implement this function to process a scroll event that a user initiates by selecting the left scroll button of a horizontal scroll bar.
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
![]() |
protected:
virtual bool lineRight(IScrollEvent& event)
Scrolls right one line. Derived classes implement this function to process a scroll event that a user initiates by selecting the right scroll button of a horizontal scroll bar.
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
![]() |
protected:
virtual bool lineUp(IScrollEvent& event)
Scrolls up one line. Derived classes implement this function to process a scroll event that a user initiates by selecting the up scroll button of a vertical scroll bar.
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
![]() |
protected:
virtual bool pageDown(IScrollEvent& event)
Scrolls down one page. Derived classes implement this function to process a scroll event that a user initiates by selecting the scroll shaft below the scroll box of a vertical scroll bar.
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
![]() |
protected:
virtual bool pageLeft(IScrollEvent& event)
Scrolls left one page. Derived classes implement this function to process a scroll event that a user initiates by selecting the scroll shaft to the left of the scroll box of a horizontal scroll bar.
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
![]() |
protected:
virtual bool pageRight(IScrollEvent& event)
Scrolls right one page. Derived classes implement this function to process a scroll event that a user initiates by selecting the scroll shaft to the right of the scroll box of a horizontal scroll bar.
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
![]() |
protected:
virtual bool pageUp(IScrollEvent& event)
Scrolls up one page. Derived classes implement this function to process a scroll event that a user initiates by selecting the scroll shaft above the scroll box of a vertical scroll bar.
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
![]() |
protected:
virtual bool scrollBoxTrack(IScrollEvent& event)
Tracks the movement of the scroll box. Derived classes implement this function to process a scroll event that a user initiates by dragging the scroll box with the mouse.
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
![]() |
protected:
virtual bool scrollBoxTrackEnd(IScrollEvent& event)
Ends the tracking of scroll box movement. Derived classes implement this function to process the end of a scroll event. Tracking ends when the user stops dragging the scroll box with the mouse.
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
![]() |
protected:
virtual bool scrollEnd(IScrollEvent& event)
Ends a scroll event. Derived classes implement this function to process the end of a scroll event not caused by moving the scroll box. For example, the user releases the mouse button after clicking on a scroll button or scroll shaft.
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
ImplementationThese members are called by many of the virtual functions to provide some default processing of a scroll event.
![]() |
protected:
virtual IScrollHandler& moveScrollBox(IScrollEvent& event)
Positions the scroll box based on the scroll event.
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
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)
virtual IEventResult defaultProcedure(IEvent& event)
virtual bool dispatchHandlerEvent(IEvent& event) = 0