LabelEx.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. #if !defined(AFX_LABELEX_H__C9BE230C_B8E9_48DE_8022_F3D4F5260B65__INCLUDED_)
  2. #define AFX_LABELEX_H__C9BE230C_B8E9_48DE_8022_F3D4F5260B65__INCLUDED_
  3. #if _MSC_VER > 1000
  4. #pragma once
  5. #endif // _MSC_VER > 1000
  6. // LabelEx.h : header file
  7. //
  8. /////////////////////////////////////////////////////////////////////////////
  9. // CLabelEx window
  10. class CLabelEx : public CStatic
  11. {
  12. CFont m_newfont;
  13. // Construction
  14. public:
  15. CLabelEx();
  16. // Attributes
  17. public:
  18. // Operations
  19. public:
  20. // Overrides
  21. // ClassWizard generated virtual function overrides
  22. //{{AFX_VIRTUAL(CLabelEx)
  23. protected:
  24. virtual void PreSubclassWindow();
  25. //}}AFX_VIRTUAL
  26. // Implementation
  27. public:
  28. void Paint();
  29. int DrawText(CDC *pDC, char *str, CRect& m_rt, int iFont, int iFace, int format);
  30. int GetStrSize(CDC *pDC, char *str, CSize &size);
  31. void AutoDraw(CDC *pDC, CRect &StrRect, CString &str, float fscale);
  32. void AutoDraw2(CDC *pDC, CRect &StrRect, CString &str, float fscale);
  33. int SetFontFace(CDC *pDC, int iFont, BOOL bWeight, CString name);
  34. void EnableHighLight(BOOL bHighLight);
  35. void SetClickedLabelBitmap(UINT ID);
  36. void SetMouseOverLabelBitmap(UINT ID);
  37. void SetClickedBGBitmap(UINT ID);
  38. void SetLabelBitmap(UINT ID);
  39. void SetMouseOverBGBitmap(UINT ID);
  40. void SetBGBitmap(UINT ID);
  41. void RedrawWindow();
  42. void EnableAutoUnderLine(BOOL bAutoUnderLine);
  43. void SetBkColor(COLORREF crBkColor);
  44. void SetBorder(BOOL bBorder,COLORREF crBorder);
  45. void SetUnderLine(BOOL bUnderLine,COLORREF crUnderLine);
  46. void SetTextColor(COLORREF crText);
  47. virtual ~CLabelEx();
  48. // Generated message map functions
  49. protected:
  50. HCURSOR m_hHandCur;
  51. CFont m_Font;
  52. BOOL m_bBorder;
  53. BOOL m_bClicked;
  54. BOOL m_bOver;
  55. BOOL m_bUnderLine,m_bBackUnderLine;
  56. BOOL m_bAutoUnderLine;
  57. BOOL m_bHighLight;
  58. CBitmap m_BGBm,m_MouseOverBGBm,m_ClickedBGBm;
  59. CBitmap m_LabelBm,m_MouseOverLabelBm,m_ClickedLabelBm;
  60. COLORREF m_crText,m_crBorder,m_crBG,m_crUnderLine;
  61. COLORREF m_crBackText;
  62. //{{AFX_MSG(CLabelEx)
  63. afx_msg void OnPaint();
  64. afx_msg void OnMouseMove(UINT nFlags, CPoint point);
  65. afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  66. //}}AFX_MSG
  67. DECLARE_MESSAGE_MAP()
  68. };
  69. /////////////////////////////////////////////////////////////////////////////
  70. //{{AFX_INSERT_LOCATION}}
  71. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  72. #endif // !defined(AFX_LABELEX_H__C9BE230C_B8E9_48DE_8022_F3D4F5260B65__INCLUDED_)