/** * @file XTPShellTreeCtrlView.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(__XTPSHELLTREECTRL_H__) # define __XTPSHELLTREECTRL_H__ /** @endcond */ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" DECLARE_SHELLTREE_BASE(CXTPShellTreeViewBase, CTreeView, CXTPShellTreeBase) DECLARE_SHELLTREE_BASE(CXTPShellTreeCtrlBase, CTreeCtrl, CXTPShellTreeBase) /** * @brief * CXTPShellTreeView is a multiple inheritance class derived from CXTPTreeView * and CXTPShellPidl. It is used to create a CXTPShellTreeView class object. */ class _XTP_EXT_CLASS CXTPShellTreeView : public CXTPShellTreeViewBase { /** @cond */ DECLARE_DYNCREATE(CXTPShellTreeView) /** @endcond */ public: /** * @brief * Constructs a CXTPShellTreeView object. */ CXTPShellTreeView(); /** * @brief * Destroys a CXTPShellTreeView object, handles cleanup and deallocation. */ virtual ~CXTPShellTreeView(); protected: /** * @brief * Called after a user makes a new tree selection. * @details * This member function is called whenever a user makes a selection * within the tree control to synchronize any shell list or shell * comboboxes associated with the tree. You can override this member * to provide additional functionality. * @param hItem Handle to the newly selected tree item. * @param strFolderPath A NULL-terminated string representing the fully * qualified path to the selected tree item. */ virtual void SelectionChanged(HTREEITEM hItem, CString strFolderPath); /** @cond */ DECLARE_MESSAGE_MAP() //{{AFX_VIRTUAL(CXTPShellTreeView) public: virtual void OnInitialUpdate(); protected: virtual void OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint); //}}AFX_VIRTUAL /** @endcond */ protected: }; /** * @brief * CXTPShellTreeCtrl is a multiple inheritance class derived from CXTPTreeCtrl * and CXTPShellPidl. CXTPShellTreeCtrl is used to create a tree control * that displays an explorer style tree, and can be associated with a combobox * and list control. */ class _XTP_EXT_CLASS CXTPShellTreeCtrl : public CXTPShellTreeCtrlBase { /** @cond */ DECLARE_DYNAMIC(CXTPShellTreeCtrl) /** @endcond */ public: /** * @brief * Constructs a CXTPShellTreeCtrl object. */ CXTPShellTreeCtrl(); /** * @brief * Destroys a CXTPShellTreeCtrl object, handles cleanup and deallocation. */ virtual ~CXTPShellTreeCtrl(); public: /** * @brief * This member function is called by the CInitialize class to * perform initialization when the window is created or sub-classed. * @return * TRUE if the window was successfully initialized, otherwise FALSE. */ virtual bool Init(); /** * @brief * Call this member function to enable/disable auto-initialization * of the shell tree control. * @param bEnable TRUE to enable auto-initialization of the shell tree control. */ void EnableAutoInit(BOOL bEnable); /** * @brief * Call this member function to associate a list control with the tree. * @param pWnd Pointer to the list control to be associated with the tree. */ virtual void AssociateList(CWnd* pWnd); /** * @brief * This member function is used to associate a CComboBox object with * the control. Whenever the path changes, the combo is updated. * @param pWnd Pointer to the combobox to be associated with the tree. */ virtual void AssociateCombo(CWnd* pWnd); protected: /** * @brief * Called after a user makes a new tree selection. * @details * This member function is called whenever a user makes a selection * within the tree control to synchronize any shell list or shell * comboboxes associated with the tree. You can override this member * to provide additional functionality. * @param hItem Handle to the newly selected tree item. * @param strFolderPath A NULL-terminated string representing the fully * qualified path to the selected tree item. */ virtual void SelectionChanged(HTREEITEM hItem, CString strFolderPath); protected: /** @cond */ DECLARE_MESSAGE_MAP() //{{AFX_VIRTUAL(CXTPShellTreeCtrl) //}}AFX_VIRTUAL //{{AFX_MSG(CXTPShellTreeCtrl) afx_msg LRESULT OnUpdateShell(WPARAM wParam, LPARAM lParam); //}}AFX_MSG /** @endcond */ protected: BOOL m_bAutoInit; /**< TRUE if the tree control is to automatically initialize when created. */ CWnd* m_pListCtrl; /**< Window that receives the update notification, usually a CXTPShellListCtrl. */ }; /** @cond */ # define CXTPShellTree CXTPShellTreeCtrl /** @endcond */ ////////////////////////////////////////////////////////////////////// /** @cond */ AFX_INLINE void CXTPShellTreeCtrl::EnableAutoInit(BOOL bEnable) { m_bAutoInit = bEnable; } /** @endcond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" /** @cond */ #endif // !defined(__XTPSHELLTREECTRL_H__) /** @endcond */