home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
cset21v1.zip
/
IBMCPP
/
IBMCLASS
/
ISIZEHDR.HPP
< prev
next >
Wrap
C/C++ Source or Header
|
1993-10-22
|
7KB
|
114 lines
#ifndef _ISIZEHDR_
#define _ISIZEHDR_
/*******************************************************************************
* FILE NAME: isizehdr.hpp *
* *
* DESCRIPTION: *
* Declaration of the class(es): *
* IResizeHandler - Process a resizing 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 _ISIZEEVT_
#include <isizeevt.hpp>
#endif
/*----------------------------------------------------------------------------*/
/* Align classes on four byte boundary. */
/*----------------------------------------------------------------------------*/
#pragma pack(4)
// Forward declarations for other classes:
class IEvent;
class IResizeHandler : public IHandler {
typedef IHandler
Inherited;
/*******************************************************************************
* The IResizeHandler class handles the notification that a window or control *
* has been resized. *
* *
* A resizing event notifies a window or control that it has grown or shrunk *
* on the screen. If the IResizeHandler object is attached to a window or *
* control, it will be called to process the resizing event. You can attach *
* an IResizeHandler object to a window or control by passing the window or *
* control to the handleEventsFor function of the IResizeHandler object. *
* *
* IResizeHandler processes the resizing event by creating an IResizeEvent *
* object and routing it to the virtual windowResize function. This virtual *
* function allows you to supply your own specialized processing of the event. *
* The return value from the virtual function specifies whether the *
* IResizeEvent should be passed on for additional processing, as follows: *
* *
* Value Meaning *
* --------------- *
* true - The IResizeEvent object has been handled and requires no *
* additional processing. *
* false - The IResizeEvent object should be passed to the next handler. If *
* the next handler is the last handler for the window or control, *
* the event is passed on a call to the window or control's *
* defaultProcedure function (see IWindow::defaultProcedure). *
* *
* Example: *
* MyWindow::MyWindow() *
* : ... *
* { *
* MyResizeHandler* szh = new MyResizeHandler(); *
* ... *
* szh.handleEventsFor(this); *
* ... *
* show(); *
* } *
* Boolean MyResizeHandler::windowResize(IResizeEvent& evt) *
* { *
* // Specialized processing here. *
* ... *
* return false; *
* } *
*******************************************************************************/
public:
/*-------------------------- Constructor/Destructor ----------------------------
| The only way to construct instances of this class is by using the default |
| constructor, which takes no arguments. |
------------------------------------------------------------------------------*/
IResizeHandler ( );
virtual
~IResizeHandler ( );
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 windowResize function if a resize event |
| is found. |
------------------------------------------------------------------------------*/
virtual Boolean
dispatchHandlerEvent ( IEvent& event );
/*----------------------------- Event Processing -------------------------------
| This function must be supplied by a derived class to process a resizing |
| event. |
| windowResize - Implemented by a derived class to handle a resizing event. |
------------------------------------------------------------------------------*/
virtual Boolean
windowResize ( IResizeEvent& event ) = 0;
}; // IResizeHandler
/*----------------------------------------------------------------------------*/
/* Resume compiler default packing. */
/*----------------------------------------------------------------------------*/
#pragma pack()
#endif /* _ISIZEHDR_ */