PropertyGridCombo.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #pragma once
  2. #include <vector>
  3. #include <string>
  4. using namespace std;
  5. // CPropertyGridCombo frame
  6. #define WM_PG_COMBOSELCHANGED WM_USER+487
  7. class CPropertyGridCombo : public CWnd
  8. {
  9. DECLARE_DYNCREATE(CPropertyGridCombo)
  10. public:
  11. CPropertyGridCombo();
  12. virtual ~CPropertyGridCombo();
  13. BOOL Create(DWORD dwStyle, CRect& rc, CWnd* pParent, int nId);
  14. void SetFont(CFont* pFont, BOOL bRedraw = TRUE);
  15. void SetColors(COLORREF clrBack, COLORREF clrText, COLORREF clrFocus, COLORREF clrHilite);
  16. void AddString(string strItem);
  17. void SetCurSel(int nItem);
  18. protected:
  19. vector<string> m_Items;
  20. int m_nSelected;
  21. CFont* m_pFont;
  22. int m_line_height;
  23. bool m_bTracking;
  24. COLORREF m_clrBack;
  25. COLORREF m_clrText;
  26. COLORREF m_clrFocus;
  27. COLORREF m_clrHilite;
  28. protected:
  29. DECLARE_MESSAGE_MAP()
  30. public:
  31. afx_msg void OnPaint();
  32. afx_msg void OnShowWindow(BOOL bShow, UINT nStatus);
  33. afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  34. afx_msg void OnMouseMove(UINT nFlags, CPoint point);
  35. afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
  36. afx_msg void OnDestroy();
  37. afx_msg void OnKillFocus(CWnd* pNewWnd);
  38. afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
  39. afx_msg UINT OnGetDlgCode();
  40. };