home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / samples / visbuild / rapsheet / cnrpopmh.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-09  |  3.4 KB  |  67 lines

  1. #ifndef _CNRPOPMH_
  2. #define _CNRPOPMH_
  3. /******************************************************************************
  4. * .FILE:        cnrpopmh.hpp                                                  *
  5. *                                                                             *
  6. * .DESCRIPTION: Header file for the class, CnrPopupMenuHandler                *
  7. *                                                                             *
  8. * .CLASSES:     CnrPopupMenuHandler                                           *
  9. *                                                                             *
  10. * .COPYRIGHT:                                                                 *
  11. *    Licensed Material - Program-Property of IBM                              *
  12. *    (C) Copyright IBM Corp. 1992, 1996 - All Rights Reserved                 *
  13. *                                                                             *
  14. * .DISCLAIMER:                                                                *
  15. *   The following [enclosed] code is sample code created by IBM               *
  16. *   Corporation.  This sample code is not part of any standard IBM product    *
  17. *   and is provided to you solely for the purpose of assisting you in the     *
  18. *   development of your applications.  The code is provided 'AS IS',          *
  19. *   without warranty of any kind.  IBM shall not be liable for any damages    *
  20. *   arising out of your use of the sample code, even if they have been        *
  21. *   advised of the possibility of such damages.                               *
  22. *                                                                             *
  23. * .NOTE: WE RECOMMEND USING A FIXED SPACE FONT TO LOOK AT THE SOURCE          *
  24. *                                                                             *
  25. ******************************************************************************/
  26. #include <icnrmhdr.hpp>              // ICnrMenuHandler, parent class, which
  27.                                      // indirectly includes IMenuEvent.
  28.  
  29. //forward class references
  30. template <class Element> class IVSequence;
  31. class ISubmenu;
  32.  
  33. //**************************************************************************
  34. // Class:   CnrPopupMenuHandler
  35. //
  36. // Purpose: Provides popup menu support for a container control.
  37. //          When the popup menu is about to be shown, this handler
  38. //          customizes the popup menu.  If the popup menu is over
  39. //          a container object, it deletes all the menu items whose
  40. //          ids are listed in the ctor parm, aCnrMenuItemList.
  41. //          And if the popup menu is over the container, it deletes
  42. //          all the menu items whose ids are listed in the ctor parm,
  43. //          aCnrObjMenuItemList.  All the changes are undone when
  44. //          IMenuHandler::menuEnded is called upon menu termination.
  45. //
  46. //***************************************************************************
  47. class CnrPopupMenuHandler : public ICnrMenuHandler
  48. {
  49.  
  50. public:
  51.    CnrPopupMenuHandler(IVSequence<unsigned long> *aCnrObjMenuItemList,
  52.                        IVSequence<unsigned long> *aCnrMenuItemList);
  53.    virtual ~CnrPopupMenuHandler();     //destructor
  54.  
  55. protected:
  56.    Boolean menuShowing(IMenuEvent& menuEvent,
  57.                        ISubmenu& popupAboutToShow);
  58.  
  59. private:
  60.    IVSequence<unsigned long>
  61.       *iCnrObjMenuItemList,
  62.       *iCnrMenuItemList;
  63.  
  64. };   //CnrPopupMenuHandler
  65.  
  66. #endif
  67.