MyButton.h 940 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #pragma once
  2. #include "afxwin.h"
  3. #include <vector>
  4. using namespace std;
  5. class CButtonGroup;
  6. class CMyButton :
  7. public CButton
  8. {
  9. DECLARE_DYNAMIC(CMyButton);
  10. public:
  11. CMyButton();
  12. public:
  13. ~CMyButton();
  14. public:
  15. CButtonGroup* pParent;
  16. UINT index;
  17. CString name;
  18. UINT type;
  19. UINT btnState;
  20. UINT colorState;
  21. UINT lastColorState;
  22. UINT chooseState;
  23. CString strInfo;
  24. protected:
  25. afx_msg BOOL OnClicked();
  26. afx_msg void OnMouseMove(UINT nFlags, CPoint point);
  27. afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  28. afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
  29. afx_msg void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
  30. afx_msg void OnPaint();
  31. LRESULT OnMouseLeave(WPARAM wParam, LPARAM lParam);
  32. public:
  33. void drawButton();
  34. void drawlines(CDC* pDC, CString str, CRect rc, UINT charNumOfLine, UINT linenum, UINT rowHeight);
  35. int getDividePos(CString str, int num);
  36. void changeColor(bool change);
  37. DECLARE_MESSAGE_MAP()
  38. };