Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

80 lines
1.7 KiB

  1. // HotLink.h : header file
  2. //
  3. #ifndef _HOTLINK_H
  4. #define _HOTLINK_H
  5. #if _MSC_VER > 1000
  6. #pragma once
  7. #endif // _MSC_VER > 1000
  8. /////////////////////////////////////////////////////////////////////////////
  9. // CHotLink window
  10. class CHotLink : public CButton
  11. {
  12. // Construction
  13. public:
  14. CHotLink();
  15. // Attributes
  16. public:
  17. BOOL m_fBrowse;
  18. BOOL m_fExplore;
  19. BOOL m_fOpen;
  20. // Operations
  21. public:
  22. void Browse();
  23. void Explore();
  24. void Open();
  25. virtual void DrawItem( LPDRAWITEMSTRUCT lpDrawItemStruct );
  26. // set the title string
  27. void SetTitle( CString sz );
  28. void SetLink(const CString& sz)
  29. {
  30. m_strLink = sz;
  31. }
  32. void SetLink(UINT id)
  33. {
  34. VERIFY(m_strLink.LoadString(id));
  35. }
  36. // Overrides
  37. // ClassWizard generated virtual function overrides
  38. //{{AFX_VIRTUAL(CHotLink)
  39. //}}AFX_VIRTUAL
  40. // Implementation
  41. public:
  42. virtual ~CHotLink();
  43. // Generated message map functions
  44. protected:
  45. //{{AFX_MSG(CHotLink)
  46. afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  47. afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
  48. afx_msg void OnMouseMove(UINT nFlags, CPoint point);
  49. afx_msg void OnCaptureChanged(CWnd *pWnd);
  50. //}}AFX_MSG
  51. DECLARE_MESSAGE_MAP()
  52. // height and width of the displayed text
  53. void GetTextRect( CRect &rect );
  54. CSize m_cpTextExtents;
  55. CRect m_rcText;
  56. COLORREF m_clrText;
  57. // URL for link could be not the same as caption
  58. CString m_strLink;
  59. // tracking the mouse flag
  60. BOOL m_CapturedMouse;
  61. // init the font
  62. BOOL m_fInitializedFont;
  63. };
  64. /////////////////////////////////////////////////////////////////////////////
  65. #endif // _HOTLINK_H