SkinEdit.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. #pragma once
  19. // CSkinEdit
  20. #include "EnBitmap.h"
  21. class CSkinEdit : public CEdit
  22. {
  23. DECLARE_DYNAMIC(CSkinEdit)
  24. public:
  25. CSkinEdit();
  26. virtual ~CSkinEdit();
  27. CEnBitmap m_bmpEdit;
  28. CString m_strText,m_strSearchTip;
  29. int m_nTextStart;
  30. COLORREF m_crText;
  31. void SetText(CString strText,int nStart,COLORREF cr);
  32. void SetExtendPoint(int nX,int nY){m_nX=nX;m_nY=nY;}
  33. BOOL DrawText(CDC *pDC,CRect rc ,CString strText);
  34. void LoadBitmap(LPCTSTR szImagePath);
  35. int Width(){return m_bmpEdit.GetWidth();}
  36. int Height(){return m_bmpEdit.GetHeight();}
  37. CRect GetRectInParent();
  38. protected:
  39. int m_nX,m_nY;
  40. DECLARE_MESSAGE_MAP()
  41. public:
  42. afx_msg void OnPaint();
  43. afx_msg void OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS* lpncsp);
  44. afx_msg void OnNcLButtonDown(UINT nHitTest, CPoint point);
  45. afx_msg void OnMouseMove(UINT nFlags, CPoint point);
  46. afx_msg void OnSetFocus(CWnd* pOldWnd);
  47. afx_msg void OnKillFocus(CWnd* pNewWnd);
  48. afx_msg LRESULT OnNcHitTest(CPoint point);
  49. virtual BOOL PreTranslateMessage(MSG* pMsg);
  50. };