SPPropertyGridInplaceList.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. /********************************************
  2. ** 工作室:S&P工作室
  3. ** 作者 :张东斌
  4. ** 日期 :2007年6月
  5. *********************************************/
  6. #if !defined(__SPPROPERTYGRIDINPLACELIST_H__)
  7. #define __SPPROPERTYGRIDINPLACELIST_H__
  8. #if _MSC_VER > 1000
  9. #pragma once
  10. #endif // _MSC_VER > 1000
  11. // class forwards.
  12. class CSPPropertyGridView;
  13. class CSPPropertyGridItem;
  14. //===========================================================================
  15. // Summary:
  16. // CSPPropertyGridInplaceList is a CListBox derived class.
  17. // It is an internal class used by Property Grid control.
  18. //===========================================================================
  19. class CSPPropertyGridInplaceList : public CListBox
  20. {
  21. DECLARE_DYNAMIC( CSPPropertyGridInplaceList )
  22. public:
  23. //-----------------------------------------------------------------------
  24. // Summary:
  25. // Constructs a CSPPropertyGridInplaceList object
  26. //-----------------------------------------------------------------------
  27. CSPPropertyGridInplaceList();
  28. //-----------------------------------------------------------------------
  29. // Summary:
  30. // Destroys a CSPPropertyGridInplaceList object, handles cleanup
  31. // and deallocation.
  32. //-----------------------------------------------------------------------
  33. virtual ~CSPPropertyGridInplaceList();
  34. //-----------------------------------------------------------------------
  35. // Summary:
  36. // Call this method to create in-place list control.
  37. // Parameters:
  38. // pItem - Parent item of the list.
  39. // rect - Specifies the size and position of the item.
  40. //-----------------------------------------------------------------------
  41. virtual void Create( CSPPropertyGridItem * pItem , CRect rect );
  42. //-----------------------------------------------------------------------
  43. // Summary:
  44. // This method is called when the parent item is destroyed.
  45. //-----------------------------------------------------------------------
  46. virtual void DestroyItem();
  47. private:
  48. CSPPropertyGridItem * m_pItem;
  49. protected:
  50. //-----------------------------------------------------------------------
  51. // Summary:
  52. // Call this method to cancel user changes.
  53. //-----------------------------------------------------------------------
  54. virtual void Cancel( void );
  55. //-----------------------------------------------------------------------
  56. // Summary:
  57. // Call this method to apply user changes.
  58. //-----------------------------------------------------------------------
  59. virtual void Apply( void );
  60. protected:
  61. //{{AFX_CODEJOCK_PRIVATE
  62. DECLARE_MESSAGE_MAP()
  63. //{{AFX_VIRTUAL(CSPPropertyGridInplaceList)
  64. void PostNcDestroy();
  65. //}}AFX_VIRTUAL
  66. //{{AFX_MSG(CSPPropertyGridInplaceList)
  67. afx_msg void OnKillFocus(CWnd* pNewWnd);
  68. afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
  69. afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
  70. afx_msg void OnSysKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
  71. afx_msg int OnMouseActivate(CWnd* pDesktopWnd, UINT nHitTest, UINT message);
  72. //}}AFX_MSG
  73. //}}AFX_CODEJOCK_PRIVATE
  74. private:
  75. BOOL Create( LPCTSTR lpszClassName , LPCTSTR lpszWindowName , DWORD dwStyle , const RECT & rect , CWnd * pParentWnd , UINT nID , CCreateContext * pContext = NULL );
  76. BOOL Create( DWORD dwStyle , const RECT & rect , CWnd * pParentWnd , UINT nID );
  77. friend class CSPPropertyGridItem;
  78. };
  79. //////////////////////////////////////////////////////////////////////////
  80. AFX_INLINE BOOL CSPPropertyGridInplaceList::Create( LPCTSTR lpszClassName , LPCTSTR lpszWindowName , DWORD dwStyle , const RECT & rect , CWnd * pParentWnd , UINT nID , CCreateContext * pContext )
  81. {
  82. return CWnd::Create( lpszClassName,lpszWindowName,dwStyle,rect,pParentWnd,nID,pContext );
  83. }
  84. AFX_INLINE BOOL CSPPropertyGridInplaceList::Create( DWORD dwStyle , const RECT & rect , CWnd * pParentWnd , UINT nID )
  85. {
  86. return CListBox::Create( dwStyle,rect,pParentWnd,nID );
  87. }
  88. #endif // #if !defined(__SPPROPERTYGRIDINPLACELIST_H__)