home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
cset21v1.zip
/
IBMCPP
/
IBMCLASS
/
ISLHDR.HPP
< prev
next >
Wrap
C/C++ Source or Header
|
1993-10-22
|
8KB
|
123 lines
#ifndef _ISLHDR_
#define _ISLHDR_
/*******************************************************************************
* FILE NAME: islhdr.hpp *
* *
* DESCRIPTION: *
* Declaration of the class(es): *
* IShowListHandler - Process a show list event for a combo box. *
* *
* 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 _ICTLEVT_
#include <ictlevt.hpp>
#endif
/*----------------------------------------------------------------------------*/
/* Align classes on four byte boundary. */
/*----------------------------------------------------------------------------*/
#pragma pack(4)
// Forward declarations for other classes:
class IEvent;
class IShowListHandler : public IHandler {
typedef IHandler
Inherited;
/*******************************************************************************
* The IShowListHandler class handles the processing of show list events for *
* the IComboBox control. For example, a show list event occurs when the user *
* clicks on the drop-down button of the combination box. *
* *
* An IShowListHandler object should be attached to the combination box that *
* generated the show list event or to the owner window of the combination box. *
* This is done by passing the combination box or the owner window on the *
* handleEventsFor function of the IShowListHandler object. *
* *
* When it receives a show list event, the IShowListHandler object processes *
* the event by creating an IControlEvent object and routing it to the *
* listShown virtual function. You can override this virtual function to *
* supply your own specialized processing of the event. The return value from *
* the listShown function specifies whether the IControlEvent should be passed *
* on for additional processing, as follows: *
* *
* Value Meaning *
* --------------- *
* true - The IControlEvent object requires no additional processing and *
* should not be passed to another handler. *
* false - The IControlEvent object should be passed on for additional *
* processing, as follows: *
* -- If there is a next handler for the control or window, the *
* event is passed on to the next handler. *
* -- If this is the last handler for the control, the event is *
* dispatched to the owner window of the control *
* (see IWindow::dispatch). *
* -- If this is the last handler for the owner window, the event is *
* passed on a call to the owner window's defaultProcedure *
* function (see IWindow::defaultProcedure). *
* *
* Example: *
* MyWindow::MyWindow() *
* : ... *
* { *
* MyShowListHandler* slh = new MyShowListHandler(); *
* ... *
* IComboBox* cb = new IComboBox(ID_CB, this, this, IRectangle(...)); *
* slh->handleEventsFor(cb); *
* ... *
* show(); *
* } *
* Boolean MyShowListHandler::listShown(IControlEvent& evt) *
* { *
* IComboBox* cb = (IComboBox*)ctlevt.controlWindow(); *
* // add entries to the list box about to be displayed *
* ... *
* return true; // event processed *
* } *
*******************************************************************************/
public:
/*-------------------------- Constructor/Destructor ----------------------------
| The only way to construct instances of this class is to use the default |
| constructor, which takes no arguments. |
------------------------------------------------------------------------------*/
IShowListHandler ( );
virtual
~IShowListHandler ( );
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 listShown function if a show list event |
| is found. |
------------------------------------------------------------------------------*/
virtual Boolean
dispatchHandlerEvent ( IEvent& event );
/*----------------------------- Event Processing -------------------------------
| This function must be supplied by a derived class to process a show list |
| event. |
| listShown - Implemented by derived classes to process show list events. |
------------------------------------------------------------------------------*/
virtual Boolean
listShown ( IControlEvent& event ) = 0;
}; // IShowListHandler
/*----------------------------------------------------------------------------*/
/* Resume compiler default packing. */
/*----------------------------------------------------------------------------*/
#pragma pack()
#endif /* _ISLHDR_ */