EditListCtrl2.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. #if !defined(AFX_EditListCtrl2_H__B26FE6EC_7377_4DA6_BEC1_E3C656DACFB8__INCLUDED_)
  2. #define AFX_EditListCtrl2_H__B26FE6EC_7377_4DA6_BEC1_E3C656DACFB8__INCLUDED_
  3. #if _MSC_VER > 1000
  4. #pragma once
  5. #endif // _MSC_VER > 1000
  6. // EditListCtrl2.h : header file
  7. //
  8. #define WM_USER_EDIT_END WM_USER+1002
  9. #include "ComboListCtrl.h"
  10. class CListCtrlEdit2 : public CEdit
  11. {
  12. // Construction
  13. public:
  14. CListCtrlEdit2();
  15. // Attributes
  16. public:
  17. void SetCtrlData(DWORD dwData);
  18. DWORD GetCtrlData();
  19. // Operations
  20. public:
  21. // Overrides
  22. // ClassWizard generated virtual function overrides
  23. //{{AFX_VIRTUAL(CListCtrlEdit2)
  24. public:
  25. virtual BOOL PreTranslateMessage(MSG* pMsg);
  26. //}}AFX_VIRTUAL
  27. // Implementation
  28. public:
  29. virtual ~CListCtrlEdit2();
  30. // Generated message map functions
  31. protected:
  32. //{{AFX_MSG(CListCtrlEdit2)
  33. afx_msg void OnKillFocus(CWnd* pNewWnd);
  34. afx_msg void OnSetFocus(CWnd* pOldWnd);
  35. //}}AFX_MSG
  36. DECLARE_MESSAGE_MAP()
  37. private:
  38. DWORD m_dwData;
  39. BOOL m_bExchange;
  40. };
  41. /////////////////////////////////////////////////////////////////////////////
  42. //////////////////////////////////////////////////////////////////////////
  43. //////////////////////////////////////////////////////////////////////////
  44. //////////////////////////////////////////////////////////////////////////
  45. //////////////////////////////////////////////////////////////////////////
  46. //////////////////////////////////////////////////////////////////////////
  47. class CEditListCtrl2 : public CListCtrl
  48. {
  49. CSortHeaderCtrl2 m_ctlHeader;
  50. // Construction
  51. public:
  52. CEditListCtrl2();
  53. // Attributes
  54. public:
  55. BOOL SetItemText(int nItem, int nSubItem, LPCTSTR lpszText);
  56. CString GetItemText(int nItem, int nSubItem);
  57. // Operations
  58. public:
  59. // Overrides
  60. // ClassWizard generated virtual function overrides
  61. //{{AFX_VIRTUAL(CEditListCtrl2)
  62. public:
  63. virtual BOOL PreTranslateMessage(MSG* pMsg);
  64. protected:
  65. virtual void PreSubclassWindow();
  66. //}}AFX_VIRTUAL
  67. // Implementation
  68. public:
  69. int m_mode;
  70. void InitStyle();
  71. virtual ~CEditListCtrl2();
  72. // Generated message map functions
  73. protected:
  74. //{{AFX_MSG(CEditListCtrl2)
  75. afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
  76. afx_msg void OnParentNotify(UINT message, LPARAM lParam);
  77. afx_msg void OnCustomdrawList(NMHDR*, LRESULT*);
  78. //}}AFX_MSG
  79. afx_msg void OnDateEditEnd(WPARAM ,LPARAM lParam = FALSE);
  80. afx_msg void OnEditEnd(WPARAM ,LPARAM lParam = FALSE);
  81. afx_msg void OnComboBoxEnd(WPARAM ,LPARAM lParam = FALSE);
  82. DECLARE_MESSAGE_MAP()
  83. private:
  84. void ShowEdit(BOOL bShow,int nItem,int nIndex,CRect rc = CRect(0,0,0,0));
  85. void ShowDateEdit(BOOL bShow,int nItem,int nIndex,CRect rc = CRect(0,0,0,0));
  86. void ShowComboBox(BOOL bShow,int nItem,int nIndex,CRect rc = CRect(0,0,0,0));
  87. CListCtrlEdit2 m_edit;
  88. CListCtrlComboBox m_ComboBox;
  89. CDateEdit m_dateedit;
  90. int m_nItem;
  91. int m_nSub;
  92. BOOL Key_Shift(int& nItem,int& nSub);
  93. BOOL Key_Ctrl(int& nItem,int &nSub);
  94. };
  95. //////////////////////////////////////////////////////////////////////////
  96. //////////////////////////////////////////////////////////////////////////
  97. //////////////////////////////////////////////////////////////////////////
  98. //////////////////////////////////////////////////////////////////////////
  99. /////////////////////////////////////////////////////////////////////////////
  100. //{{AFX_INSERT_LOCATION}}
  101. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  102. #endif // !defined(AFX_EditListCtrl2_H__B26FE6EC_7377_4DA6_BEC1_E3C656DACFB8__INCLUDED_)