51 COLORREF m_focusMarkColor;
53 bool m_boIsUnderlineHoverOnly;
55 CFont* m_SetFont(CDC* pDC, CFont& f,
bool withUnderline)
58 _super::GetFont()->GetLogFont(&logFont);
59 logFont.lfUnderline = withUnderline;
60 f.CreateFontIndirect(&logFont);
61 return pDC->SelectObject(&f);
78 bool withUnderline =
false;
81 switch ( _super::GetButtonState() )
101 if ( ! m_boIsUnderlineHoverOnly )
103 withUnderline =
true;
106 CFont* pOldFont = m_SetFont(pDC, font, withUnderline);
108 _super::GetClientRect(&rect);
110 pDC->SetBkMode(TRANSPARENT);
116 pDC->SelectObject(pOldFont);
138 virtual LRESULT
WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
140 if ( message == WM_ERASEBKGND ) {
return 0; }
141 LRESULT r = _super::WindowProc(message, wParam, lParam);
142 if ( message == WM_SETFOCUS || message == WM_KILLFOCUS || message == WM_ACTIVATE )
152 CLinkText(
void) : m_boIsVisit(false), m_focusMarkColor(RGB(0, 0, 0)), m_boIsUnderlineHoverOnly(false)
169 _super::operator=(other);
170 _text::operator=(other);
171 m_hoverColors = other.m_hoverColors;
172 m_visitColors = other.m_visitColors;
173 m_focusMarkColor = other.m_focusMarkColor;
174 m_boIsUnderlineHoverOnly = other.m_boIsUnderlineHoverOnly;
196 m_boIsUnderlineHoverOnly = r;
206 m_hoverColors.
forward = color1;
207 m_hoverColors.
back = color2;
217 m_visitColors.
forward = color1;
218 m_visitColors.
back = color2;
227 m_focusMarkColor = color;
244 if ( str.IsEmpty() ) {
return; }
248 CFont* pOldFont = m_SetFont(pDC, font,
true);
250 pDC->SelectObject(pOldFont);
298 _super::SpecialCursor(::LoadCursor(NULL, IDC_WAIT));
299 SHELLEXECUTEINFO sei;
300 ::ZeroMemory(&sei,
sizeof(SHELLEXECUTEINFO));
301 sei.cbSize =
sizeof(SHELLEXECUTEINFO);
302 sei.lpVerb = m_action;
303 sei.lpFile = m_target;
304 sei.nShow = SW_SHOWNORMAL;
305 ::ShellExecuteEx(&sei);
306 _super::SetVisitFlag();
307 _super::ResetCursor();
315 _super::SetTextColor(RGB(0, 0, 255));
316 _super::SetTextHoverColor(RGB(255, 128, 0));
317 _super::SetTextVisitColor(RGB(200, 0, 0));
326 m_target = lpszTarget;
337 m_action = lpszAction;
static DWORD StaticToDrawStyle(DWORD staticStyle)
[変換] StaticスタイルをDrawTextスタイルに変換
virtual void DrawText(CDC *pDC, const RECT &rect, UINT drawStyle, const TColor &c, LPCTSTR str)
[表示] 文字表示.
TColor m_normalColors
標準状態色
void SetAction(LPCTSTR lpszAction)
[設定] アクション設定.
CHyperLinkText(void)
コンストラクタ
void SetTarget(LPCTSTR lpszTarget)
[設定] ターゲット設定.
virtual void OnClickButton(void)
[通知] クリック.
void SetShortcutKey(TCHAR key)
[設定] ショートカットキー設定.
void SetUnderlineMode(bool r)
[設定] アンダーバー設定.
virtual void OnChangeState(EState state)
[通知] 状態変化通知.
void SetVisitFlag(bool r=true)
[設定] 訪問済みフラグ設定.
void SetFocusMarkColor(COLORREF color)
[設定] フォーカスマーク色指定.
CLinkText & operator=(const CLinkText &other)
[複製] 情報複製.
virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
[通知] for processing Windows messages.
virtual void OnDrawButton(CDC *pDC)
[通知] 描画
virtual ~CLinkText(void)
デストラクタ
void SetTextVisitColor(COLORREF color1, COLORREF color2=CLR_INVALID)
[設定] 訪問済み状態テキスト色指定.
void AdjustSize(int margin=2)
[設定] サイズ調整.
void SetTextHoverColor(COLORREF color1, COLORREF color2=CLR_INVALID)
[設定] ホバー状態テキスト色指定.
void DrawDottedBox(CDC *pDC, const RECT &rect, COLORREF color)
[表示] 破線箱表示.
void AdjustClientSize(CWnd *pWnd, CDC *pDC, UINT drawStyle, LPCTSTR lpsz, int margin=2)
[設定] クライアントサイズ調整.
void DrawParent(CWnd *pWndControl, bool boIsRedraw=true)
[表示] 親表示.