InPlaceEdit.h 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. #if !defined(AFX_INPLACEEDIT_H__ECD42821_16DF_11D1_992F_895E185F9C72__INCLUDED_)
  2. #define AFX_INPLACEEDIT_H__ECD42821_16DF_11D1_992F_895E185F9C72__INCLUDED_
  3. #if _MSC_VER >= 1000
  4. #pragma once
  5. #endif // _MSC_VER >= 1000
  6. /////////////////////////////////////////////////////////////////////////////
  7. // InPlaceEdit.h : header file
  8. //
  9. // Written by Chris Maunder (chrismaunder@codeguru.com)
  10. // Copyright (c) 1998.
  11. //
  12. // The code contained in this file is based on the original
  13. // CInPlaceEdit from http://www.codeguru.com/listview/edit_subitems.shtml
  14. //
  15. // This code may be used in compiled form in any way you desire. This
  16. // file may be redistributed unmodified by any means PROVIDING it is
  17. // not sold for profit without the authors written consent, and
  18. // providing that this notice and the authors name is included. If
  19. // the source code in this file is used in any commercial application
  20. // then acknowledgement must be made to the author of this file
  21. // (in whatever form you wish).
  22. //
  23. // This file is provided "as is" with no expressed or implied warranty.
  24. // The author accepts no liability for any damage/loss of business that
  25. // this product may cause.
  26. //
  27. // Expect bugs!
  28. //
  29. // Please use and enjoy. Please let me know of any bugs/mods/improvements
  30. // that you have found/implemented and I will fix/incorporate them into this
  31. // file.
  32. //
  33. /////////////////////////////////////////////////////////////////////////////
  34. /////////////////////////////////////////////////////////////////////////////
  35. // CInPlaceEdit window
  36. class CInPlaceEdit : public CEdit
  37. {
  38. // Construction
  39. public:
  40. CInPlaceEdit(CWnd* pParent, CRect& rect, DWORD dwStyle, UINT nID,
  41. int nRow, int nColumn, CString sInitText, UINT nFirstChar);
  42. // Attributes
  43. public:
  44. // Operations
  45. public:
  46. void EndEdit();
  47. // Overrides
  48. // ClassWizard generated virtual function overrides
  49. //{{AFX_VIRTUAL(CInPlaceEdit)
  50. public:
  51. virtual BOOL PreTranslateMessage(MSG* pMsg);
  52. protected:
  53. virtual void PostNcDestroy();
  54. //}}AFX_VIRTUAL
  55. // Implementation
  56. public:
  57. virtual ~CInPlaceEdit();
  58. // Generated message map functions
  59. protected:
  60. //{{AFX_MSG(CInPlaceEdit)
  61. afx_msg void OnKillFocus(CWnd* pNewWnd);
  62. afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
  63. afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
  64. afx_msg UINT OnGetDlgCode();
  65. //}}AFX_MSG
  66. DECLARE_MESSAGE_MAP()
  67. private:
  68. int m_nRow;
  69. int m_nColumn;
  70. CString m_sInitText;
  71. UINT m_nLastChar;
  72. BOOL m_bExitOnArrows;
  73. CRect m_Rect;
  74. };
  75. /////////////////////////////////////////////////////////////////////////////
  76. //{{AFX_INSERT_LOCATION}}
  77. // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
  78. #endif // !defined(AFX_INPLACEEDIT_H__ECD42821_16DF_11D1_992F_895E185F9C72__INCLUDED_)