home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
cset21v1.zip
/
IBMCPP
/
IBMCLASS
/
IPAINHDR.HPP
< prev
next >
Wrap
C/C++ Source or Header
|
1993-10-22
|
7KB
|
115 lines
#ifndef _IPAINHDR_
#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. *
* *
*******************************************************************************/
#ifndef _IHANDLER_
#include <ihandler.hpp>
#endif
#ifndef _IPAINEVT_
#include <ipainevt.hpp>
#endif
/*----------------------------------------------------------------------------*/
/* Align classes on four byte boundary. */
/*----------------------------------------------------------------------------*/
#pragma pack(4)
// Forward declarations for other classes:
class IEvent;
class IPaintHandler : public IHandler {
typedef IHandler
Inherited;
/*******************************************************************************
* Instances of the IPaintHandler class process paint events for all windows *
* and controls. *
* *
* This class is designed to handle paint events that require a window or *
* control to update their appearance on the screen. If the IPaintHandler *
* object is registered to a window or control, it will be called to process *
* the paint event. You can do this by passing the window on the *
* handleEventsFor function of the IPaintHandler object. *
* *
* It processes the paint event by creating an IPaintEvent object and routing *
* it to the appropriate virtual function. The virtual function allows you *
* to supply your own specialized processing of the event. The return values *
* from the virtual function specify whether the paint event should be passed *
* on to another handler object to be processed, as follows: *
* *
* Value Meaning *
* --------------- *
* true - The IPaintEvent has been handled and requires no additional *
* processing. *
* false - The IPaintEvent should be passed to the next handler, as follows: *
* -- If there is another handler for the window, the event is *
* passed on to the next handler. *
* -- If this is the last handler for the window, the event is *
* passed on a call to the window's defaultProcedure function. *
* *
* Example: *
* MyWindow::MyWindow() *
* : ... *
* { *
* MyPaintHandler* pnth = new MyPaintHandler(); *
* ... *
* pnth->handleEventsFor(this); *
* ... *
* show(); *
* } *
* Boolean MyPaintHandler::paintWindow(IPaintEvent& event) *
* { *
* // Processing to update the screen. *
* ... *
* return true; *
* } *
*******************************************************************************/
public:
/*-------------------------- Constructor/Destructor ----------------------------
| The only way to construct instances of this class is to use the default |
| constructor, which does not take any arguments. |
------------------------------------------------------------------------------*/
IPaintHandler ( );
virtual
~IPaintHandler ( );
protected:
/*---------------------------- Event Dispatching -------------------------------
| This function evaluates the event to determine if it is appropriate for |
| this handler object to process. If it is, this function calls the virtual |
| function used to process the event. |
| dispatchHandlerEvent - Calls the appropriate virtual function to process |
| a paint event. |
------------------------------------------------------------------------------*/
virtual Boolean
dispatchHandlerEvent ( IEvent& event );
/*----------------------------- Event Processing -------------------------------
| This function must be supplied by a derived class to process a paint event. |
| paintWindow - Implemented by derived classes to process paint events. |
------------------------------------------------------------------------------*/
virtual Boolean
paintWindow ( IPaintEvent& event ) = 0;
}; // IPaintHandler
/*----------------------------------------------------------------------------*/
/* Resume compiler default packing. */
/*----------------------------------------------------------------------------*/
#pragma pack()
#endif /* _IPAINHDR_ */