home *** CD-ROM | disk | FTP | other *** search
- #ifndef _IPAINTH_
- #define _IPAINHDR_
- /*******************************************************************************
- * FILE NAME: ipainhdr.hpp *
- * *
- * DESCRIPTION: *
- * Declaration of the class(es): *
- * IPaintHandler - Process a paint event for a window/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: S:/ibmclass/ibaseapp/vcs/ipainhdr.hpv $ *
- //
- // Rev 1.21 26 Oct 1992 00:36:04 tsuji
- // Format/document in the style of the standard header file.
- *******************************************************************************/
- #ifndef _IHANDLER_
- #include <ihandler.hpp>
- #endif
-
- // Forward declarations for other classes:
- class IPaintHandler; /* pnth */
- class IPaintEvent;
- class IEvent;
-
- class IPaintHandler : public IHandler {
- /*******************************************************************************
- * This class handles processing of paint events for all windows and controls. *
- * *
- * The IPaintHandler class is designed to handle paint events, which require *
- * a window or control to update its appearance on the screen. If registered *
- * to a window or control (by being passed on a call to its addHandler() *
- * function), the IPaintHandler object will be called to process the paint *
- * event. It does this by creating an IPaintEvent object and routing it to the *
- * virtual paintWindow() function (this virtual function allows you to supply *
- * your own specialized processing of the event). The return value from the *
- * virtual function specifies if the IControlEvent should be passed on to *
- * another handler object to be processed, as described below: *
- * *
- * Value Meaning *
- * ------ -------- *
- * true The IPaintEvent has been handled and requires no additional *
- * processing. *
- * false The IPaintEvent should be passed to the next handler (if this is *
- * the last handler for the window or control it should be passed on *
- * to the default window procedure). *
- * *
- * EXAMPLE: *
- * MyWindow::MyWindow() *
- * : ... *
- * { *
- * MyPaintHandler* pnth = new MyPaintHandler(); *
- * ... *
- * addHandler(pnth); *
- * ... *
- * show(); *
- * } *
- * Boolean MyPaintHandler::paintWindow(IPaintEvent& evt) *
- * { *
- * // Processing to update the screen. *
- * ... *
- * return true; *
- * } *
- *******************************************************************************/
- typedef IHandler Inherited;
- public:
- /*------------------------ CONSTRUCTORS/DESTRUCTORS ----------------------------
- | There is 1 way to construct instances of this class: |
- | 1. default constructor |
- ------------------------------------------------------------------------------*/
- IPaintHandler ( ) {;}
-
- /*----------------------- 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 paintWindow function if paint event |
- ------------------------------------------------------------------------------*/
- Boolean
- dispatchHandlerEvent ( IEvent& evt );
-
- protected:
- /*------------------------ EVENT PROCESSING FUNCTIONS --------------------------
- | This function must be supplied by a derived class in order to provide |
- | processing for a paint event. |
- | paintWindow - function used to process the paint event |
- ------------------------------------------------------------------------------*/
- virtual Boolean
- paintWindow ( IPaintEvent& evt ) = 0;
- };
- #endif /* IPAINHDR */