I hope it's the right subforum.
I want to create a simple mp3 player and I want to have a search function. I created a wxSearchCtrl but I discovered that it doesn't have a function that does the job for me. I began writing my own searching function but I'm having some problems.
This is what I wrote so far:
Code: Select all
// text is defined in another part of the code. text = searchCtrl -> GetLineText(0);
searchItem ( wxString text, wxListCrl * listCtrl){
int count = 0 ;
for ( long i = 0; i != listCtrl -> GetItemCount(); i++ ){
if( listCtrl -> GetItemText( i, 1 ) . IsSameAs(text) || listCtrl -> GetItemText( i, 1) . StartsWith(text) )
cout ++;
}
cout << "Found " << count << " elements" << endl;
}
What should I do ?