/** * @file XTPCommandBarsContextMenus.h * * @copyright * (c) 1998-2025 Codejock Software, All Rights Reserved. * * This source file is the property of Codejock Software and must not be * redistributed by any means without the explicit written permission of * Codejock Software. * * The use of this source code is governed by the terms and conditions specified * in the Toolkit Pro license agreement. Codejock Software grants you, as a * single software developer, the limited right to use this software on one * computer only. * * Contact Information: * support@codejock.com * http://www.codejock.com * */ /** @cond */ #if !defined(__XTPCOMMANDBARSCONTEXTMENUS_H__) # define __XTPCOMMANDBARSCONTEXTMENUS_H__ /** @endcond */ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" /** * @brief * CXTPCommandBarsContextMenus is CXTPCommandBarList derived class * which represents a collection of context menus. */ class _XTP_EXT_CLASS CXTPCommandBarsContextMenus : public CXTPCommandBarList { public: /** * @brief * Constructs a CXTPCommandBarsContextMenus object. * @param pCommandBars Pointer to the CXTPCommandBars parent object. */ CXTPCommandBarsContextMenus(CXTPCommandBars* pCommandBars); public: /** * @brief * Call this method to add a new context menu to the collection. * @param nIDBar Menu resource identifier. * @return * Pointer to the newly added context menu. */ CXTPCommandBar* Add(UINT nIDBar); /** * @brief * Call this method to add a new context menu to the collection. * @param nIDBar Menu resource identifier. * @param nSubMenu Index of submenu to add. * @param nIDMenuResource Menu resource ID. * @return * Pointer to the newly added context menu. */ CXTPCommandBar* Add(UINT nIDBar, UINT nIDMenuResource, int nSubMenu); /** * @brief * Call this method to add a new context menu to the collection. * @param pCommandBar Command bar to be added. * @return * Pointer to the newly added context menu. */ CXTPCommandBar* Add(CXTPCommandBar* pCommandBar); /** * @brief * Call this method to add a new context menu to the collection. * @param nIDBar Menu resource identifier. * @param lpszTitle Caption of context menu. * @param pSubMenu Context menu to convert. * @return * Pointer to the newly added context menu. */ CXTPCommandBar* Add(UINT nIDBar, LPCTSTR lpszTitle, CMenu* pSubMenu); /** @cond */ # ifdef _XTP_COMMANDBARS_ACTIVEX DECLARE_DISPATCH_MAP() DECLARE_OLETYPELIB_EX(CXTPCommandBarsContextMenus); afx_msg LPDISPATCH OleGetItem(long nIndex); afx_msg LPDISPATCH OleItem(long nIndex); afx_msg long OleGetItemCount(); afx_msg LPDISPATCH OleFind(int nId); afx_msg LPDISPATCH OleAdd(int nId, LPCTSTR strCaption); afx_msg void OleAddPopup(LPDISPATCH lpDispatch); DECLARE_ENUM_VARIANT(CXTPCommandBarsContextMenus); # endif /** @endcond */ }; /** @cond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif // !defined(__XTPCOMMANDBARSCONTEXTMENUS_H__) /** @endcond */