SkinStatic.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /************************************************************************/
  2. /* Copyright (C), 2016-2020, [IT], 保留所有权利;
  3. /* 模 块 名:;
  4. /* 描 述:;
  5. /*
  6. /* 版 本:[V];
  7. /* 作 者:[IT];
  8. /* 日 期:[8/19/2016];
  9. /*
  10. /*
  11. /* 注 意:;
  12. /*
  13. /* 修改记录:[IT];
  14. /* 修改日期:;
  15. /* 修改版本:;
  16. /* 修改内容:;
  17. /************************************************************************/
  18. #ifndef __SKIN_STATIC_20160824__
  19. #define __SKIN_STATIC_20160824__
  20. #include "EnBitmap.h" // Added by ClassView
  21. #pragma once
  22. class CSkinStatic : public CStatic
  23. {
  24. public:
  25. CSkinStatic();
  26. virtual ~CSkinStatic();
  27. protected:
  28. virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
  29. public:
  30. void SetText(CString strText,int nStart = 0,COLORREF cr = RGB(0,0,0));
  31. void SetExtendPoint(int nX,int nY)
  32. {
  33. m_nX=nX;
  34. m_nY=nY;
  35. }
  36. void SetFont(CFont *pFont){m_pFont = pFont;}
  37. BOOL DrawText(CDC *pDC,CRect rc ,CString strText);
  38. void Redraw(CDC *pDC);
  39. void LoadBitmap(LPCTSTR szImagePath);
  40. int Width()
  41. {
  42. return m_bmpStatic.GetWidth();
  43. }
  44. int Height()
  45. {
  46. return m_bmpStatic.GetHeight();
  47. }
  48. CRect GetRectInParent();
  49. CEnBitmap m_bmpStatic;
  50. CString m_strText;
  51. CFont *m_pFont;
  52. int m_nTextStart;
  53. COLORREF m_crText;
  54. protected:
  55. int m_nX;
  56. int m_nY;
  57. afx_msg void OnPaint();
  58. DECLARE_MESSAGE_MAP()
  59. };
  60. #endif // __SKIN_STATIC_20160824__