StatLink.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. ////////////////////////////////////////////////////////////////
  2. // PixieLib(TM) Copyright 1997-2000 Paul DiLascia
  3. // If this code works, it was written by Paul DiLascia.
  4. // If not, I don't know who wrote it.
  5. //
  6. #ifndef _STATLINK_H
  7. #define _STATLINK_H
  8. #include "HyprLink.h"
  9. //////////////////
  10. // CStaticLink implements a static control that's a hyperlink
  11. // to any file on your desktop or web. You can use it in dialog boxes
  12. // to create hyperlinks to web sites. When clicked, opens the file/URL
  13. //
  14. class CStaticLink : public CStatic {
  15. public:
  16. DECLARE_DYNAMIC(CStaticLink)
  17. CStaticLink(LPCTSTR lpText = NULL, BOOL bDeleteOnDestroy=FALSE);
  18. ~CStaticLink() { }
  19. // Hyperlink contains URL/filename. If NULL, I will use the window text.
  20. // (GetWindowText) to get the target.
  21. CHyperlink m_link;
  22. COLORREF m_color;
  23. // Default colors you can change
  24. // These are global, so they're the same for all links.
  25. static COLORREF g_colorUnvisited;
  26. static COLORREF g_colorVisited;
  27. // Cursor used when mouse is on a link--you can set, or
  28. // it will default to the standard hand with pointing finger.
  29. // This is global, so it's the same for all links.
  30. static HCURSOR g_hCursorLink;
  31. protected:
  32. CFont m_font; // underline font for text control
  33. BOOL m_bDeleteOnDestroy; // delete object when window destroyed?
  34. virtual void PostNcDestroy();
  35. // message handlers
  36. DECLARE_MESSAGE_MAP()
  37. afx_msg LRESULT OnNcHitTest(CPoint point);
  38. afx_msg HBRUSH CtlColor(CDC* pDC, UINT nCtlColor);
  39. afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  40. afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
  41. };
  42. #endif _STATLINK_H