Fixed issue #1741: Push / Pull Dialog URL combo box should not be filled unless enabled
[TortoiseGit.git] / src / Utils / MiscUI / HyperLink.h
blobcddcafaaf8006172a76ab3b128934283d1e46e0e
1 // TortoiseGit - a Windows shell extension for easy version control
3 // Copyright (C) 2003-2007,2008 - TortoiseSVN
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software Foundation,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 #pragma once
21 /**
22 * \ingroup Utils
23 * Hyperlink control
25 class CHyperLink : public CStatic
27 public:
28 CHyperLink();
29 virtual ~CHyperLink();
31 public:
32 enum UnderLineOptions
34 ulHover = -1,
35 ulNone = 0,
36 ulAlways = 1
39 public:
40 void SetURL(CString strURL);
41 CString GetURL() const;
43 void SetColors(COLORREF crLinkColor, COLORREF crHoverColor = -1);
44 COLORREF GetLinkColor() const;
45 COLORREF GetHoverColor() const;
47 void SetUnderline(int nUnderline = ulHover);
48 int GetUnderline() const;
50 public:
51 virtual BOOL PreTranslateMessage(MSG* pMsg);
52 virtual BOOL DestroyWindow();
53 protected:
54 virtual void PreSubclassWindow();
56 protected:
57 HINSTANCE GotoURL(LPCTSTR url);
58 void SetDefaultCursor();
60 protected:
61 COLORREF m_crLinkColor; ///< Hyperlink color
62 COLORREF m_crHoverColor; ///< Hover color
63 BOOL m_bOverControl; ///< cursor over control?
64 int m_nUnderline; ///< underline hyperlink?
65 CString m_strURL; ///< hyperlink URL
66 CFont m_UnderlineFont; ///< Font for underline display
67 CFont m_StdFont; ///< Standard font
68 HCURSOR m_hLinkCursor; ///< Cursor for hyperlink
69 CToolTipCtrl m_ToolTip; ///< The tooltip
70 UINT m_nTimerID;
72 protected:
73 afx_msg HBRUSH CtlColor(CDC* pDC, UINT nCtlColor);
74 afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
75 afx_msg void OnMouseMove(UINT nFlags, CPoint point);
76 afx_msg void OnTimer(UINT_PTR nIDEvent);
77 afx_msg BOOL OnEraseBkgnd(CDC* pDC);
78 afx_msg void OnClicked();
79 DECLARE_MESSAGE_MAP()