summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorleo2005-12-03 22:05:28 +0000
committerleo2005-12-03 22:05:28 +0000
commit85c3a7f5afcc88696d50866525588756e6bf80c3 (patch)
tree52169f9a8cf7317caee8bed49bf4e9f3d8e05b69
parentf474fa287cc0ce8be750fecb7c0100a3cf98d6d1 (diff)
Fixed names of some patterned pieces in the piece list.
git-svn-id: http://svn.leocad.org/trunk@442 c7d43263-9d01-0410-8a33-9dba5d9f93d6
-rw-r--r--win/Piecebar.cpp7
1 files changed, 6 insertions, 1 deletions
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);
}
}
}