home *** CD-ROM | disk | FTP | other *** search
- #ifndef _ISCRLHDR_
- #define _ISCRLHDR_
- /*******************************************************************************
- * FILE NAME: iscrlhdr.hpp *
- * *
- * DESCRIPTION: *
- * Declaration of the class(es): *
- * IScrollHandler - Process scrolling events for an IScrollBar object. *
- * *
- * *
- * COPYRIGHT: *
- * Licensed Materials - Property of IBM *
- * (C) Copyright IBM Corporation 1992, 1993 *
- * All Rights Reserved *
- * US Government Users Restricted Rights - Use, duplication, or disclosure *
- * restricted by GSA ADP Schedule Contract with IBM Corp. *
- * *
- *$Log: R:/IBMCLASS/IBASEAPP/VCS/ISCRLHDR.HPV $ *
- //
- // Rev 1.23 25 Oct 1992 16:57:34 nunn
- // changed library name to ICLUI
- //
- // Rev 1.22 25 Oct 1992 14:25:14 tsuji
- // Format/document in the style of the standard header file.
- *******************************************************************************/
- #ifndef _IHANDLER_
- #include <ihandler.hpp>
- #endif
-
- // Forward declarations for other classes:
- class IScrollHandler; /* scrlh */
- class IScrollEvent;
- class IEvent;
-
- class IScrollHandler : public IHandler {
- /*******************************************************************************
- * This class handles processing of scroll events for the following controls: *
- * IScrollBar. *
- * *
- * The IScrollHandler class is designed to handle events resulting from a user *
- * interacting with an IScrollBar object (for example, when the user clicks the *
- * down arrow of a scroll bar). If registered to the owner of the scroll bar *
- * (by being passed on the addHandler() function of the owner window), the *
- * IScrollHandler object will be called to process the scroll event. It does *
- * this by creating an IScrollEvent object and routing it to the appropriate *
- * virtual function (the virtual functions allow you to supply your own *
- * specialized processing of the event). The return value from the virtual *
- * functions specifies if the IScrollEvent should be passed on to another *
- * handler object to be processed, as described below: *
- * *
- * Value Meaning *
- * ------ -------- *
- * true The IScrollEvent has been handled and requires no additional *
- * processing. *
- * false The IScrollEvent should be passed to the next handler (if this is *
- * the last handler for the owner window, it should be passed on to *
- * the default window procedure). *
- * *
- * EXAMPLE: *
- * MyWindow::MyWindow() // inherits from IFrame, IScrollHandler *
- * : ... *
- * { *
- * addHandler((IHandler*)this); *
- * ... *
- * IScrollBar* sb = new IScrollBar(ID_SB, this, this, IRectangle(...)); *
- * IStaticText* stxtPos = new IStaticText(0, this, this, IRectangle(...)); *
- * ... *
- * show(); *
- * } *
- * Boolean MyWindow::pageUp(IScrollEvent& evt) *
- * { *
- * unsigned long ulPos = sb.sliderPosition(); *
- * stxtPos.setText() = IString(ulPos); // show current scroll position *
- * return false; // let another handle event also *
- * } *
- *******************************************************************************/
- typedef IHandler Inherited;
- public:
- /*------------------------ CONSTRUCTORS/DESTRUCTORS ----------------------------
- | There is 1 way to construct instances of this class: |
- | 1. default constructor |
- ------------------------------------------------------------------------------*/
- IScrollHandler ( ) {;}
-
- /*----------------------- EVENT DISPATCHING INTERFACE --------------------------
- | This function evaluates the event to determine if it is one appropriate for |
- | this handler object to process. If so it calls the virtual function used to |
- | process the event. |
- | dispatchHandlerEvent - invokes the appropriate function if scroll event |
- ------------------------------------------------------------------------------*/
- Boolean
- dispatchHandlerEvent ( IEvent& evt );
-
- protected:
- /*------------------------ EVENT PROCESSING FUNCTIONS --------------------------
- | This function must be supplied by a derived class in order to provide |
- | processing for an input change event. |
- | lineUp - process scroll from pressing the up arrow key or clicking |
- | the up arrow of a vertical scroll bar |
- | lineDown - process scroll from pressing the down arrow key or |
- | clicking the down arrow of a vertical scroll bar |
- | pageUp - process scroll from pressing the page up key or clicking |
- | the area above a vertical scroll bar slider |
- | pageDown - process scroll from pressing the page down key or |
- | clicking the area below a vertical scroll bar slider |
- | lineLeft - process scroll from pressing the left arrow key or |
- | clicking the left arrow of a horizontal scroll bar |
- | lineRight - process scroll from pressing the right arrow key or |
- | clicking the right arrow of a horizontal scroll bar |
- | pageLeft - process scroll from pressing the page left key or |
- | clicking the area left of a horizontal scroll bar slider |
- | pageRight - process scroll from pressing the page right key or |
- | clicking the area right of a horizontal scroll bar slider |
- | sliderTrack - process scroll from each time the position of the scroll |
- | bar slider is changed |
- | sliderDragEnd - process end of scrolling using the scroll bar slider |
- | arrowScrollEnd - process end of scrolling without the scroll bar slider |
- ------------------------------------------------------------------------------*/
- virtual Boolean
- lineUp ( IScrollEvent& evt ) { return false; }
- virtual Boolean
- lineDown ( IScrollEvent& evt ) { return false; }
- virtual Boolean
- pageUp ( IScrollEvent& evt ) { return false; }
- virtual Boolean
- pageDown ( IScrollEvent& evt ) { return false; }
-
- virtual Boolean
- lineLeft ( IScrollEvent& evt ) { return false; }
- virtual Boolean
- lineRight ( IScrollEvent& evt ) { return false; }
- virtual Boolean
- pageLeft ( IScrollEvent& evt ) { return false; }
- virtual Boolean
- pageRight ( IScrollEvent& evt ) { return false; }
-
- virtual Boolean
- sliderTrack ( IScrollEvent& evt ) { return false; }
- virtual Boolean
- sliderDragEnd ( IScrollEvent& evt ) { return false; }
- virtual Boolean
- arrowScrollEnd ( IScrollEvent& evt ) { return false; }
- };
- #endif /* ISCRLHDR */