2
* This file is part of the Code::Blocks IDE and licensed under the GNU General Public License, version 3
3
* http://www.gnu.org/licenses/gpl-3.0.html
11
Sample help script for wxWidgets docs.
12
Based on the original unix shell script by rjmyst3
14
function SearchHelp(keyword)
16
// that's all you should ever need to change in here
17
local wx_version = _T("2.8")
18
// on windows, adjust this for your wx installation
19
local wx_doc_folder = _T("/usr/share/doc")
21
if (PLATFORM == PLATFORM_GTK)
22
wx_doc_folder += _T("/wx") + wx_version + _T("-doc")
26
// normally, you shouldn't have to edit anything below this point
29
local helproot = wx_doc_folder + _T("/wx-manual.html/")
30
if (!IO.DirectoryExists(helproot))
32
local msg = _T("wxWidgets documentation not found. Its expected location is:\n\n");
35
msg += _T("If it is not installed, please install it and try again.\n");
36
msg += _T("If it is installed to a different location, you can edit the wx_help.script to reflect that.");
41
local prefix = _T("wx") + wx_version + _T("-manual_")
43
// replace "contents" with "classref" below to default to alphabetical class list
44
local defaultpath = prefix + _T("contents.html")
46
// If there is no keyword, launch the default page defined above
47
if (keyword.IsEmpty())
49
App.Open(helproot + defaultpath, false)
53
// convert keyword to lowercase, this should be the class name
55
local classpath = helproot + prefix + keyword + _T(".html")
57
LogDebug(_T("Opening ") + classpath)
58
if (IO.FileExists(classpath))
60
App.Open(classpath, false)
64
LogDebug(_T("Not found, opening default page"))
65
App.Open(helproot + defaultpath, false)