EditListCtrl2.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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. #ifdef VC60
  80. afx_msg void OnDateEditEnd(WPARAM ,LPARAM lParam = FALSE);
  81. afx_msg void OnEditEnd(WPARAM ,LPARAM lParam = FALSE);
  82. afx_msg void OnComboBoxEnd(WPARAM ,LPARAM lParam = FALSE);
  83. #else
  84. afx_msg LRESULT OnDateEditEnd(WPARAM ,LPARAM lParam = FALSE);
  85. afx_msg LRESULT OnEditEnd(WPARAM ,LPARAM lParam = FALSE);
  86. afx_msg LRESULT OnComboBoxEnd(WPARAM ,LPARAM lParam = FALSE);
  87. #endif
  88. DECLARE_MESSAGE_MAP()
  89. private:
  90. void ShowEdit(BOOL bShow,int nItem,int nIndex,CRect rc = CRect(0,0,0,0));
  91. void ShowDateEdit(BOOL bShow,int nItem,int nIndex,CRect rc = CRect(0,0,0,0));
  92. void ShowComboBox(BOOL bShow,int nItem,int nIndex,CRect rc = CRect(0,0,0,0));
  93. CListCtrlEdit2 m_edit;
  94. CListCtrlComboBox m_ComboBox;
  95. CDateEdit m_dateedit;
  96. int m_nItem;
  97. int m_nSub;
  98. BOOL Key_Shift(int& nItem,int& nSub);
  99. BOOL Key_Ctrl(int& nItem,int &nSub);
  100. };
  101. //////////////////////////////////////////////////////////////////////////
  102. //////////////////////////////////////////////////////////////////////////
  103. //////////////////////////////////////////////////////////////////////////
  104. //////////////////////////////////////////////////////////////////////////
  105. /////////////////////////////////////////////////////////////////////////////
  106. //{{AFX_INSERT_LOCATION}}
  107. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  108. #endif // !defined(AFX_EditListCtrl2_H__B26FE6EC_7377_4DA6_BEC1_E3C656DACFB8__INCLUDED_)