X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=Utils%2FMiscUI%2FTooltip.h;fp=Utils%2FMiscUI%2FTooltip.h;h=641efc4d5396d4c04ed4caa472190e0126b8e42f;hb=d41e118db5f30c18504f18023f30c09d6b027c0d;hp=0000000000000000000000000000000000000000;hpb=60636b398fcb505853d4dfab1b81b1a9630f8332;p=tortoisegit%2FTortoiseGitJp.git diff --git a/Utils/MiscUI/Tooltip.h b/Utils/MiscUI/Tooltip.h new file mode 100644 index 0000000..641efc4 --- /dev/null +++ b/Utils/MiscUI/Tooltip.h @@ -0,0 +1,74 @@ +// TortoiseSVN - a Windows shell extension for easy version control + +// Copyright (C) 2008 - TortoiseSVN + +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software Foundation, +// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +// +#pragma once + + + + +/** + * \ingroup Utils + * Extends the MFC CToolTipCtrl with convenience methods for dialogs and + * provides mechanism to use tooltips longer than 80 chars whithout having + * to implement the TTN_NEEDTEXT handler in every dialog. + */ +class CToolTips : public CToolTipCtrl +{ +// Construction +public: + virtual BOOL Create(CWnd* pParentWnd, DWORD dwStyle = 0) + { + m_pParentWnd = pParentWnd; + m_pParentWnd->EnableToolTips(); + BOOL bRet = CToolTipCtrl::Create(pParentWnd, dwStyle); + SetMaxTipWidth(600); + return bRet; + } + CToolTips() : CToolTipCtrl(), m_pParentWnd(NULL) {} + virtual ~CToolTips() {} + + BOOL AddTool(CWnd* pWnd, UINT nIDText, LPCRECT lpRectTool = NULL, UINT_PTR nIDTool = 0); + BOOL AddTool(CWnd* pWnd, LPCTSTR lpszText = LPSTR_TEXTCALLBACK, LPCRECT lpRectTool = NULL, UINT_PTR nIDTool = 0); + void AddTool(int nIdWnd, UINT nIdText, LPCRECT lpRectTool = NULL, UINT_PTR nIDTool = 0); + void AddTool(int nIdWnd, CString sBalloonTipText, LPCRECT lpRectTool = NULL, UINT_PTR nIDTool = 0); + + DECLARE_MESSAGE_MAP() + afx_msg BOOL OnTtnNeedText(NMHDR *pNMHDR, LRESULT *pResult); + +private: + CWnd * m_pParentWnd; + std::map toolTextMap; +}; + + + + + + + + + + + + + + + + + +