home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / cset21v1.zip / IBMCPP / IBMCLASS / ICNRMHDR.HPP < prev    next >
C/C++ Source or Header  |  1993-10-22  |  7KB  |  126 lines

  1. #ifndef _ICNRMHDR_
  2. #define _ICNRMHDR_
  3. /*******************************************************************************
  4. * FILE NAME: icnrmhdr.hpp                                                      *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the class(es):                                              *
  8. *     ICnrMenuHandler                                                          *
  9. *                                                                              *
  10. * COPYRIGHT:                                                                   *
  11. *   (C) Copyright IBM Corporation 1992                                         *
  12. *   All Rights Reserved                                                        *
  13. *   Licensed Materials * Property of IBM                                       *
  14. *                                                                              *
  15. * HISTORY:                                                                     *
  16. *******************************************************************************/
  17. #ifndef _IMENUHDR_
  18.   #include <imenuhdr.hpp>
  19. #endif
  20.  
  21. #ifndef _IEVENT_
  22.   #include <ievent.hpp>
  23. #endif
  24.  
  25. /*----------------------------------------------------------------------------*/
  26. /* Align classes on four byte boundary.                                       */
  27. /*----------------------------------------------------------------------------*/
  28. #pragma pack(4)
  29.  
  30. class IContainerObject;
  31. class IContainerControl;
  32.  
  33. class ICnrMenuHandler : public IMenuHandler
  34. {
  35. typedef IMenuHandler
  36.   Inherited;
  37. /*******************************************************************************
  38. * The ICnrMenuHandler class extends the IMenuHandler class by providing        *
  39. * specific information related to the menu.  This primarily means providing    *
  40. * the object over which the menu was requested.                                *    *
  41. *******************************************************************************/
  42.  
  43. public:
  44.  
  45. /*--------------------------- Constructors -------------------------------------
  46. | The only way to construct an instance of this class is from the              |
  47. | ICnrMenuHandler class.                                                       |
  48. ------------------------------------------------------------------------------*/
  49.   ICnrMenuHandler      ( );
  50.  ~ICnrMenuHandler      ( );
  51.  
  52.  
  53. /*-------------------------------- Accessors -----------------------------------
  54. | This function provides means of getting and setting the accessible           |
  55. | attributes of instances of this class:                                       |
  56. |   popupMenuObject   - Returns the object for which a pop-up menu was         |
  57. |                       requested. If a pop-up menu was not requested for an   |
  58. |                       object, 0 is returned.                                 |
  59. ------------------------------------------------------------------------------*/
  60. IContainerObject
  61.  *popupMenuObject     ( );
  62.  
  63. /*---------------------------- Window Attachment -------------------------------
  64. | These functions permit attaching and detaching the handler object to and from|
  65. | a container window:                                                          |
  66. |   handleEventsFor       - Attaches the handler to the container control      |
  67. |                           passed in the argument.                            |
  68. |   stopHandlingEventsFor - Detaches the handler from the container control    |
  69. |                           passed in the argument.                            |
  70. ------------------------------------------------------------------------------*/
  71. virtual ICnrMenuHandler
  72.  &handleEventsFor       ( IContainerControl* container ),
  73.  &stopHandlingEventsFor ( IContainerControl* container );
  74.  
  75. protected:
  76.  
  77. /*-------------------- Implementation ------------------------------------------
  78. | The following functions are overriden to implement the class:                |
  79. |  dispatchHandlerEvent - Routes the edit events to the appropriate event      |
  80. |                         functions.                                           |
  81. |  addSourceEmphasis    - If a menu occurs over an object,                     |
  82. |                         IContainerControl::showSourceEmphasis is invoked for |
  83. |                         the object; otherwise,                               |
  84. |                         IContainerControl::showSourceEmphasis is invoked for |
  85. |                         the container.                                       |
  86. |                         Note: A different version of the same function is    |
  87. |                               being called.                                  |
  88. |  removeSourceEmphasis - If a menu occurs over an object,                     |
  89. |                         IContainerControl::hideSourceEmphasis is invoked for |
  90. |                         the object; otherwise,                               |
  91. |                         IContainerControl::hideSourceEmphasis is invoked on  |
  92. |                         the container.                                       |
  93. |                         Note: A different version of the same function is    |
  94. |                               being called.                                  |
  95. |  menuEnded            - Resets the pointer to the menu object that is stored |
  96. |                         when the menu is created, and invokes                |
  97. |                         IMenuHandler::menuEnded to complete processing.      |
  98. ------------------------------------------------------------------------------*/
  99. virtual Boolean
  100.   dispatchHandlerEvent ( IEvent& evt);
  101. virtual void
  102.   addSourceEmphasis( const IMenuEvent& menuEvent ),
  103.   removeSourceEmphasis( const IMenuEvent& menuEvent );
  104.  
  105. virtual Boolean
  106.   menuEnded     ( IMenuEvent& menuEvent );
  107.  
  108. /*-------------------------------- PRIVATE -----------------------------------*/
  109.   private:
  110.  
  111. /* Hidden functions */
  112. virtual IHandler
  113.  &handleEventsFor       ( IWindow* window  ),
  114.  &stopHandlingEventsFor ( IWindow* window  );
  115.  
  116. IContainerObject
  117.  *pcnrobjClMenu;
  118. };
  119.  
  120. /*----------------------------------------------------------------------------*/
  121. /* Resume compiler default packing.                                           */
  122. /*----------------------------------------------------------------------------*/
  123. #pragma pack()
  124.  
  125. #endif
  126.