1 // TortoiseGit - a Windows shell extension for easy version control
3 // Copyright (C) 2003-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.
22 #include "HintListCtrl.h"
24 CHintListCtrl::CHintListCtrl() : CListCtrl()
28 CHintListCtrl::~CHintListCtrl()
32 void CHintListCtrl::ShowText(const CString
& sText
, bool forceupdate
/* = false*/)
40 void CHintListCtrl::ClearText()
46 IMPLEMENT_DYNAMIC(CHintListCtrl
, CListCtrl
)
48 BEGIN_MESSAGE_MAP(CHintListCtrl
, CListCtrl
)
52 void CHintListCtrl::OnPaint()
55 if (!m_sText
.IsEmpty())
57 COLORREF clrText
= ::GetSysColor(COLOR_WINDOWTEXT
);
59 if (IsWindowEnabled())
60 clrTextBk
= ::GetSysColor(COLOR_WINDOW
);
62 clrTextBk
= ::GetSysColor(COLOR_3DFACE
);
67 pHC
= GetHeaderCtrl();
72 pHC
->GetItemRect(0, &rcH
);
77 CMyMemDC
memDC(pDC
, &rc
);
79 memDC
.SetTextColor(clrText
);
80 memDC
.SetBkColor(clrTextBk
);
81 memDC
.FillSolidRect(rc
, clrTextBk
);
83 CGdiObject
* oldfont
= memDC
.SelectStockObject(DEFAULT_GUI_FONT
);
84 memDC
.DrawText(m_sText
, rc
, DT_CENTER
| DT_VCENTER
|
85 DT_WORDBREAK
| DT_NOPREFIX
| DT_NOCLIP
);
86 memDC
.SelectObject(oldfont
);