home *** CD-ROM | disk | FTP | other *** search
- #ifndef _IEDITHDR_
- #define _IEDITHDR_
- /*******************************************************************************
- * FILE NAME: iedithdr.hpp *
- * *
- * DESCRIPTION: *
- * Declaration of the class(es): *
- * IEditHandler - Process an input change 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/IEDITHDR.HPV $ *
- //
- // Rev 1.24 25 Oct 1992 16:57:00 nunn
- // changed library name to ICLUI
- //
- // Rev 1.23 25 Oct 1992 14:43:12 tsuji
- // Update class description.
- //
- // Rev 1.22 24 Oct 1992 17:12:56 tsuji
- // Format/document in style of the standard header file.
- *******************************************************************************/
- #ifndef _IHANDLER_
- #include <ihandler.hpp>
- #endif
-
- // Forward declarations for other classes:
- class IEditHandler; /* edh */
- class IControlEvent;
- class IEvent;
-
- class IEditHandler : public IHandler {
- /*******************************************************************************
- * This class handles processing of input change events for the following *
- * controls: IComboBox, IEntryField, IMLE, IProgressIndicator, ISlider, and *
- * ISpinButton. *
- * *
- * The IEditHandler class is designed to handle events resulting from a user *
- * changing a control's input value (for example, changing the value of an *
- * entry field). If registered to the appropriate window (by being passed on *
- * the addHandler() function of the control or the owner window of the *
- * control), the IEditHandler object will be called to process the input change *
- * event. It does this by creating an IControlEvent object and routing it to *
- * the virtual edit() function (this virtual function allows you to supply your *
- * own specialized processing 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() *
- * : ... *
- * { *
- * MyReqEntryEditHandler* edh = new MyReqEntryEditHandler(); *
- * ... *
- * IEntryField* ef = new IEntryField(ID_EF, this, this, IRectangle(...)); *
- * ef->addHandler(edh); *
- * ... *
- * show(); *
- * } *
- * Boolean MyReqEntryEditHandler::edit(IControlEvent& evt) *
- * { *
- * Boolean bProcessed = false; *
- * IEntryField* ef = (IEntryField*)ctlevt.controlWindow(); *
- * IString str = ef->text(); *
- * if (str.strip().length() == 0) *
- * { // required value missing *
- * // disable Enter pushbutton *
- * } *
- * else *
- * { // required value specified *
- * // enable Enter pushbutton *
- * } *
- * ... *
- * 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 |
- ------------------------------------------------------------------------------*/
- IEditHandler ( ) {;}
-
- /*----------------------- 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 edit function if input change event |
- ------------------------------------------------------------------------------*/
- Boolean
- dispatchHandlerEvent ( IEvent& evt );
-
- protected:
- /*------------------------ EVENT PROCESSING FUNCTIONS --------------------------
- | This function must be supplied by a derived class in order to provide |
- | processing for an input change event. |
- | edit - function used to process the input change event |
- ------------------------------------------------------------------------------*/
- virtual Boolean
- edit ( IControlEvent& evt ) = 0;
- };
- #endif /* IEDITHDR */