home *** CD-ROM | disk | FTP | other *** search
- #ifndef _IMENUHDL_
- #define _IMENUHDL_
- /**************************************************************/
- /* FILE NAME: imenuhdr.hpp */
- /* */
- /* DESCRIPTION: */
- /* Declaration of the class: */
- /* IMenuHandler - handles events related to menu display */
- /* */
- /* COPYRIGHT: */
- /* Licensed Materials - Property of IBM */
- /* (c) Copyright IBM Corporation 1992, 1993 */
- /* US Government Users Restricted Rights - Use duplication */
- /* or disclosure restricted by GSA ADP Schedule Contract */
- /* with IBM Corp. */
- /* */
- /* $Log: G:/IBMCLASS/IBASEAPP/VCS/IMENUHDR.HPV $ */
- //
- // Rev 1.25 26 Oct 1992 10:07:52 HARPERSP
- // Updates for documentation.
- //
- // Rev 1.23 19 Oct 1992 20:04:38 kleong
- //No change.
- //
- // Rev 1.22 19 Oct 1992 18:53:14 greg
- //Added menuEnded virtual callback
- //
- // Rev 1.21 19 Oct 1992 16:27:48 law
- //Remove excess security classification.
- //
- // Rev 1.20 18 Oct 1992 18:48:46 greg
- //Fixes for wrong handler bug
- //
- // Rev 1.4 13 Oct 1992 20:23:28 kleong
- // Remove vf ~(), #include <ibasetyp.hpp> and virtual inheritence
- //
- // Rev 1.3 13 Oct 1992 02:42:36 tsuji
- // Change base class from "public IHandler" to "public virtual IHandler", remove
- // #include <ibasetyp.hpp>, change "inherited" to "Inherited"
- //
- // Rev 1.2 07 Oct 1992 17:28:26 HARPERSP
- // Delete autoDelete IPopUpMenu objects.
- /* */
- /**************************************************************/
-
- #ifndef _IHANDLER_
- #include <ihandler.hpp>
- #endif
- #ifndef _IMENUEVT_
- #include <imenuevt.hpp>
- #endif
-
- // Forward declarations for other classes
- class IMenuHandler;
- class ISubMenu;
- class IPopUpMenu;
- class IEvent;
- class IString;
- class IPoint;
-
- class IMenuHandler : public IHandler
- {
- /**********************************************************************
- * You can derive a class from IMenuHandler and then use *
- * IHandler::addHandler() to have it handle Menu related events *
- * for a given object. *
- * *
- * Example: *
- * To handle Menu events for your applications IFrameWindow: *
- * *
- * class FrameMenuHandler : public IMenuHandler { *
- * ... *
- * }; *
- * *
- * IFrameWindow myFrame(id, parent, owner, size); *
- * FrameMenuHandler myHandler(); *
- * *
- * myFrame.addHandler(myHandler); *
- * *
- * You would then override the virtual functions in IMenuHandler *
- * so that you could respond to Menu events. *
- * *
- **********************************************************************/
-
- typedef IHandler Inherited;
- public:
-
- /*------------------ CONSTRUCTORS/DESTRUCTORS -------------------------
- | There is 1 way to construct instances of this class: |
- | 1. IMenuHandler() |
- | |
- | Since this is a default constructor there is no need to explicitly |
- | call it from your derived class. |
- ---------------------------------------------------------------------*/
-
- IMenuHandler();
-
- virtual Boolean dispatchHandlerEvent(IEvent& evt);
-
- virtual IString dump();
-
- protected:
-
- /*--------------------- IMPLEMENTATION -------------------------------
- | The following functions can be overridden in your derived class: |
- | |
- | makePopUpMenu - called whenever a user requests context sensitive |
- | help for the object that the handler applies to. |
- | |
- | menuShowing - called whenever a menu is about to be displayed. |
- | The menu can be dynamically changed using the |
- | ISubMenu wrapper object that is passed to you. |
- | |
- | menuSelected - called whenever a Menu Item is hilited. Could be |
- | used to give brief help on the Menu Item in an |
- | Information Area. |
- | |
- | menuEnded - called when a Menu is about to be removed from |
- | the display. |
- | |
- ---------------------------------------------------------------------*/
-
-
- virtual IPopUpMenu* makePopUpMenu(const IMenuEvent& mnEvt)
- {return (IPopUpMenu*)0;}
-
- virtual void menuShowing(const IMenuEvent& mnEvt,
- ISubMenu* psmnAboutToShow) {;}
-
- virtual void menuSelected(const IMenuEvent& mnEvt) {;}
-
- virtual void menuEnded(const IMenuEvent& mnEvt) {;}
-
-
- /*----------------------- PRIVATE -----------------------------------*/
- private:
- ISubMenu* psmnCl;
- Boolean bClPopUp;
- IPopUpMenu* ppumnCl;
- };
- #endif /* IMENUHDL */