1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-02 00:29:41 +02:00

In tree view, search label and key.

In name view, search label.
In key view, search key.
This commit is contained in:
lllucius 2013-10-04 03:15:51 +00:00
parent e6183b3c32
commit 1898cd6349

View File

@ -760,15 +760,28 @@ KeyView::RefreshLines()
{
KeyNode & node = mNodes[i];
// Search the label (with possible prefix) and key
//
// The x"01" separator is used to prevent finding a
// match comprising the end of the label and beginning
// of the key. It was chosen since it's not very likely
// to appear in the filter itself.
wxString searchit = node.label.Lower() +
wxT("\01x") +
node.key.Lower();
// Search columns based on view type
wxString searchit;
switch (mViewType)
{
// The x"01" separator is used to prevent finding a
// match comprising the end of the label and beginning
// of the key. It was chosen since it's not very likely
// to appear in the filter itself.
case ViewByTree:
searchit = node.label.Lower() +
wxT("\01x") +
node.key.Lower();
break;
case ViewByName:
searchit = node.label.Lower();
break;
case ViewByKey:
searchit = node.key.Lower();
break;
}
if (searchit.Find(mFilter) == wxNOT_FOUND)
{
// Not found so continue to next node