/** * @file XTPFlowGraphNodeGroup.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(__XTPFLOWGRAPHNODEGROUP_H__) # define __XTPFLOWGRAPHNODEGROUP_H__ /** @endcond */ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPFlowGraphPage; class CXTPFlowGraphNodeGroups; class CXTPFlowGraphNode; /** * @brief * Represents a group of Nodes. * @details * A group is just a "box" that is used to visually group Nodes * together. By default, the group will only be shown when a Node in * the group is selected, but you can choose to always show the * groups with ShowNodeGroupsAlways. */ class _XTP_EXT_CLASS CXTPFlowGraphNodeGroup : public CXTPFlowGraphElement { /** @cond */ DECLARE_DYNAMIC(CXTPFlowGraphNodeGroup) /** @endcond */ public: /** * @brief * Constructs a CXTPFlowGraphNodeGroup object. */ CXTPFlowGraphNodeGroup(); /** * @brief * Destroys a CXTPFlowGraphNodeGroup object, handles cleanup and * deallocation. */ virtual ~CXTPFlowGraphNodeGroup(); public: /** * @brief * Adds a Node to the Node group. * @param pNode Reference to the Node to add to the group. */ void AddNode(CXTPFlowGraphNode* pNode); /** * @brief * Removes a Node from the Node group. * @param pNode Reference to the Node to remove from the group. */ void RemoveNode(CXTPFlowGraphNode* pNode); /** * @brief * Removes all nodes from this group. */ void RemoveAll(); /** * @brief * Removes this group from the flow graph's collection of groups. */ void Remove(); /** * @brief * Gets a reference to the parent FlowGraph control. * @return * A reference to the parent FlowGraph control. */ CXTPFlowGraphControl* GetControl() const; /** * @brief * Gets a reference to the page that this group belongs to. * @return * A reference to the page that this group belongs to. */ CXTPFlowGraphPage* GetPage() const; /** * @brief * Get the total number of Nodes that are in the group. * @return * The total number of Nodes that are in the group. */ int GetCount() const; /** * @brief * Retrieves the Node at the specified index from the group's collection * of Nodes. * @param nIndex Index of the specified Node to retrieve. * @return * A reference to the specified Node. */ CXTPFlowGraphNode* GetAt(int nIndex) const; /** * @brief * Gets the bounding rectangle for the group. * @return * The bounding rectangle for the group. */ CRect GetWorkRect() const; /** * @brief * Sets the common caption for each Node in the group. * @param lpszCaption New common caption for each Node in the group. */ void SetCaption(LPCTSTR lpszCaption); /** * @brief * Gets the common caption for each Node in the group. If any Nodes in the group * have a different caption, then the return value will be an empty string. * @return * If all Nodes in the group share the same caption, then the common caption * for each Node in the group will be returned. If any Nodes in the group * have a different caption, then an empty string will be returned. */ CString GetCaption() const; protected: CArray m_arrNodes; /**< Collection of nodes that are in this group. */ CXTPFlowGraphNodeGroups* m_pGroups; /**< Pointer to the collection of groups that this belongs to. */ CRect m_rcWorkRect; /**< Rectangle displayed for this group. */ friend class CXTPFlowGraphNodeGroups; friend class CXTPFlowGraphPage; # ifdef _XTP_ACTIVEX /** @cond */ DECLARE_DISPATCH_MAP() DECLARE_INTERFACE_MAP() DECLARE_OLETYPELIB_EX(CXTPFlowGraphNodeGroup) afx_msg void OleSetCaption(LPCTSTR lpszCaption); afx_msg BSTR OleGetCaption(); afx_msg LPDISPATCH OleGetPage(); afx_msg int OleGetItemCount(); afx_msg LPDISPATCH OleGetItem(int nIndex); afx_msg void OleAddNode(LPDISPATCH Node); afx_msg void OleRemoveNode(LPDISPATCH Node); DECLARE_ENUM_VARIANT(CXTPFlowGraphNodeGroup) /** @endcond */ # endif }; AFX_INLINE int CXTPFlowGraphNodeGroup::GetCount() const { return (int)m_arrNodes.GetSize(); } AFX_INLINE CXTPFlowGraphNode* CXTPFlowGraphNodeGroup::GetAt(int nIndex) const { return nIndex >= 0 && nIndex < m_arrNodes.GetSize() ? m_arrNodes[nIndex] : NULL; } AFX_INLINE CRect CXTPFlowGraphNodeGroup::GetWorkRect() const { return m_rcWorkRect; } /** @cond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif //#if !defined(__XTPFLOWGRAPHNODEGROUP_H__) /** @endcond */