home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
cset21v1.zip
/
IBMCPP
/
IBMCLASS
/
ICNRMHDR.HPP
< prev
next >
Wrap
C/C++ Source or Header
|
1993-10-22
|
7KB
|
126 lines
#ifndef _ICNRMHDR_
#define _ICNRMHDR_
/*******************************************************************************
* FILE NAME: icnrmhdr.hpp *
* *
* DESCRIPTION: *
* Declaration of the class(es): *
* ICnrMenuHandler *
* *
* COPYRIGHT: *
* (C) Copyright IBM Corporation 1992 *
* All Rights Reserved *
* Licensed Materials * Property of IBM *
* *
* HISTORY: *
*******************************************************************************/
#ifndef _IMENUHDR_
#include <imenuhdr.hpp>
#endif
#ifndef _IEVENT_
#include <ievent.hpp>
#endif
/*----------------------------------------------------------------------------*/
/* Align classes on four byte boundary. */
/*----------------------------------------------------------------------------*/
#pragma pack(4)
class IContainerObject;
class IContainerControl;
class ICnrMenuHandler : public IMenuHandler
{
typedef IMenuHandler
Inherited;
/*******************************************************************************
* The ICnrMenuHandler class extends the IMenuHandler class by providing *
* specific information related to the menu. This primarily means providing *
* the object over which the menu was requested. * *
*******************************************************************************/
public:
/*--------------------------- Constructors -------------------------------------
| The only way to construct an instance of this class is from the |
| ICnrMenuHandler class. |
------------------------------------------------------------------------------*/
ICnrMenuHandler ( );
~ICnrMenuHandler ( );
/*-------------------------------- Accessors -----------------------------------
| This function provides means of getting and setting the accessible |
| attributes of instances of this class: |
| popupMenuObject - Returns the object for which a pop-up menu was |
| requested. If a pop-up menu was not requested for an |
| object, 0 is returned. |
------------------------------------------------------------------------------*/
IContainerObject
*popupMenuObject ( );
/*---------------------------- 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 ICnrMenuHandler
&handleEventsFor ( IContainerControl* container ),
&stopHandlingEventsFor ( IContainerControl* container );
protected:
/*-------------------- Implementation ------------------------------------------
| The following functions are overriden to implement the class: |
| dispatchHandlerEvent - Routes the edit events to the appropriate event |
| functions. |
| addSourceEmphasis - If a menu occurs over an object, |
| IContainerControl::showSourceEmphasis is invoked for |
| the object; otherwise, |
| IContainerControl::showSourceEmphasis is invoked for |
| the container. |
| Note: A different version of the same function is |
| being called. |
| removeSourceEmphasis - If a menu occurs over an object, |
| IContainerControl::hideSourceEmphasis is invoked for |
| the object; otherwise, |
| IContainerControl::hideSourceEmphasis is invoked on |
| the container. |
| Note: A different version of the same function is |
| being called. |
| menuEnded - Resets the pointer to the menu object that is stored |
| when the menu is created, and invokes |
| IMenuHandler::menuEnded to complete processing. |
------------------------------------------------------------------------------*/
virtual Boolean
dispatchHandlerEvent ( IEvent& evt);
virtual void
addSourceEmphasis( const IMenuEvent& menuEvent ),
removeSourceEmphasis( const IMenuEvent& menuEvent );
virtual Boolean
menuEnded ( IMenuEvent& menuEvent );
/*-------------------------------- PRIVATE -----------------------------------*/
private:
/* Hidden functions */
virtual IHandler
&handleEventsFor ( IWindow* window ),
&stopHandlingEventsFor ( IWindow* window );
IContainerObject
*pcnrobjClMenu;
};
/*----------------------------------------------------------------------------*/
/* Resume compiler default packing. */
/*----------------------------------------------------------------------------*/
#pragma pack()
#endif