EditListCtrl.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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+1002
  9. #include "ComboListCtrl.h"
  10. #include "MyEdit.h"
  11. class CListCtrlEdit : public CMyEdit
  12. {
  13. DECLARE_DYNAMIC(CListCtrlEdit)
  14. public:
  15. CListCtrlEdit();
  16. virtual ~CListCtrlEdit();
  17. // Attributes
  18. public:
  19. void SetCtrlData(DWORD dwData);
  20. DWORD GetCtrlData();
  21. void SetInput(const DWORD dwRight);
  22. void SetOthers(const char* pOthers, const int nSize);
  23. public:
  24. virtual BOOL PreTranslateMessage(MSG* pMsg);
  25. protected:
  26. afx_msg void OnKillFocus(CWnd* pNewWnd);
  27. afx_msg void OnSetFocus(CWnd* pOldWnd);
  28. //afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
  29. DECLARE_MESSAGE_MAP()
  30. private:
  31. DWORD m_dwData;
  32. BOOL m_bExchange;
  33. /*
  34. DWORD m_dwRight; //可输入权限
  35. char* m_pOthers; //其它允许输入
  36. */
  37. };
  38. /////////////////////////////////////////////////////////////////////////////
  39. //////////////////////////////////////////////////////////////////////////
  40. //////////////////////////////////////////////////////////////////////////
  41. //////////////////////////////////////////////////////////////////////////
  42. //////////////////////////////////////////////////////////////////////////
  43. //////////////////////////////////////////////////////////////////////////
  44. class CEditListCtrl : public CListCtrl
  45. {
  46. CSortHeaderCtrl2 m_ctlHeader;
  47. // Construction
  48. public:
  49. CEditListCtrl();
  50. // Attributes
  51. public:
  52. BOOL SetItemText(int nItem, int nSubItem, LPCTSTR lpszText);
  53. CString GetItemText(int nItem, int nSubItem);
  54. // Operations
  55. public:
  56. // Overrides
  57. // ClassWizard generated virtual function overrides
  58. //{{AFX_VIRTUAL(CEditListCtrl)
  59. public:
  60. virtual BOOL PreTranslateMessage(MSG* pMsg);
  61. protected:
  62. virtual void PreSubclassWindow();
  63. //}}AFX_VIRTUAL
  64. // Implementation
  65. public:
  66. int m_mode;
  67. void InitStyle();
  68. virtual ~CEditListCtrl();
  69. // Generated message map functions
  70. protected:
  71. //{{AFX_MSG(CEditListCtrl)
  72. afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
  73. afx_msg void OnParentNotify(UINT message, LPARAM lParam);
  74. afx_msg void OnCustomdrawList(NMHDR*, LRESULT*);
  75. //}}AFX_MSG
  76. #ifdef VC60
  77. afx_msg void OnDateEditEnd(WPARAM ,LPARAM lParam = FALSE);
  78. afx_msg void OnEditEnd(WPARAM ,LPARAM lParam = FALSE);
  79. afx_msg void OnComboBoxEnd(WPARAM ,LPARAM lParam = FALSE);
  80. #else
  81. afx_msg LRESULT OnDateEditEnd(WPARAM ,LPARAM lParam = FALSE);
  82. afx_msg LRESULT OnEditEnd(WPARAM ,LPARAM lParam = FALSE);
  83. afx_msg LRESULT OnComboBoxEnd(WPARAM ,LPARAM lParam = FALSE);
  84. #endif
  85. DECLARE_MESSAGE_MAP()
  86. private:
  87. void ShowEdit(BOOL bShow,int nItem,int nIndex,CRect rc = CRect(0,0,0,0));
  88. void ShowDateEdit(BOOL bShow,int nItem,int nIndex,CRect rc = CRect(0,0,0,0));
  89. void ShowComboBox(BOOL bShow,int nItem,int nIndex,CRect rc = CRect(0,0,0,0));
  90. CListCtrlEdit m_edit;
  91. CListCtrlComboBox m_ComboBox;
  92. CDateEdit m_dateedit;
  93. int m_nItem;
  94. int m_nSub;
  95. BOOL Key_Shift(int& nItem,int& nSub);
  96. BOOL Key_Ctrl(int& nItem,int &nSub);
  97. };
  98. //////////////////////////////////////////////////////////////////////////
  99. //////////////////////////////////////////////////////////////////////////
  100. //////////////////////////////////////////////////////////////////////////
  101. //////////////////////////////////////////////////////////////////////////
  102. /////////////////////////////////////////////////////////////////////////////
  103. //{{AFX_INSERT_LOCATION}}
  104. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  105. #endif // !defined(AFX_EDITLISTCTRL_H__B26FE6EC_7377_4DA6_BEC1_E3C656DACFB8__INCLUDED_)