home *** CD-ROM | disk | FTP | other *** search
- #ifndef _ISELHDR_
- #define _ISELHDR_
- /*******************************************************************************
- * FILE NAME: iselhdr.hpp *
- * *
- * DESCRIPTION: *
- * Declaration of the class(es): *
- * ISelectHandler - Process a selection 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/ISELHDR.HPV $ *
- //
- // Rev 1.24 25 Oct 1992 16:57:38 nunn
- // changed library name to ICLUI
- //
- // Rev 1.23 25 Oct 1992 14:43:26 tsuji
- // Update class description.
- //
- // Rev 1.22 24 Oct 1992 17:14:26 tsuji
- // Format/document in the style of the standard header file.
- *******************************************************************************/
- #ifndef _IHANDLER_
- #include <ihandler.hpp>
- #endif
-
- // Forward declarations for other classes:
- class ISelectHandler; /* selh */
- class IControlEvent;
- class IEvent;
-
- class ISelectHandler : public IHandler {
- /*******************************************************************************
- * This class handles processing of item selection events (which includes *
- * select/deselect, Enter key press, and double-click) for the following *
- * controls: I3StateCheckBox, ICheckBox, IComboBox, IContainerControl, *
- * IListBox, and IRadioButton. *
- * *
- * The ISelectHandler class is designed to handle events resulting from a *
- * selection/enter action on a control (for example, when the user clicks or *
- * double-clicks a radio button). If registered to the appropriate window (by *
- * being passed on the addHandler() function of the control or the owner window *
- * of the control), the ISelectHandler object will be called to process the *
- * selection/enter event. It does this by creating an IControlEvent object and *
- * routing it to the appropriate virtual function (these virtual functions *
- * allow you to supply your own specialized processing of the event). The *
- * return value from the virtual functions 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() *
- * : ... *
- * { *
- * MyRadioSelectHandler* selh = new MyRadioSelectHandler(); *
- * ... *
- * IRadioButton* rb1 = new IRadioButton(ID_RB1, this, this, *
- * IRectangle(...)); *
- * IRadioButton* rb2 = new IRadioButton(ID_RB2, this, this, *
- * IRectangle(...)); *
- * IRadioButton* rb3 = new IRadioButton(ID_RB3, this, this, *
- * IRectangle(...)); *
- * rb1->addHandler(selh); *
- * rb2->addHandler(selh); *
- * rb3->addHandler(selh); *
- * ... *
- * show(); *
- * } *
- * Boolean MyRadioSelectHandler::select(IControlEvent& evt) *
- * { *
- * Boolean bProcessed = false; *
- * ulButtonId = evt.controlId(); // remember selected button *
- * return bProcessed; // let another handle event also *
- * } *
- *******************************************************************************/
- typedef IHandler Inherited;
- public:
- /*------------------------ CONSTRUCTORS/DESTRUCTORS ----------------------------
- | There is 1 way to construct instances of this class: |
- | 1. default constructor |
- ------------------------------------------------------------------------------*/
- ISelectHandler ( ) {;}
-
- /*----------------------- 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 a virtual function used to |
- | process the event. |
- | dispatchHandlerEvent - invokes the select or enter function if appropriate |
- ------------------------------------------------------------------------------*/
- Boolean
- dispatchHandlerEvent ( IEvent& evt );
-
- protected:
- /*------------------------ EVENT PROCESSING FUNCTIONS --------------------------
- | These functions should be supplied by a derived class in order to provide |
- | processing for a selection or enter event. |
- | enter - function used to process an enter event |
- | selected - function used to process a selection event |
- ------------------------------------------------------------------------------*/
- virtual Boolean
- enter ( IControlEvent& evt ) { return false; }
- virtual Boolean
- selected ( IControlEvent& evt ) { return false; }
- };
- #endif /* ISELHDR */