PropertyGridInplaceEdit.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #pragma once
  2. // class forwards.
  3. class CPropertyGridView;
  4. class CPropertyGridItem;
  5. //////////////////////////////////////////////////////////////////////
  6. // CPropertyGridInplaceEdit is a CEdit derived class.
  7. // It is an internal class used by Property Grid control
  8. //
  9. class CPropertyGridInplaceEdit : public CEdit
  10. {
  11. DECLARE_DYNAMIC(CPropertyGridInplaceEdit)
  12. public:
  13. CPropertyGridInplaceEdit();
  14. virtual ~CPropertyGridInplaceEdit();
  15. virtual void SetValue(CString strValue);
  16. virtual void HideWindow();
  17. // 编辑框的最大字符数,0表示无限制
  18. virtual void Create(CPropertyGridItem* pItem, CRect rect, UINT nMaxLength);
  19. virtual void DestroyItem();
  20. CPropertyGridItem* GetItem();
  21. private:
  22. CString m_strValue;
  23. CBrush m_brBack;
  24. CWnd* m_pGrid;
  25. CPropertyGridItem* m_pItem;
  26. UINT m_nDefaultMaxLength; // 编辑框最大字符数的缺省值
  27. protected:
  28. //{{AFX_VIRTUAL(CPropertyGridInplaceEdit)
  29. virtual BOOL PreTranslateMessage(MSG* pMsg);
  30. //}}AFX_VIRTUAL
  31. virtual BOOL SelectConstraint(int nDirection, BOOL bCircle);
  32. //{{AFX_MSG(CPropertyGridInplaceEdit)
  33. afx_msg HBRUSH CtlColor(CDC* pDC, UINT nCtlColor);
  34. afx_msg void OnEnKillfocus();
  35. afx_msg void OnEnSetfocus();
  36. afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
  37. //}}AFX_MSG
  38. DECLARE_MESSAGE_MAP()
  39. friend class CPropertyGridItem;
  40. };
  41. AFX_INLINE CPropertyGridItem* CPropertyGridInplaceEdit::GetItem() {
  42. return m_pItem;
  43. }