ComboListCtrl.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. #if !defined(AFX_ComboBoxLISTCTRL_H__B26FE6EC_7377_4DA6_BEC1_E3C656DACFB8__INCLUDED_)
  2. #define AFX_ComboBoxLISTCTRL_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. #define WM_USER_ComboBox_END WM_USER+1001
  9. class CListCtrlComboBox : public CComboBox
  10. {
  11. // Construction
  12. public:
  13. CListCtrlComboBox();
  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(CListCtrlComboBox)
  23. public:
  24. virtual BOOL PreTranslateMessage(MSG* pMsg);
  25. //}}AFX_VIRTUAL
  26. // Implementation
  27. public:
  28. virtual ~CListCtrlComboBox();
  29. // Generated message map functions
  30. protected:
  31. //{{AFX_MSG(CListCtrlComboBox)
  32. afx_msg void OnKillFocus(CWnd* pNewWnd);
  33. afx_msg void OnSetFocus(CWnd* pOldWnd);
  34. afx_msg void OnCloseup();
  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 CComboBoxListCtrl : public CListCtrl
  48. {
  49. CSortHeaderCtrl2 m_ctlHeader;
  50. BOOL m_bNeedSel;
  51. // Construction
  52. public:
  53. CComboBoxListCtrl();
  54. // Attributes
  55. public:
  56. CArray<CStringArray, CStringArray>*m_sparray;
  57. // Operations
  58. public:
  59. // Overrides
  60. // ClassWizard generated virtual function overrides
  61. //{{AFX_VIRTUAL(CComboBoxListCtrl)
  62. public:
  63. virtual BOOL PreTranslateMessage(MSG* pMsg);
  64. virtual void PreSubclassWindow();
  65. //}}AFX_VIRTUAL
  66. // Implementation
  67. public:
  68. void InitStyle();
  69. virtual ~CComboBoxListCtrl();
  70. // Generated message map functions
  71. protected:
  72. //{{AFX_MSG(CComboBoxListCtrl)
  73. afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
  74. afx_msg void OnParentNotify(UINT message, LPARAM lParam);
  75. afx_msg void OnCustomdrawList(NMHDR*, LRESULT*);
  76. //}}AFX_MSG
  77. #ifdef VC60
  78. afx_msg void OnComboBoxEnd(WPARAM ,LPARAM lParam = FALSE);
  79. #else
  80. afx_msg LRESULT OnComboBoxEnd(WPARAM ,LPARAM lParam = FALSE);
  81. #endif
  82. DECLARE_MESSAGE_MAP()
  83. private:
  84. void ShowComboBox(BOOL bShow,int nItem,int nIndex,CRect rc = CRect(0,0,0,0));
  85. CListCtrlComboBox m_ComboBox;
  86. int m_nItem;
  87. int m_nSub;
  88. BOOL Key_Shift(int& nItem,int& nSub);
  89. BOOL Key_Ctrl(int& nItem,int &nSub);
  90. };
  91. //////////////////////////////////////////////////////////////////////////
  92. //////////////////////////////////////////////////////////////////////////
  93. //////////////////////////////////////////////////////////////////////////
  94. //////////////////////////////////////////////////////////////////////////
  95. /////////////////////////////////////////////////////////////////////////////
  96. //{{AFX_INSERT_LOCATION}}
  97. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  98. #endif // !defined(AFX_ComboBoxLISTCTRL_H__B26FE6EC_7377_4DA6_BEC1_E3C656DACFB8__INCLUDED_)