Look in multiple paths when searching for resource files of samples
When using an out of source build, the files are not in the default wxWidgets directories. Also search in the current directory, parent directory and sample sub-directories. Closes https://trac.wxwidgets.org/ticket/18118
This commit is contained in:
@@ -163,10 +163,16 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
|
||||
help.UseConfig(wxConfig::Get());
|
||||
bool ret;
|
||||
help.SetTempDir(wxT("."));
|
||||
ret = help.AddBook(wxFileName(wxT("helpfiles/testing.hhp"), wxPATH_UNIX));
|
||||
|
||||
wxPathList pathlist;
|
||||
pathlist.Add(wxT("./helpfiles"));
|
||||
pathlist.Add(wxT("../helpfiles"));
|
||||
pathlist.Add(wxT("../../html/help/helpfiles"));
|
||||
|
||||
ret = help.AddBook(wxFileName(pathlist.FindValidPath(wxT("testing.hhp")), wxPATH_UNIX));
|
||||
if (! ret)
|
||||
wxMessageBox(wxT("Failed adding book helpfiles/testing.hhp"));
|
||||
ret = help.AddBook(wxFileName(wxT("helpfiles/another.hhp"), wxPATH_UNIX));
|
||||
ret = help.AddBook(wxFileName(pathlist.FindValidPath(wxT("another.hhp")), wxPATH_UNIX));
|
||||
if (! ret)
|
||||
wxMessageBox(_("Failed adding book helpfiles/another.hhp"));
|
||||
}
|
||||
|
Reference in New Issue
Block a user