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

  1. #ifndef _ISYSMENU_
  2.   #define _ISYSMENU_
  3. /******************************************************************************
  4. * FILE NAME: isysmenu.hpp                                                     *
  5. *                                                                             *
  6. * DESCRIPTION:                                                                *
  7. *    Declaration of the class:                                                *
  8. *      ISystemMenu - wrapper for the system menu                              *
  9. *                                                                             *
  10. * COPYRIGHT:                                                                  *
  11. *   Licensed Materials - Property of IBM                                      *
  12. *   (c) Copyright IBM Corporation 1992, 1993                                  *
  13. *   US Government Users Restricted Rights - Use duplication                   *
  14. *   or disclosure restricted by GSA ADP Schedule Contract                     *
  15. *   with IBM Corp.                                                            *
  16. *                                                                             *
  17. ******************************************************************************/
  18. #ifndef _IMENU_
  19. #include <imenu.hpp>
  20. #endif
  21.  
  22. /*----------------------------------------------------------------------------*/
  23. /* Align classes on four byte boundary.                                       */
  24. /*----------------------------------------------------------------------------*/
  25. #pragma pack(4)
  26.  
  27. class IFrameWindow;
  28.  
  29. class ISystemMenu : public IMenu {
  30. typedef IMenu
  31.   Inherited;
  32. /******************************************************************************
  33. * The ISystemMenu class creates a menu object for the system menu of a window *
  34. * so that it can be used to manipulate its menu item.  The member functions   *
  35. * in IMenu and ISubmenu can be used to change the ISystemMenu (see notes      *
  36. * below).  IMenuItem objects can be added to the ISystemMenu.                 *
  37. *                                                                             *
  38. * NOTES: 1) The IMenu::disableItem and ISubmenu::disableItem functions may    *
  39. *           have no effect in certain situations.  For example, you cannot    *
  40. *           disable the Size menu item on the system menu if the frame window *
  41. *           has a sizing border.                                              *
  42. *                                                                             *
  43. *        2) If you use the IMenu::addBitmap or ISubmenu::addBitmap function   *
  44. *           to add a new bit map to the right of the system menu bit map on   *
  45. *           the title bar, the bitmapHandle argument must reference a bit map *
  46. *           that has the same dimensions as an icon (40 x 36).  If this       *
  47. *           argument references a bit map that is larger than an icon, the    *
  48. *           bit map will be clipped.  You also need to provide a visual       *
  49. *           indication of separation along the left side of the bit map if    *
  50. *           more than one such bit map will appear on the title bar.          *
  51. *                                                                             *
  52. * Example:                                                                    *
  53. *   ISystemMenu menu(myFrame);                                                *
  54. *     //The system menu can now be manipulated using "menu"                   *
  55. ******************************************************************************/
  56. public:
  57. /*------------------ Constructor ----------------------------------------------
  58. |  The only way to construct instances of this class is with an owner frame    |
  59. |  window.                                                                     |
  60. ------------------------------------------------------------------------------*/
  61.    ISystemMenu ( IFrameWindow* owner );
  62.  
  63. /*---------- IDs for Items that Appear on the System Menu ----------------------
  64. |  The following constants should be used when calling IMenu member functions  |
  65. |  to affect items on the system menu.                                         |
  66. |                                                                              |
  67. |  Use idPulldown as the intoSubmenuId argument when you want to add to the    |
  68. |  system menu pull-down, as in the following example:                         |
  69. |                                                                              |
  70. |    sysmenu.addItem(myMenuItem, ISystemMenu::idPulldown);                     |
  71. |                                                                              |
  72. |  If idPulldown is not specified on the add call, such as:                    |
  73. |                                                                              |
  74. |    sysmenu.addItem(myMenuItem);                                              |
  75. |                                                                              |
  76. |  then myMenuItem would appear on the title bar to the right of the system    |
  77. |  menu icon.  If you are going to place additional menu items on the title    |
  78. |  bar, they should be bit-map items rather than text.                         |
  79. |                                                                              |
  80. |  NOTE: When adding a bit-map item to the title bar using a call, such as:    |
  81. |                                                                              |
  82. |          sysmenu.addBitmap(myMenuItem, myBitmapHandle);                      |
  83. |                                                                              |
  84. |        then myBitmapHandle should reference a bit map whose dimensions are   |
  85. |        40 x 36.  Additionally, if you will be adding more that one bit map   |
  86. |        to the right of the system menu icon, each bit map should be drawn    |
  87. |        so that its left edge provides some kind of visual separator.         |
  88. ------------------------------------------------------------------------------*/
  89.  
  90. static const unsigned long
  91.    idPulldown,
  92.    idRestore,
  93.    idMove,
  94.    idSize,
  95.    idMinimize,
  96.    idMaximize,
  97.    idHide,
  98.    idClose,
  99.    idWindowList;
  100.  
  101.  
  102. virtual
  103.   ~ISystemMenu ( );
  104. /*----------------------- Private -----------------------------------*/
  105. private:
  106. /*------------------- Hidden Functions. -----------------------------------
  107. | The following inherited functions are hidden in this class.              |
  108. |-------------------------------------------------------------------------*/
  109.   ISystemMenu(const ISystemMenu&);
  110.   ISystemMenu &operator=(const ISystemMenu&);
  111.  
  112. };
  113.  
  114. /*----------------------------------------------------------------------------*/
  115. /* Resume compiler default packing.                                           */
  116. /*----------------------------------------------------------------------------*/
  117. #pragma pack()
  118.  
  119. #endif  /* _ISYSMENU_ */
  120.