Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

116 lines
3.3 KiB

  1. /**********************************************************************/
  2. /** Microsoft Windows/NT **/
  3. /** Copyright(c) Microsoft Corp., 1991 **/
  4. /**********************************************************************/
  5. /*
  6. bltmitem.hxx
  7. BLT menu manipulation classes
  8. FILE HISTORY:
  9. rustanl 11-Jul-1991 Created
  10. rustanl 12-Jul-1991 Added to BLT
  11. rustanl 15-Jul-1991 Code review changes (change
  12. CLIENT_WINDOW * to APP_WINDOW *)
  13. CR attended by BenG, ChuckC,
  14. Hui-LiCh, TerryK, RustanL.
  15. beng 31-Oct-1991 Added SYSMENUITEM class
  16. terryk 26-Nov-1991 Added SetText for MENUITEM
  17. */
  18. #ifndef _BLT_HXX_
  19. #error "Don't include this file directly; instead, include it through blt.hxx"
  20. #endif // _BLT_HXX_
  21. #ifndef _BLTMITEM_HXX_
  22. #define _BLTMITEM_HXX_
  23. #include "base.hxx"
  24. #include "string.hxx"
  25. /*************************************************************************
  26. NAME: MENUITEM
  27. SYNOPSIS: Menu item class
  28. INTERFACE: MENUITEM() - Constructor
  29. Enable() - Enables or disables a menu item
  30. IsEnabled() - Returns whether or not the menu item
  31. is enabled
  32. SetCheck() - Sets or removes a check mark next to
  33. a menu item
  34. IsChecked() - Returns whether or not the menu item
  35. is checked
  36. SetText() - Set the menu item text string
  37. PARENT: BASE
  38. HISTORY:
  39. rustanl 11-Jul-1991 Created
  40. rustanl 11-Sep-1991 Added IsEnabled and IsChecked
  41. beng 31-Oct-1991 Added protected ctor
  42. terryk 27-Nov-1991 Added SetText
  43. jonn 19-Mar-1993 Added ItemExists
  44. **************************************************************************/
  45. DLL_CLASS MENUITEM : public BASE
  46. {
  47. private:
  48. HMENU _hmenu;
  49. MID _mid;
  50. protected:
  51. MENUITEM( HMENU hmenu, MID mid );
  52. public:
  53. MENUITEM( APP_WINDOW * pwnd, MID mid );
  54. VOID Enable( BOOL f );
  55. BOOL IsEnabled() const;
  56. VOID SetCheck( BOOL f );
  57. BOOL IsChecked() const;
  58. BOOL SetText( const TCHAR *pszString );
  59. BOOL SetText( const NLS_STR &nls )
  60. { return SetText( nls.QueryPch() ); }
  61. #ifdef WIN32
  62. static BOOL ItemExists( HMENU hmenu, MID mid );
  63. static BOOL ItemExists( APP_WINDOW * pawin, MID mid );
  64. #endif
  65. };
  66. /*************************************************************************
  67. NAME: SYSMENUITEM
  68. SYNOPSIS: Menuitem class for items in system menu
  69. INTERFACE: As for MENUITEM
  70. PARENT: MENUITEM
  71. NOTES:
  72. A SYSMENUITEM can be built from either a dialog or app window.
  73. This lets a dialog disable its Close (SC_CLOSE) item.
  74. HISTORY:
  75. beng 31-Oct-1991 Created
  76. **************************************************************************/
  77. DLL_CLASS SYSMENUITEM: public MENUITEM
  78. {
  79. public:
  80. SYSMENUITEM( OWNER_WINDOW * pwnd, MID mid );
  81. };
  82. #endif // _BLTMITEM_HXX_