WTL Controls
Back to the WTL Controls Home Page.
HyperlinkImage.h
Go to the documentation of this file.
1 #pragma once
2 #include "stdafx.h"
3 //--------------------------------------------------------------------------------------
4 //--------------------------------------------------------------------------------------
5 //
6 //
7 // WTL Control Library
8 // by
9 // Bright Ideas Software®
10 // Copyright © 2018 by Bright Ideas Software.
11 //
12 //
13 //
14 //--------------------------------------------------------------------------------------
15 //--------------------------------------------------------------------------------------
16 
17 namespace BIS_WTL_CONTROLS
18 {
19 
20  //----------------------------------------------------------------------------------------------
61  class CHyperlinkImage : public CWindowImpl<CHyperlinkImage, CStatic>
62  {
63 
64  public:
65 
66  CHyperlinkImage() noexcept;
67  virtual ~CHyperlinkImage();
68 
69  void SubclassStatic(HWND hWnd);
70  void UnSubclassStatic();
71 
72  void SetURL(std::basic_string<TCHAR> url);
73  std::basic_string<TCHAR> GetURL() const;
74 
75  void SetMenuText(std::basic_string<TCHAR> text);
76  std::basic_string<TCHAR> GetMenuText() const;
77 
78 
79  private:
80 
81  CString m_strURL;
82  CString m_strMenuText;
83 
84  void OnContextMenu(CWindow wnd, CPoint point);
85  void OnRButtonDown(UINT nFlags, CPoint point);
86  LRESULT OnLink(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& bHandled);
87 
88  BEGIN_MSG_MAP_EX(CHyperlinkImage)
89  MSG_WM_CONTEXTMENU(OnContextMenu)
90  MSG_WM_RBUTTONDOWN(OnRButtonDown)
91  COMMAND_ID_HANDLER(IDM_HYPERLINKIMAGE_LINK, OnLink)
92  DEFAULT_REFLECTION_HANDLER()
93 END_MSG_MAP()
94 
95  };
96  //----------------------------------------------------------------------------------------------
97 };
#define IDM_HYPERLINKIMAGE_LINK