PropertyGridInPlaceEdit.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. //////////////////////////////////////////////////////////////////////
  2. // InPlaceEdit.h : header file
  3. //
  4. // MFC Grid Control - inplace editing class
  5. //
  6. // Written by Chris Maunder <cmaunder@mail.com>
  7. // Copyright (c) 1998-2002. All Rights Reserved.
  8. //
  9. // This code may be used in compiled form in any way you desire. This
  10. // file may be redistributed unmodified by any means PROVIDING it is
  11. // not sold for profit without the authors written consent, and
  12. // providing that this notice and the authors name and all copyright
  13. // notices remains intact.
  14. //
  15. // An email letting me know how you are using it would be nice as well.
  16. //
  17. // This file is provided "as is" with no expressed or implied warranty.
  18. // The author accepts no liability for any damage/loss of business that
  19. // this product may cause.
  20. //
  21. // For use with CGridCtrl v2.10+
  22. //
  23. //////////////////////////////////////////////////////////////////////
  24. #if !defined(AFX_GRIDINPLACEEDIT_H__ECD42821_16DF_11D1_992F_895E185F9C72__INCLUDED_)
  25. #define AFX_GRIDINPLACEEDIT_H__ECD42821_16DF_11D1_992F_895E185F9C72__INCLUDED_
  26. #if _MSC_VER >= 1000
  27. #pragma once
  28. #endif // _MSC_VER >= 1000
  29. #include <string>
  30. using namespace std;
  31. #define WM_PG_ENDLABELEDIT WM_USER+488
  32. class CPropertyGridInPlaceEdit : public CEdit
  33. {
  34. // Construction
  35. public:
  36. CPropertyGridInPlaceEdit(CWnd* pParent, CRect& rect, DWORD dwStyle, UINT nID, string sInitText);
  37. void SetColors(COLORREF clrBack, COLORREF clrText);
  38. // Attributes
  39. public:
  40. // Operations
  41. public:
  42. void CancelEdit();
  43. void EndEdit();
  44. // Overrides
  45. // ClassWizard generated virtual function overrides
  46. //{{AFX_VIRTUAL(CPropertyGridInPlaceEdit)
  47. public:
  48. virtual BOOL PreTranslateMessage(MSG* pMsg);
  49. //}}AFX_VIRTUAL
  50. // Implementation
  51. public:
  52. virtual ~CPropertyGridInPlaceEdit();
  53. // Generated message map functions
  54. protected:
  55. //{{AFX_MSG(CPropertyGridInPlaceEdit)
  56. afx_msg void OnKillFocus(CWnd* pNewWnd);
  57. afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
  58. afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
  59. afx_msg UINT OnGetDlgCode();
  60. afx_msg HBRUSH CtlColor ( CDC* pDC, UINT nCtlColor );
  61. //}}AFX_MSG
  62. DECLARE_MESSAGE_MAP()
  63. private:
  64. CString m_sInitText;
  65. BOOL m_bExitOnArrows;
  66. CRect m_Rect;
  67. COLORREF m_clrBack;
  68. COLORREF m_clrText;
  69. CBrush m_Brush;
  70. };
  71. /////////////////////////////////////////////////////////////////////////////
  72. //{{AFX_INSERT_LOCATION}}
  73. // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
  74. #endif // !defined(AFX_GRIDINPLACEEDIT_H__ECD42821_16DF_11D1_992F_895E185F9C72__INCLUDED_)