with help-id 0 and if not found a homemade list of contents is presented. :-)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3071
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
#include <unistd.h>
#endif
#include <unistd.h>
#endif
class wxExtHelpMapEntry : public wxObject
{
public:
class wxExtHelpMapEntry : public wxObject
{
public:
if(! m_NumOfEntries)
return FALSE;
if(! m_NumOfEntries)
return FALSE;
- // use ID 0 for contents
- if(! DisplaySection(0))
- return KeywordSearch("");
- else
- return TRUE;
+ wxString contents;
+ wxNode *node = m_MapList->First();
+ wxExtHelpMapEntry *entry;
+ while(node)
+ {
+ entry = (wxExtHelpMapEntry *)node->Data();
+ if(entry->id == CONTENTS_ID)
+ {
+ contents = entry->url;
+ break;
+ }
+ node = node->Next();
+ }
+
+ bool rc = FALSE;
+ if(contents.Length() && wxFileExists(contents.BeforeLast('#')))
+ rc = DisplaySection(CONTENTS_ID);
+
+ // if not found, open homemade toc:
+ return rc ? TRUE : KeywordSearch("");