AdMenuBar.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. //////////////////////////////////////////////////////////////////////////////
  4. //
  5. // (C) Copyright 2009-2011 by Autodesk, Inc.
  6. //
  7. // Permission to use, copy, modify, and distribute this software in
  8. // object code form for any purpose and without fee is hereby granted,
  9. // provided that the above copyright notice appears in all copies and
  10. // that both that copyright notice and the limited warranty and
  11. // restricted rights notice below appear in all supporting
  12. // documentation.
  13. //
  14. // AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
  15. // AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
  16. // MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
  17. // DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
  18. // UNINTERRUPTED OR ERROR FREE.
  19. //
  20. // Use, duplication, or disclosure by the U.S. Government is subject to
  21. // restrictions set forth in FAR 52.227-19 (Commercial Computer
  22. // Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
  23. // (Rights in Technical Data and Computer Software), as applicable.
  24. //
  25. //////////////////////////////////////////////////////////////////////////////
  26. //
  27. // Name: AdMenuBar.h
  28. //
  29. //////////////////////////////////////////////////////////////////////////////
  30. #pragma once
  31. #include "AdExportDef.h"
  32. class AdImpMenuBar;
  33. /// <summary>
  34. /// LPFNADMENUCALLBACK is a callback for Menu.
  35. /// </summary>
  36. typedef bool (CALLBACK *LPFNADMENUCALLBACK)(unsigned int nItemId);
  37. //////////////////////////////////////////////////////////////////
  38. // MenuBar
  39. /// <summary>
  40. /// The application frame menu bar.
  41. /// </summary>
  42. class ADAF_PORT AdMenuBar
  43. {
  44. friend class AdApplicationFrame;
  45. public:
  46. virtual ~AdMenuBar();
  47. bool GetMenuItemHelpString(UINT nItemID, const wchar_t **wszHelpString);
  48. bool RemoveMenuItem(HMENU hMenu, UINT nMenuItemId);
  49. bool AddMenuItem(HMENU hMenu, UINT nPos, const MENUITEMINFO& menuItem,
  50. LPFNADMENUCALLBACK pfnCallback, const wchar_t *wszHelpString);
  51. bool SetMenuHandle(HMENU hMenu);
  52. void UpdateMenu();
  53. HMENU GetMenuHandle();
  54. bool TrackingPopup();
  55. void SetChildWindowMenuPopup(bool bShow);
  56. bool GetChildWindowMenuPopup(void);
  57. private:
  58. AdMenuBar(AdImpMenuBar* pImpMenuBar);
  59. AdMenuBar();
  60. /// <summary>
  61. /// Member pointer to the implementation class of the class
  62. /// AdMenuBar.
  63. /// </summary>
  64. AdImpMenuBar *mpImpMenuBar;
  65. };