ComboListCtrl.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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. // Construction
  50. public:
  51. CComboBoxListCtrl();
  52. // Attributes
  53. public:
  54. CArray<CStringArray, CStringArray>*m_sparray;
  55. // Operations
  56. public:
  57. // Overrides
  58. // ClassWizard generated virtual function overrides
  59. //{{AFX_VIRTUAL(CComboBoxListCtrl)
  60. public:
  61. virtual BOOL PreTranslateMessage(MSG* pMsg);
  62. //}}AFX_VIRTUAL
  63. // Implementation
  64. public:
  65. void InitStyle();
  66. virtual ~CComboBoxListCtrl();
  67. // Generated message map functions
  68. protected:
  69. //{{AFX_MSG(CComboBoxListCtrl)
  70. afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
  71. afx_msg void OnParentNotify(UINT message, LPARAM lParam);
  72. //}}AFX_MSG
  73. afx_msg void OnComboBoxEnd(WPARAM ,LPARAM lParam = FALSE);
  74. DECLARE_MESSAGE_MAP()
  75. private:
  76. void ShowComboBox(BOOL bShow,int nItem,int nIndex,CRect rc = CRect(0,0,0,0));
  77. CListCtrlComboBox m_ComboBox;
  78. int m_nItem;
  79. int m_nSub;
  80. BOOL Key_Shift(int& nItem,int& nSub);
  81. BOOL Key_Ctrl(int& nItem,int &nSub);
  82. };
  83. //////////////////////////////////////////////////////////////////////////
  84. //////////////////////////////////////////////////////////////////////////
  85. //////////////////////////////////////////////////////////////////////////
  86. //////////////////////////////////////////////////////////////////////////
  87. /////////////////////////////////////////////////////////////////////////////
  88. //{{AFX_INSERT_LOCATION}}
  89. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  90. #endif // !defined(AFX_ComboBoxLISTCTRL_H__B26FE6EC_7377_4DA6_BEC1_E3C656DACFB8__INCLUDED_)