+ while (node)
+ {
+ entry = (wxExtHelpMapEntry *)node->GetData();
+ compB = entry->doc;
+
+ bool testTarget = ! compB.empty();
+ if (testTarget && ! showAll)
+ {
+ compB.LowerCase();
+ testTarget = compB.Contains(compA);
+ }
+
+ if (testTarget)
+ {
+ urls[idx] = entry->url;
+ // doesn't work:
+ // choices[idx] = (**i).doc.Contains((**i).doc.Before(WXEXTHELP_COMMENTCHAR));
+ //if (choices[idx].empty()) // didn't contain the ';'
+ // choices[idx] = (**i).doc;
+ choices[idx] = wxEmptyString;
+ for (int j=0; ; j++)
+ {
+ wxChar targetChar = entry->doc.c_str()[j];
+ if ((targetChar == 0) || (targetChar == WXEXTHELP_COMMENTCHAR))
+ break;
+
+ choices[idx] << targetChar;
+ }
+
+ idx++;
+ }
+
+ node = node->GetNext();
+ }
+ }
+
+ switch (idx)
+ {
+ case 0:
+ wxMessageBox(_("No entries found."));
+ break;
+
+ case 1:
+ rc = DisplayHelp(urls[0]);
+ break;
+
+ default:
+ idx = wxGetSingleChoiceIndex(
+ showAll ? _("Help Index") : _("Relevant entries:"),
+ showAll ? _("Help Index") : _("Entries found"),
+ idx, choices);
+ if (idx >= 0)
+ rc = DisplayHelp(urls[idx]);
+ break;
+ }
+
+ delete [] urls;
+ delete [] choices;
+
+ return rc;