+void wxHtmlHelpFrame::DisplayIndexItem(const wxHtmlHelpMergedIndexItem *it)
+{
+ if (it->items.size() == 1)
+ {
+ if (!it->items[0]->page.empty())
+ {
+ m_HtmlWin->LoadPage(it->items[0]->GetFullPath());
+ NotifyPageChanged();
+ }
+ }
+ else
+ {
+ wxBusyCursor busy_cursor;
+
+ // more pages associated with this index item -- let the user choose
+ // which one she/he wants from a list:
+ wxArrayString arr;
+ size_t len = it->items.size();
+ for (size_t i = 0; i < len; i++)
+ {
+ wxString page = it->items[i]->page;
+ // try to find page's title in contents:
+ const wxHtmlHelpDataItems& contents = m_Data->GetContentsArray();
+ size_t clen = contents.size();
+ for (size_t j = 0; j < clen; j++)
+ {
+ if (contents[j].page == page)
+ {
+ page = contents[j].name;
+ break;
+ }
+ }
+ arr.push_back(page);
+ }
+
+ wxSingleChoiceDialog dlg(this,
+ _("Please choose the page to display:"),
+ _("Help Topics"),
+ arr, NULL, wxCHOICEDLG_STYLE & ~wxCENTRE);
+ if (dlg.ShowModal() == wxID_OK)
+ {
+ m_HtmlWin->LoadPage(it->items[dlg.GetSelection()]->GetFullPath());
+ NotifyPageChanged();
+ }
+ }
+}