Faster piece combo updates.

This commit is contained in:
leo 2012-11-09 00:07:33 +00:00
parent 04932395be
commit 3d7f0eed41

View file

@ -479,20 +479,12 @@ LRESULT CMainFrame::OnAddString(UINT lParam, LONG /*wParam*/)
{ {
if (lParam == NULL) if (lParam == NULL)
{ {
// Clear list
m_wndPiecesBar.m_wndPiecesCombo.ResetContent(); m_wndPiecesBar.m_wndPiecesCombo.ResetContent();
return TRUE; return TRUE;
} }
// Search if the string is already there if (m_wndPiecesBar.m_wndPiecesCombo.FindString(-1, (char*)lParam) == -1)
for (int i = 0; i < m_wndPiecesBar.m_wndPiecesCombo.GetCount();i++) m_wndPiecesBar.m_wndPiecesCombo.AddString ((char*)lParam);
{
char tmp[100];
m_wndPiecesBar.m_wndPiecesCombo.GetLBText (i, tmp);
if (strcmp ((char*)lParam, tmp) == 0)
return TRUE;
}
m_wndPiecesBar.m_wndPiecesCombo.AddString ((char*)lParam);
return TRUE; return TRUE;
} }