ComboListCtrl2.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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
  36. DECLARE_MESSAGE_MAP()
  37. private:
  38. DWORD m_dwData;
  39. BOOL m_bExchange;
  40. };
  41. /////////////////////////////////////////////////////////////////////////////
  42. //////////////////////////////////////////////////////////////////////////
  43. //////////////////////////////////////////////////////////////////////////
  44. //////////////////////////////////////////////////////////////////////////
  45. //////////////////////////////////////////////////////////////////////////
  46. //////////////////////////////////////////////////////////////////////////
  47. class CComboBoxListCtrl2 : public CListCtrl
  48. {
  49. // Construction
  50. public:
  51. CComboBoxListCtrl2();
  52. // Attributes
  53. public:
  54. // Operations
  55. public:
  56. // Overrides
  57. // ClassWizard generated virtual function overrides
  58. //{{AFX_VIRTUAL(CComboBoxListCtrl2)
  59. public:
  60. virtual BOOL PreTranslateMessage(MSG* pMsg);
  61. //}}AFX_VIRTUAL
  62. // Implementation
  63. public:
  64. void InitStyle();
  65. virtual ~CComboBoxListCtrl2();
  66. // Generated message map functions
  67. protected:
  68. //{{AFX_MSG(CComboBoxListCtrl2)
  69. afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
  70. afx_msg void OnParentNotify(UINT message, LPARAM lParam);
  71. //}}AFX_MSG
  72. afx_msg void OnComboBoxEnd(WPARAM ,LPARAM lParam = FALSE);
  73. afx_msg void OnEditEnd(WPARAM ,LPARAM lParam = FALSE);
  74. DECLARE_MESSAGE_MAP()
  75. private:
  76. void ShowEdit(BOOL bShow,int nItem,int nIndex,CRect rc = CRect(0,0,0,0));
  77. void ShowComboBox(BOOL bShow,int nItem,int nIndex,CRect rc = CRect(0,0,0,0));
  78. CListCtrlComboBox2 m_ComboBox;
  79. CListCtrlEdit m_edit;
  80. int m_nItem;
  81. int m_nSub;
  82. BOOL Key_Shift(int& nItem,int& nSub);
  83. BOOL Key_Ctrl(int& nItem,int &nSub);
  84. };
  85. //////////////////////////////////////////////////////////////////////////
  86. //////////////////////////////////////////////////////////////////////////
  87. //////////////////////////////////////////////////////////////////////////
  88. //////////////////////////////////////////////////////////////////////////
  89. /////////////////////////////////////////////////////////////////////////////
  90. //{{AFX_INSERT_LOCATION}}
  91. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  92. #endif // !defined(AFX_ComboBoxLISTCTRL2_H__B26FE6EC_7377_4DA6_BEC1_E3C656DACFB8__INCLUDED_)