home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
cset21v1.zip
/
IBMCPP
/
IBMCLASS
/
ICNRDIHD.HPP
< prev
next >
Wrap
C/C++ Source or Header
|
1993-10-22
|
7KB
|
129 lines
#ifndef _ICNRDIHD_
#define _ICNRDIHD_
/*******************************************************************************
* FILE NAME: icnrdihd.h *
* *
* DESCRIPTION: *
* ICnrDrawHandler *
* *
* 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 _ICNRDIEV_
#include <icnrdiev.hpp>
#endif
/*----------------------------------------------------------------------------*/
/* Align classes on four byte boundary. */
/*----------------------------------------------------------------------------*/
#pragma pack(4)
class IControl;
class IContainerControl;
class ICnrDrawHandler : public IHandler
{
typedef IHandler
Inherited;
/*******************************************************************************
* The ICnrDrawHandler class provides the notification of draw item and draw *
* background events in the container. *
* *
* In order for draw item events to be dispatched, the *
* IContainerControl::drawItem style must be specified on construction of the *
* container or the IContainerControl::enableDrawItem function must be called *
* after the container is constructed. *
* *
* Similarly, for draw background events to be dispatched, the *
* IContainerControl::drawBackground style must be specified on construction *
* of the container or the IContainerControl::enableDrawBackground function *
* must be called after the container is constructed. *
* *
* In addition, whenever the application draws a container item or background, *
* it should call IEvent::setResult(true) so that the system knows not to do *
* the drawing. *
*******************************************************************************/
public:
/*------------------------ Constructors ----------------------------------------
| The only way to construct an instance of this class is to use the default |
| constructor. |
------------------------------------------------------------------------------*/
ICnrDrawHandler ( );
~ICnrDrawHandler ( );
/*------------------------ Event Processing ------------------------------------
| These functions must be supplied by a derived class in order to provide |
| processing for a draw event: |
| drawText - Called when the text in the icon, name, or text view |
| needs to be redrawn. The emphasis of the text must be |
| drawn during the processing of this event. |
| drawIcon - Called when the icon in the icon or name view needs to |
| be redrawn. The emphasis of the icon must be drawn |
| during the processing of this event. |
| drawTreeIcon - Called in the tree view when the expanded or collapsed |
| icon needs to be redrawn. |
| drawDetailsItem - Called in the details view when the data of an object |
| in a column needs to be redrawn. The emphasis of the |
| data must be drawn during the processing of this event. |
| drawTitle - Called when the title of the container needs to be |
| redrawn. |
| drawBackground - Called when the background of the container needs to be |
| redrawn. |
------------------------------------------------------------------------------*/
virtual Boolean
drawText ( ICnrDrawItemEvent& event),
drawIcon ( ICnrDrawItemEvent& event),
drawTreeIcon ( ICnrDrawItemEvent& event),
drawDetailsItem ( ICnrDrawItemEvent& event),
drawTitle ( ICnrDrawItemEvent& event),
drawBackground ( ICnrDrawBackgroundEvent& event);
/*---------------------------- Window Attachment -------------------------------
| These functions permit attaching and detaching the handler object to and |
| from a container window: |
| handleEventsFor - Attaches the handler to the container control |
| passed in the argument. |
| stopHandlingEventsFor - Detaches the handler from the container control |
| passed in the argument. |
------------------------------------------------------------------------------*/
virtual ICnrDrawHandler
&handleEventsFor ( IContainerControl* container ),
&stopHandlingEventsFor ( IContainerControl* container );
protected:
/*----------------------------- Implementation ---------------------------------
| This function is used to implement the class: |
| dispatchHandlerEvent - Routes the draw events to the appropriate event |
| functions. |
------------------------------------------------------------------------------*/
virtual Boolean
dispatchHandlerEvent ( IEvent& event);
private:
/* Hidden functions */
virtual IHandler
&handleEventsFor ( IWindow* window ),
&stopHandlingEventsFor ( IWindow* window );
};
/*----------------------------------------------------------------------------*/
/* Resume compiler default packing. */
/*----------------------------------------------------------------------------*/
#pragma pack()
#endif