InPlaceEdit.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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-2001. 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_INPLACEEDIT_H__ECD42821_16DF_11D1_992F_895E185F9C72__INCLUDED_)
  25. #define AFX_INPLACEEDIT_H__ECD42821_16DF_11D1_992F_895E185F9C72__INCLUDED_
  26. #if _MSC_VER >= 1000
  27. #pragma once
  28. #endif // _MSC_VER >= 1000
  29. class CInPlaceEdit : public CEdit
  30. {
  31. // Construction
  32. public:
  33. CInPlaceEdit(CWnd* pParent, CRect& rect, DWORD dwStyle, UINT nID,
  34. int nRow, int nColumn, CString sInitText, UINT nFirstChar);
  35. // Attributes
  36. public:
  37. // Operations
  38. public:
  39. void EndEdit();
  40. // Overrides
  41. // ClassWizard generated virtual function overrides
  42. //{{AFX_VIRTUAL(CInPlaceEdit)
  43. public:
  44. virtual BOOL PreTranslateMessage(MSG* pMsg);
  45. protected:
  46. virtual void PostNcDestroy();
  47. //}}AFX_VIRTUAL
  48. // Implementation
  49. public:
  50. virtual ~CInPlaceEdit();
  51. // Generated message map functions
  52. protected:
  53. //{{AFX_MSG(CInPlaceEdit)
  54. afx_msg void OnKillFocus(CWnd* pNewWnd);
  55. afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
  56. afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
  57. afx_msg UINT OnGetDlgCode();
  58. //}}AFX_MSG
  59. DECLARE_MESSAGE_MAP()
  60. private:
  61. int m_nRow;
  62. int m_nColumn;
  63. CString m_sInitText;
  64. UINT m_nLastChar;
  65. BOOL m_bExitOnArrows;
  66. CRect m_Rect;
  67. };
  68. /////////////////////////////////////////////////////////////////////////////
  69. //{{AFX_INSERT_LOCATION}}
  70. // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
  71. #endif // !defined(AFX_INPLACEEDIT_H__ECD42821_16DF_11D1_992F_895E185F9C72__INCLUDED_)