/** * @file XTPShellListCtrlView.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(__XTPSHELLLISTCTRLVIEW_H__) # define __XTPSHELLLISTCTRLVIEW_H__ /** @endcond */ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" DECLARE_SHELLLIST_BASE(CXTPShellListViewBase, CListView, CXTPShellListBase) DECLARE_SHELLLIST_BASE(CXTPShellListCtrlBase, CListCtrl, CXTPShellListBase) /** * @brief * CXTPShellListView is a multiple inheritance class derived from CXTPListView * and CXTPShellPidl. It is used to create a CXTPShellListView class object. */ class _XTP_EXT_CLASS CXTPShellListView : public CXTPShellListViewBase { /** @cond */ DECLARE_DYNCREATE(CXTPShellListView) /** @endcond */ public: /** * @brief * Constructs a CXTPShellListView object. */ CXTPShellListView(); /** * @brief * Destroys a CXTPShellListView object, handles cleanup and deallocation. */ virtual ~CXTPShellListView(); protected: /** * @brief * Occurs when the user double clicks on the list control. * @param pNMHDR Address of an NMHDR structure that contains the notification * code and additional information. For some notification messages, * this parameter points to a larger structure that has the NMHDR * structure as its first member. * @param pResult Pointer to an LRESULT variable in which to store the result * code if the message is handled. */ void OnDblclk(NMHDR* pNMHDR, LRESULT* pResult); protected: /** @cond */ DECLARE_MESSAGE_MAP() //{{AFX_VIRTUAL(CXTPShellListView) virtual BOOL PreCreateWindow(CREATESTRUCT& cs); virtual void OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint); //}}AFX_VIRTUAL //{{AFX_MSG(CXTPShellListView) afx_msg LRESULT OnUpdateShell(WPARAM wParam, LPARAM lParam); afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags); //}}AFX_MSG /** @endcond */ }; /** * @brief * CXTPShellListCtrl is a multiple inheritance class derived from CXTPListCtrl * and CXTPShellPidl. It is used to create a CXTPShellListCtrl window. */ class _XTP_EXT_CLASS CXTPShellListCtrl : public CXTPShellListCtrlBase { public: /** * @brief * Constructs a CXTPShellListCtrl object. */ CXTPShellListCtrl(); /** * @brief * Destroys a CXTPShellListCtrl object, handles cleanup and deallocation. */ virtual ~CXTPShellListCtrl(); public: /** * @brief * Call this member function to associate the tree control with the list. * @param pWnd Pointer to the tree control that is associated with the list. */ virtual void AssociateTree(CWnd* pWnd); protected: /** @cond */ DECLARE_MESSAGE_MAP() //{{AFX_MSG(CXTPShellListCtrl) afx_msg void OnDblclk(NMHDR* pNMHDR, LRESULT* pResult); afx_msg LRESULT OnUpdateShell(WPARAM wParam, LPARAM lParam); afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags); //}}AFX_MSG /** @endcond */ protected: CWnd* m_pTreeCtrl; /**< Window that receives update notification, usually a CXTPShellTreeCtrl. */ bool m_bInitControl; /**< true if the control has not been initialized. */ }; /** @cond */ # define CXTPShellList CXTPShellListCtrl /** @endcond */ ////////////////////////////////////////////////////////////////////// /** @cond */ AFX_INLINE void CXTPShellListCtrl::AssociateTree(CWnd* pWnd) { _ASSERTE(pWnd); m_pTreeCtrl = pWnd; } /** @endcond */ /** * @brief * CXTPShellListCtrlEx is a CXTPShellListCtrl derived class. It is used to create * a standalone shell list control that is not dependent on a CXTPShellTreeCtrl * for initialization. It is used to create a CXTPShellListCtrlEx window for * displaying the contents of file folders. */ class _XTP_EXT_CLASS CXTPShellListCtrlEx : public CXTPShellListCtrl { public: /** * @brief * Constructs a CXTPShellListCtrlEx object. */ CXTPShellListCtrlEx(); /** * @brief * Destroys a CXTPShellListCtrlEx object, handles cleanup and deallocation. */ virtual ~CXTPShellListCtrlEx(); public: /** * @brief * This member function is called to browse to a particular file folder. * @param lpszPath A NULL-terminated string that represents the folder to select. * @return * true if successful, otherwise false. */ bool BrowseToFolder(LPCTSTR lpszPath); /** * @brief * This member function will associate a CWnd object with the shell list * control. This window is usually a CEdit control, but can be any CWnd * object. This window will have its window text updated whenever the * selected folder is changed. * @param pSyncWnd Pointer to a valid CWnd object. */ void SetSyncWnd(CWnd* pSyncWnd); protected: /** @cond */ DECLARE_MESSAGE_MAP() //{{AFX_VIRTUAL(CXTPShellListCtrlEx) //}}AFX_VIRTUAL //{{AFX_MSG(CXTPShellListCtrlEx) afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point); //}}AFX_MSG /** @endcond */ protected: CWnd* m_pSyncWnd; /**< Pointer to the window to synchronize with the shell list control. */ CString m_strItemPath; /**< A NULL-terminated string that represents the currently selected folder. */ }; ///////////////////////////////////////////////////////////////////////////// /** @cond */ AFX_INLINE void CXTPShellListCtrlEx::SetSyncWnd(CWnd* pSyncWnd) { m_pSyncWnd = pSyncWnd; } /** @endcond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" /** @cond */ #endif // !defined(__XTPSHELLLISTCTRLVIEW_H__) /** @endcond */