ComboGridCtrl.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // ComboGridCtrl.h: interface for the CComboGridCtrl class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. #if !defined(AFX_COMBOGRIDCTRL_H__EC89C9C0_01A5_11D2_AB4A_5C7377000000__INCLUDED_)
  5. #define AFX_COMBOGRIDCTRL_H__EC89C9C0_01A5_11D2_AB4A_5C7377000000__INCLUDED_
  6. #if _MSC_VER >= 1000
  7. #pragma once
  8. #endif // _MSC_VER >= 1000
  9. #include "GridCtrl.h"
  10. #include "afxtempl.h"
  11. typedef struct _combocol{
  12. int iCol;
  13. CStringArray *comStr;
  14. }COMBOCOL;
  15. class CComboGridCtrl : public CGridCtrl
  16. {
  17. public:
  18. void SetComboBoxStyle(DWORD dwStyle);
  19. BOOL SetComboItemText(int nRow,int nCol,int index);
  20. virtual BOOL SetItem(GV_ITEM *pItem);
  21. virtual BOOL SetItemText(int nRow, int nCol, LPCTSTR str);
  22. BOOL AddComboColumn(int iCol,CStringArray &comStr);
  23. CComboGridCtrl();
  24. virtual ~CComboGridCtrl();
  25. protected:
  26. virtual void CreateInPlaceEditControl(CRect& rect, DWORD dwStyle, UINT nID,
  27. int nRow, int nCol, LPCTSTR szText, int nChar);
  28. //{{AFX_MSG(CComboGridCtrl)
  29. //}}AFX_MSG
  30. DECLARE_MESSAGE_MAP()
  31. private:
  32. int IsColumnCombo(int nCol);
  33. CArray<COMBOCOL,COMBOCOL&> m_comStrArray;
  34. DWORD m_comboBoxStyle;
  35. };
  36. #endif // !defined(AFX_COMBOGRIDCTRL_H__EC89C9C0_01A5_11D2_AB4A_5C7377000000__INCLUDED_)