EditListCtrl.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. #if !defined(AFX_EDITLISTCTRL_H__B26FE6EC_7377_4DA6_BEC1_E3C656DACFB8__INCLUDED_)
  2. #define AFX_EDITLISTCTRL_H__B26FE6EC_7377_4DA6_BEC1_E3C656DACFB8__INCLUDED_
  3. #if _MSC_VER > 1000
  4. #pragma once
  5. #endif // _MSC_VER > 1000
  6. // EditListCtrl.h : header file
  7. //
  8. #define WM_USER_EDIT_END WM_USER+1001
  9. class CListCtrlEdit : public CEdit
  10. {
  11. // Construction
  12. public:
  13. CListCtrlEdit();
  14. // Attributes
  15. public:
  16. void SetCtrlData(DWORD dwData);
  17. DWORD GetCtrlData();
  18. // Operations
  19. public:
  20. // Overrides
  21. // ClassWizard generated virtual function overrides
  22. //{{AFX_VIRTUAL(CListCtrlEdit)
  23. public:
  24. virtual BOOL PreTranslateMessage(MSG* pMsg);
  25. //}}AFX_VIRTUAL
  26. // Implementation
  27. public:
  28. virtual ~CListCtrlEdit();
  29. // Generated message map functions
  30. protected:
  31. //{{AFX_MSG(CListCtrlEdit)
  32. afx_msg void OnKillFocus(CWnd* pNewWnd);
  33. afx_msg void OnSetFocus(CWnd* pOldWnd);
  34. //}}AFX_MSG
  35. DECLARE_MESSAGE_MAP()
  36. private:
  37. DWORD m_dwData;
  38. BOOL m_bExchange;
  39. };
  40. /////////////////////////////////////////////////////////////////////////////
  41. //////////////////////////////////////////////////////////////////////////
  42. //////////////////////////////////////////////////////////////////////////
  43. //////////////////////////////////////////////////////////////////////////
  44. //////////////////////////////////////////////////////////////////////////
  45. //////////////////////////////////////////////////////////////////////////
  46. class CEditListCtrl : public CListCtrl
  47. {
  48. // Construction
  49. public:
  50. CEditListCtrl();
  51. // Attributes
  52. public:
  53. // Operations
  54. public:
  55. // Overrides
  56. // ClassWizard generated virtual function overrides
  57. //{{AFX_VIRTUAL(CEditListCtrl)
  58. public:
  59. virtual BOOL PreTranslateMessage(MSG* pMsg);
  60. //}}AFX_VIRTUAL
  61. // Implementation
  62. public:
  63. void InitStyle();
  64. virtual ~CEditListCtrl();
  65. // Generated message map functions
  66. protected:
  67. //{{AFX_MSG(CEditListCtrl)
  68. afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
  69. afx_msg void OnParentNotify(UINT message, LPARAM lParam);
  70. //}}AFX_MSG
  71. afx_msg void OnEditEnd(WPARAM ,LPARAM lParam = FALSE);
  72. DECLARE_MESSAGE_MAP()
  73. private:
  74. void ShowEdit(BOOL bShow,int nItem,int nIndex,CRect rc = CRect(0,0,0,0));
  75. CListCtrlEdit m_edit;
  76. int m_nItem;
  77. int m_nSub;
  78. BOOL Key_Shift(int& nItem,int& nSub);
  79. BOOL Key_Ctrl(int& nItem,int &nSub);
  80. };
  81. //////////////////////////////////////////////////////////////////////////
  82. //////////////////////////////////////////////////////////////////////////
  83. //////////////////////////////////////////////////////////////////////////
  84. //////////////////////////////////////////////////////////////////////////
  85. /////////////////////////////////////////////////////////////////////////////
  86. //{{AFX_INSERT_LOCATION}}
  87. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  88. #endif // !defined(AFX_EDITLISTCTRL_H__B26FE6EC_7377_4DA6_BEC1_E3C656DACFB8__INCLUDED_)