SkinEdit.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /************************************************************************
  2. * 程序名: 精仿QQ主界面
  3. * 制作人: 李克平, 2011年04月11日
  4. * 版本号: 1.0
  5. ************************************************************************/
  6. #pragma once
  7. // CSkinEdit
  8. #include "EnBitmap.h"
  9. class CSkinEdit : public CEdit
  10. {
  11. DECLARE_DYNAMIC(CSkinEdit)
  12. public:
  13. CSkinEdit();
  14. virtual ~CSkinEdit();
  15. CEnBitmap m_bmpEdit;
  16. CString m_strText,m_strSearchTip;
  17. int m_nTextStart;
  18. COLORREF m_crText;
  19. void SetText(CString strText,int nStart,COLORREF cr);
  20. void SetExtendPoint(int nX,int nY){m_nX=nX;m_nY=nY;}
  21. BOOL DrawText(CDC *pDC,CRect rc ,CString strText);
  22. void LoadBitmap(LPCTSTR szImagePath);
  23. int Width(){return m_bmpEdit.GetWidth();}
  24. int Height(){return m_bmpEdit.GetHeight();}
  25. CRect GetRectInParent();
  26. protected:
  27. int m_nX,m_nY;
  28. DECLARE_MESSAGE_MAP()
  29. public:
  30. afx_msg void OnPaint();
  31. afx_msg void OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS* lpncsp);
  32. afx_msg void OnNcLButtonDown(UINT nHitTest, CPoint point);
  33. afx_msg void OnMouseMove(UINT nFlags, CPoint point);
  34. afx_msg void OnSetFocus(CWnd* pOldWnd);
  35. afx_msg void OnKillFocus(CWnd* pNewWnd);
  36. afx_msg LRESULT OnNcHitTest(CPoint point);
  37. virtual BOOL PreTranslateMessage(MSG* pMsg);
  38. };