From 85c3a7f5afcc88696d50866525588756e6bf80c3 Mon Sep 17 00:00:00 2001 From: leo Date: Sat, 3 Dec 2005 22:05:28 +0000 Subject: Fixed names of some patterned pieces in the piece list. git-svn-id: http://svn.leocad.org/trunk@442 c7d43263-9d01-0410-8a33-9dba5d9f93d6 --- win/Piecebar.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/win/Piecebar.cpp b/win/Piecebar.cpp index 43799a2..0a793e4 100644 --- a/win/Piecebar.cpp +++ b/win/Piecebar.cpp @@ -1142,7 +1142,12 @@ BOOL CPiecesBar::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult) for (int i = 0; i < Pieces.GetSize(); i++) { PieceInfo* Info = Pieces[i]; - m_PiecesTree.InsertItem(TVIF_PARAM|TVIF_TEXT, Info->m_strDescription + strlen(Parent->m_strDescription) + 1, 0, 0, 0, 0, (LPARAM)Info, ParentItem, TVI_SORT); + + // If both descriptions begin with the same text, only show the difference. + if (!strncmp(Info->m_strDescription, Parent->m_strDescription, strlen(Parent->m_strDescription))) + m_PiecesTree.InsertItem(TVIF_PARAM|TVIF_TEXT, Info->m_strDescription + strlen(Parent->m_strDescription) + 1, 0, 0, 0, 0, (LPARAM)Info, ParentItem, TVI_SORT); + else + m_PiecesTree.InsertItem(TVIF_PARAM|TVIF_TEXT, Info->m_strDescription, 0, 0, 0, 0, (LPARAM)Info, ParentItem, TVI_SORT); } } } -- cgit v1.2.3