home *** CD-ROM | disk | FTP | other *** search
- #ifndef _ISPINHDR_
- #define _ISPINHDR_
- /*******************************************************************************
- * FILE NAME: ispinhdr.hpp *
- * *
- * DESCRIPTION: *
- * Declaration of the class(es): *
- * ISpinHandler - Process a spin event for a control. *
- * *
- * *
- * 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/ISPINHDR.HPV $ *
- //
- // Rev 1.23 25 Oct 1992 16:57:46 nunn
- // changed library name to ICLUI
- //
- // Rev 1.22 25 Oct 1992 14:25:16 tsuji
- // Format/document in the style of the standard header file.
- *******************************************************************************/
- #ifndef _IHANDLER_
- #include <ihandler.hpp>
- #endif
-
- // Forward declarations for other classes:
- class ISpinHandler; /* spnh */
- class IControlEvent;
- class IEvent;
-
- class ISpinHandler : public IHandler {
- /*******************************************************************************
- * This class handles processing of spin events for the following controls: *
- * ISpinButton. *
- * *
- * The ISpinHandler class is designed to handle events resulting from a user *
- * interacting with a spin button control (for example, when the user presses *
- * the down arrow key in a spin button). If registered to the appropriate *
- * window (by being passed on the addHandler() function of the control or the *
- * owner window of the control), the ISpinHandler object will be called to *
- * process the spin event. It does this by creating an IControlEvent 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 IControlEvent *
- * should be passed on to another handler object to be processed, as described *
- * below: *
- * *
- * Value Meaning *
- * ------ -------- *
- * true The IControlEvent has been handled and requires no additional *
- * processing. *
- * false The IControlEvent should be passed to the next handler (if this is *
- * the last handler for the control it should be passed on the first *
- * handler of the owner for the control, and if the last handler for *
- * the owner window it should be passed on the default window *
- * procedure). *
- * *
- * EXAMPLE: *
- * MyWindow::MyWindow() *
- * : ... *
- * { *
- * MySpinHandler* spnh = new MySpinHandler(); *
- * ... *
- * ISpinButton* spb = new ISpinButton(ID_SB, this, this, IRectangle(...)); *
- * spb->addHandler(spnh); *
- * ... *
- * show(); *
- * } *
- * Boolean MySpinHandler::spinEnded(IControlEvent& evt) *
- * { *
- * Boolean bProcessed = false; *
- * // do some processing *
- * ... *
- * return bProcessed; *
- * } *
- *******************************************************************************/
- typedef IHandler Inherited;
- public:
- /*------------------------ CONSTRUCTORS/DESTRUCTORS ----------------------------
- | There is 1 way to construct instances of this class: |
- | 1. default constructor |
- ------------------------------------------------------------------------------*/
- ISpinHandler ( ) {;}
-
- /*----------------------- 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 spin 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. |
- | arrowUp - function used to process pressing of the up arrow key or |
- | clicking the up arrow of the spin button |
- | arrowDown - function used to process pressing of the down arrow key or |
- | clicking the down arrow of the spin button |
- | spinEnded - function used to process the release of an arrow key or the |
- | mouse button while spinning the spin button |
- ------------------------------------------------------------------------------*/
- virtual Boolean
- arrowUp ( IControlEvent& evt ) { return false; }
- virtual Boolean
- arrowDown ( IControlEvent& evt ) { return false; }
- virtual Boolean
- spinEnded ( IControlEvent& evt ) { return false; }
- };
- #endif /* ISPINHDR */