summaryrefslogtreecommitdiff
path: root/win/Piecebar.cpp
diff options
context:
space:
mode:
authorleo2006-03-09 06:46:25 +0000
committerleo2006-03-09 06:46:25 +0000
commite600f8d4fb7a442a4771441df98f0914383b207e (patch)
treee7d6b669b7b6fff018522414cd2b5210705749aa /win/Piecebar.cpp
parentf4f0bb92cf431eb48f2ccc294b796bc05a2ffba7 (diff)
Show piece number on the tree tooltip.
git-svn-id: http://svn.leocad.org/trunk@518 c7d43263-9d01-0410-8a33-9dba5d9f93d6
Diffstat (limited to 'win/Piecebar.cpp')
-rw-r--r--win/Piecebar.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/win/Piecebar.cpp b/win/Piecebar.cpp
index bd1734a..b72b5c5 100644
--- a/win/Piecebar.cpp
+++ b/win/Piecebar.cpp
@@ -684,7 +684,7 @@ int CPiecesBar::OnCreate(LPCREATESTRUCT lpCreateStruct)
if (CControlBar::OnCreate(lpCreateStruct) == -1)
return -1;
- m_PiecesTree.Create(WS_VISIBLE|WS_TABSTOP|WS_BORDER|TVS_SHOWSELALWAYS|TVS_HASBUTTONS|TVS_HASLINES|TVS_LINESATROOT,
+ m_PiecesTree.Create(WS_VISIBLE|WS_TABSTOP|WS_BORDER|TVS_SHOWSELALWAYS|TVS_HASBUTTONS|TVS_HASLINES|TVS_LINESATROOT|TVS_INFOTIP,
CRect(0,0,0,0), this, IDW_PIECESTREE);
m_wndColorsList.Create(LBS_MULTICOLUMN|LBS_NOINTEGRALHEIGHT|LBS_NOTIFY|
@@ -1026,6 +1026,17 @@ BOOL CPiecesBar::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult)
pView->PostMessage(WM_LC_SET_CURSOR, 0, 0);
}
}
+ else if (Notify->hdr.code == TVN_GETINFOTIP)
+ {
+ LPNMTVGETINFOTIP Tip = (LPNMTVGETINFOTIP)lParam;
+ HTREEITEM Item = Tip->hItem;
+ PieceInfo* Info = (PieceInfo*)m_PiecesTree.GetItemData(Item);
+
+ if (Info != NULL)
+ {
+ _snprintf(Tip->pszText, Tip->cchTextMax, "%s (%s)", Info->m_strDescription, Info->m_strName);
+ }
+ }
else if (Notify->hdr.code == TVN_ITEMEXPANDING)
{
if (Notify->action == TVE_EXPAND)