home *** CD-ROM | disk | FTP | other *** search
- #ifndef _ISLHDR_
- #define _ISLHDR_
- /*******************************************************************************
- * FILE NAME: islhdr.hpp *
- * *
- * DESCRIPTION: *
- * Declaration of the class(es): *
- * IShowListHandler - Process a show list event for a 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. *
- * *
- *$Log: R:/IBMCLASS/IBASEAPP/VCS/ISLHDR.HPV $ *
- //
- // Rev 1.24 25 Oct 1992 16:57:42 nunn
- // changed library name to ICLUI
- //
- // Rev 1.23 25 Oct 1992 14:43:28 tsuji
- // Update class description.
- //
- // Rev 1.22 24 Oct 1992 17:14:32 tsuji
- // Format/document in the style of the standard header file.
- *******************************************************************************/
- #ifndef _IHANDLER_
- #include <ihandler.hpp>
- #endif
-
- // Forward declarations for other classes:
- class IShowListHandler; /* slh */
- class IControlEvent;
- class IEvent;
-
- class IShowListHandler : public IHandler {
- /*******************************************************************************
- * This class handles processing of show list events for the following *
- * controls: IComboBox. *
- * *
- * The IShowListHandler class is designed to handle events resulting from a *
- * list box being displayed by an IComboBox object (for example, when the user *
- * clicks the drop-down button of the combo box). If registered to the *
- * appropriate window (by being passed on the addHandler() function of the *
- * control or the owner window of the control), the IShowListHandler object *
- * will be called to process the show list event. It does this by creating an *
- * IControlEvent object and routing it to the virtual listShown() fucntion *
- * (this virtual function allows you to supply your own specialized process of *
- * the event). The return value from the virtual function specifies if the *
- * IControlEvent should be passed on to another handler object to be processed, *
- * as described below: *
- * *
- * Value Meaning *
- * ------ -------- *
- * true The IControlEvent has been handled and requires no additional *
- * processing. *
- * false The IControlEvent should be passed to the next handler (if this is *
- * the last handler for the control it should be passed on the first *
- * handler of the owner for the control, and if the last handler for *
- * the owner window it should be passed on the default window *
- * procedure). *
- * *
- * EXAMPLE: *
- * MyWindow::MyWindow() *
- * : ... *
- * { *
- * MyShowListHandler* slh = new MyShowListHandler(); *
- * ... *
- * IComboBox* cb = new IComboBox(ID_CB, this, this, IRectangle(...)); *
- * cb->addHandler(slh); *
- * ... *
- * 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 *
- * } *
- *******************************************************************************/
- typedef IHandler Inherited;
- public:
- /*------------------------ CONSTRUCTORS/DESTRUCTORS ----------------------------
- | There is 1 way to construct instances of this class: |
- | 1. default constructor |
- ------------------------------------------------------------------------------*/
- IShowListHandler ( ) {;}
-
- /*----------------------- EVENT DISPATCHING INTERFACE --------------------------
- | This function evaluates the event to determine if it is one appropriate for |
- | this handler object to process. If so it calls the virtual function used to |
- | process the event. |
- | dispatchHandlerEvent - invokes the listShown function if show list event |
- ------------------------------------------------------------------------------*/
- Boolean
- dispatchHandlerEvent ( IEvent& evt );
-
- protected:
- /*------------------------ EVENT PROCESSING FUNCTIONS --------------------------
- | This function must be supplied by a derived class in order to provide |
- | processing for a show list event. |
- | listShown - function used to process the show list event |
- ------------------------------------------------------------------------------*/
- virtual Boolean
- listShown ( IControlEvent& evt ) = 0;
- };
- #endif /* ISLHDR */