ComboListCtrl2.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. #if !defined(AFX_ComboBoxLISTCTRL2_H__B26FE6EC_7377_4DA6_BEC1_E3C656DACFB8__INCLUDED_)
  2. #define AFX_ComboBoxLISTCTRL2_H__B26FE6EC_7377_4DA6_BEC1_E3C656DACFB8__INCLUDED_
  3. #if _MSC_VER > 1000
  4. #pragma once
  5. #endif // _MSC_VER > 1000
  6. // ComboBoxListCtrl.h : header file
  7. //
  8. #include "EditListCtrl.h"
  9. #define WM_USER_ComboBox_END WM_USER+1003
  10. class CListCtrlComboBox2 : public CComboBox
  11. {
  12. // Construction
  13. public:
  14. CListCtrlComboBox2();
  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(CListCtrlComboBox2)
  24. public:
  25. virtual BOOL PreTranslateMessage(MSG* pMsg);
  26. //}}AFX_VIRTUAL
  27. // Implementation
  28. public:
  29. virtual ~CListCtrlComboBox2();
  30. // Generated message map functions
  31. protected:
  32. //{{AFX_MSG(CListCtrlComboBox2)
  33. afx_msg void OnKillFocus(CWnd* pNewWnd);
  34. afx_msg void OnSetFocus(CWnd* pOldWnd);
  35. afx_msg void OnCloseup();
  36. //}}AFX_MSG
  37. DECLARE_MESSAGE_MAP()
  38. private:
  39. DWORD m_dwData;
  40. BOOL m_bExchange;
  41. };
  42. /////////////////////////////////////////////////////////////////////////////
  43. //////////////////////////////////////////////////////////////////////////
  44. //////////////////////////////////////////////////////////////////////////
  45. //////////////////////////////////////////////////////////////////////////
  46. //////////////////////////////////////////////////////////////////////////
  47. //////////////////////////////////////////////////////////////////////////
  48. class CComboBoxListCtrl2 : public CListCtrl
  49. {
  50. CSortHeaderCtrl2 m_ctlHeader;
  51. // Construction
  52. public:
  53. CComboBoxListCtrl2();
  54. // Attributes
  55. public:
  56. // Operations
  57. public:
  58. // Overrides
  59. // ClassWizard generated virtual function overrides
  60. //{{AFX_VIRTUAL(CComboBoxListCtrl2)
  61. public:
  62. virtual BOOL PreTranslateMessage(MSG* pMsg);
  63. virtual void PreSubclassWindow();
  64. //}}AFX_VIRTUAL
  65. // Implementation
  66. public:
  67. void InitStyle();
  68. virtual ~CComboBoxListCtrl2();
  69. // Generated message map functions
  70. protected:
  71. //{{AFX_MSG(CComboBoxListCtrl2)
  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. afx_msg void OnComboBoxEnd(WPARAM ,LPARAM lParam = FALSE);
  77. afx_msg void OnEditEnd(WPARAM ,LPARAM lParam = FALSE);
  78. DECLARE_MESSAGE_MAP()
  79. private:
  80. void ShowEdit(BOOL bShow,int nItem,int nIndex,CRect rc = CRect(0,0,0,0));
  81. void ShowComboBox(BOOL bShow,int nItem,int nIndex,CRect rc = CRect(0,0,0,0));
  82. CListCtrlComboBox2 m_ComboBox;
  83. CListCtrlEdit m_edit;
  84. int m_nItem;
  85. int m_nSub;
  86. BOOL Key_Shift(int& nItem,int& nSub);
  87. BOOL Key_Ctrl(int& nItem,int &nSub);
  88. };
  89. //////////////////////////////////////////////////////////////////////////
  90. //////////////////////////////////////////////////////////////////////////
  91. //////////////////////////////////////////////////////////////////////////
  92. //////////////////////////////////////////////////////////////////////////
  93. /////////////////////////////////////////////////////////////////////////////
  94. //{{AFX_INSERT_LOCATION}}
  95. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  96. #endif // !defined(AFX_ComboBoxLISTCTRL2_H__B26FE6EC_7377_4DA6_BEC1_E3C656DACFB8__INCLUDED_)