Updated libgit to version 2.46.2 based on Git for Windows sources
[TortoiseGit.git] / src / Utils / MiscUI / LinkControl.h
blobba8505501b4de47df1f4bd24bcc6bf29daf57b7c
1 // TortoiseGit - a Windows shell extension for easy version control
3 // Copyright (C) 2023 - TortoiseGit
4 // Copyright (C) 2009, 2012, 2015-2016 - TortoiseSVN
6 // This program is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU General Public License
8 // as published by the Free Software Foundation; either version 2
9 // of the License, or (at your option) any later version.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software Foundation,
18 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 #pragma once
21 #include <Windows.h>
23 class CLinkControl : public CStatic
25 public:
26 CLinkControl();
27 virtual ~CLinkControl();
29 static const UINT LK_LINKITEMCLICKED;
31 protected:
32 void PreSubclassWindow() override;
33 BOOL OnWndMsg(UINT message, WPARAM wParam, LPARAM lParam, LRESULT* pResult) override;
35 private:
36 HCURSOR m_hLinkCursor = nullptr; // Cursor for hyperlink
37 CFont m_UnderlineFont; // Font for underline display
38 CFont m_NormalFont; // Font for default display
39 bool m_bOverControl = false; // cursor over control?
41 void DrawFocusRect();
42 void ClearFocusRect();
43 void NotifyParent(UINT msg);
45 protected:
46 afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
47 afx_msg void OnMouseMove(UINT nFlags, CPoint point);
48 afx_msg void OnCaptureChanged(CWnd *pWnd);
49 afx_msg void OnSetFocus(CWnd* pOldWnd);
50 afx_msg void OnKillFocus(CWnd* pNewWnd);
51 afx_msg UINT OnGetDlgCode();
52 afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
53 afx_msg void OnClicked();
54 afx_msg void OnEnable(BOOL enabled);
56 DECLARE_MESSAGE_MAP()