/** * @file XTPPropertyGridInplaceList.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(__XTPPROPERTYGRIDINPLACELIST_H__) # define __XTPPROPERTYGRIDINPLACELIST_H__ /** @endcond */ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" // class forwards. class CXTPPropertyGridView; class CXTPPropertyGridItem; /** * @brief * CXTPPropertyGridInplaceList is a CListBox derived class. * It is an internal class used by the property grid control. */ class _XTP_EXT_CLASS CXTPPropertyGridInplaceList : public CListBox { /** @cond */ DECLARE_DYNAMIC(CXTPPropertyGridInplaceList) /** @endcond */ public: /** * @brief * Constructs a CXTPPropertyGridInplaceList object. */ CXTPPropertyGridInplaceList(); /** * @brief * Destroys a CXTPPropertyGridInplaceList object, handles cleanup * and deallocation. */ virtual ~CXTPPropertyGridInplaceList(); /** * @brief * Creates an in-place list control. * @param pItem Pointer to the parent item of the list. * @param rect Specifies the size and position of the item. */ virtual void Create(CXTPPropertyGridItem* pItem, CRect rect); /** * @brief * This method is called when the parent item is destroyed. */ virtual void DestroyItem(); private: CXTPPropertyGridItem* m_pItem; protected: /** * @brief * Call this method to cancel user changes. */ virtual void Cancel(); /** * @brief * Call this method to apply user changes. */ virtual void Apply(); protected: /** @cond */ DECLARE_MESSAGE_MAP() //{{AFX_VIRTUAL(CXTPPropertyGridInplaceList) void PostNcDestroy(); void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct); void MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct); BOOL PreTranslateMessage(MSG* pMsg); //}}AFX_VIRTUAL //{{AFX_MSG(CXTPPropertyGridInplaceList) afx_msg void OnKillFocus(CWnd* pNewWnd); afx_msg void OnLButtonUp(UINT nFlags, CPoint point); afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags); afx_msg void OnSysKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags); afx_msg int OnMouseActivate(CWnd* pDesktopWnd, UINT nHitTest, UINT message); afx_msg UINT OnGetDlgCode(); afx_msg void OnMouseMove(UINT nFlags, CPoint point); afx_msg void OnNcPaint(); //}}AFX_MSG /** @endcond */ public: static BOOL m_bShowShadow; /**< TRUE to show shadow for inplace list. */ static BOOL m_bTrackSelection; /**< TRUE to select on Mouse move */ private: BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL); BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID); friend class CXTPPropertyGridItem; }; /** * @brief * CXTPPropertyGridInplaceMultilineEdit is a CEdit derived class. * It is an internal class used by the property grid control. */ class _XTP_EXT_CLASS CXTPPropertyGridInplaceMultilineEdit : public CEdit { /** @cond */ DECLARE_DYNAMIC(CXTPPropertyGridInplaceMultilineEdit) /** @endcond */ public: /** * @brief * Constructs a CXTPPropertyGridInplaceList object. */ CXTPPropertyGridInplaceMultilineEdit(); /** * @brief * Destroys a CXTPPropertyGridInplaceList object, handles cleanup * and deallocation. */ virtual ~CXTPPropertyGridInplaceMultilineEdit(); /** * @brief * Creates an in-place control. * @param pItem Pointer to the parent item of the control. * @param rect Specifies the size and position of the item. */ virtual void Create(CXTPPropertyGridItem* pItem, CRect rect); private: CXTPPropertyGridItem* m_pItem; protected: /** * @brief * Call this method to cancel user changes. */ virtual void Cancel(); /** * @brief * Call this method to apply user changes. */ virtual void Apply(); protected: /** @cond */ DECLARE_MESSAGE_MAP() //{{AFX_VIRTUAL(CXTPPropertyGridInplaceList) void PostNcDestroy(); BOOL PreTranslateMessage(MSG* pMsg); //}}AFX_VIRTUAL //{{AFX_MSG(CXTPPropertyGridInplaceList) afx_msg void OnKillFocus(CWnd* pNewWnd); afx_msg void OnLButtonUp(UINT nFlags, CPoint point); afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags); afx_msg void OnSysKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags); afx_msg int OnMouseActivate(CWnd* pDesktopWnd, UINT nHitTest, UINT message); afx_msg UINT OnGetDlgCode(); //}}AFX_MSG /** @endcond */ private: BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL); BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID); friend class CXTPPropertyGridItem; }; ////////////////////////////////////////////////////////////////////////// AFX_INLINE BOOL CXTPPropertyGridInplaceList::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext) { return CWnd::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext); } AFX_INLINE BOOL CXTPPropertyGridInplaceList::Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID) { return CListBox::Create(dwStyle, rect, pParentWnd, nID); } AFX_INLINE BOOL CXTPPropertyGridInplaceMultilineEdit::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext) { return CWnd::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext); } AFX_INLINE BOOL CXTPPropertyGridInplaceMultilineEdit::Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID) { return CEdit::Create(dwStyle, rect, pParentWnd, nID); } /** @cond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif // #if !defined(__XTPPROPERTYGRIDINPLACELIST_H__) /** @endcond */