home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
cset21v1.zip
/
IBMCPP
/
IBMCLASS
/
ICNRHDR.HPP
< prev
next >
Wrap
C/C++ Source or Header
|
1993-10-22
|
8KB
|
129 lines
#ifndef _ICNRHDR_
#define _ICNRHDR_
/*******************************************************************************
* FILE NAME: icnrhdr.hpp *
* *
* DESCRIPTION: *
* Declaration of the class(es): *
* ICnrHandler *
* *
* COPYRIGHT: *
* (C) Copyright IBM Corporation 1992 *
* All Rights Reserved *
* Licensed Materials * Property of IBM *
* *
* HISTORY: *
*******************************************************************************/
#ifndef _IHANDLER_
#include <ihandler.hpp>
#endif
#ifndef _ICNREVT_
#include <icnrevt.hpp>
#endif
/*----------------------------------------------------------------------------*/
/* Align classes on four byte boundary. */
/*----------------------------------------------------------------------------*/
#pragma pack(4)
class ICnrHandler : public IHandler
{
/*******************************************************************************
* The ICnrHandler class provides basic event handling capability for the *
* container. It dispatches the following events in the container: *
* *
* - Scrolling past the container's delta value. *
* - Expanding and collapsing of nodes in a tree view. *
* - An Enter operation using either the keyboard or the mouse. *
* - A change in selection, in-use, or cursored emphasis of an object in the *
* container. *
* - Scrolling of the container window. *
* - A help request in the container. *
*******************************************************************************/
public:
/*------------------------ Constructors ----------------------------------------
| The only way to construct an instance of this class is to use the default |
| constructor. |
------------------------------------------------------------------------------*/
ICnrHandler();
~ICnrHandler();
/*------------------------ Event Processing Functions --------------------------
| These functions must be supplied by a derived class in order to provide |
| processing for an edit event: |
| deltaReached - Called when the container is scrolled to the predefined |
| delta. |
| treeCollapsed - Called when an object is being collapsed in the |
| container. The default behavior is to call the |
| IContainerObject::handleTreeCollapsed function. |
| treeExpanded - Called when an object is being expanded in the container.|
| The default behavior is to call the |
| IContainerObject::handleTreeExpanded function. |
| enter - Called when the Enter key or the mouse select button is |
| used on an object. If the Enter occurs over an object, |
| the default behavior is to call the |
| IContainerObject::handleOpen function. Otherwise, the |
| Enter is ignored. |
| selectedChanged - Called when the selection emphasis of an object changes. |
| The default behavior is to call the |
| IContainerObject::handleSelectChange function. |
| inuseChanged - Called when the in-use emphasis of an object changes. |
| The default behavior is to call the |
| IContainerObject::handleInuseChange function. |
| cursoredChanged - Called when the cursored emphasis of an object changes. |
| The default behavior is to call the |
| IContainerObject::handleCursoredChange function. |
| windowScrolled - Called when the container window is scrolled. The |
| default behavior is to do nothing. |
| help - Called when help is requested in a container. The |
| default behavior is to do nothing. |
------------------------------------------------------------------------------*/
virtual Boolean
deltaReached(ICnrQueryDeltaEvent& event),
treeCollapsed(IContainerObject* collapsedObject, IContainerControl* container),
treeExpanded(IContainerObject* expandedObject, IContainerControl* container),
enter(ICnrEnterEvent& event),
selectedChanged(ICnrEmphasisEvent& event),
inuseChanged(ICnrEmphasisEvent& event),
cursoredChanged(ICnrEmphasisEvent& event),
windowScrolled(ICnrScrollEvent& event),
help(ICnrHelpEvent& 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 ICnrHandler
&handleEventsFor ( IContainerControl* container ),
&stopHandlingEventsFor ( IContainerControl* container );
protected:
/*----------------------------- Implementation ---------------------------------
| This function is used to implement the class: |
| dispatchHandlerEvent - Routes the edit 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