1 /////////////////////////////////////////////////////////////////////////////
2 // Name: html/helpwnd.h
3 // Purpose: interface of wxHtmlHelpWindow
4 // Author: wxWidgets team
6 // Licence: wxWindows licence
7 /////////////////////////////////////////////////////////////////////////////
14 //wxID_HTML_HELPFRAME = wxID_HIGHEST + 1,
15 wxID_HTML_PANEL
= wxID_HIGHEST
+ 10,
24 wxID_HTML_BOOKMARKSLIST
,
25 wxID_HTML_BOOKMARKSADD
,
26 wxID_HTML_BOOKMARKSREMOVE
,
31 wxID_HTML_INDEXBUTTON
,
32 wxID_HTML_INDEXBUTTONALL
,
37 wxID_HTML_SEARCHBUTTON
,
38 wxID_HTML_SEARCHCHOICE
,
44 @class wxHtmlHelpWindow
46 This class is used by wxHtmlHelpController to display help within a frame or
47 dialog, but you can use it yourself to create an embedded HTML help window.
51 // m_embeddedHelpWindow is a wxHtmlHelpWindow
52 // m_embeddedHtmlHelp is a wxHtmlHelpController
54 // Create embedded HTML Help window
55 m_embeddedHelpWindow = new wxHtmlHelpWindow;
56 m_embeddedHtmlHelp.UseConfig(config, rootPath); // Set your own config object here
57 m_embeddedHtmlHelp.SetHelpWindow(m_embeddedHelpWindow);
58 m_embeddedHelpWindow->Create(this, wxID_ANY, wxDefaultPosition, GetClientSize(),
59 wxTAB_TRAVERSAL|wxBORDER_NONE, wxHF_DEFAULT_STYLE);
60 m_embeddedHtmlHelp.AddBook(wxFileName(wxT("doc.zip")));
63 You should pass the style wxHF_EMBEDDED to the style parameter of
64 wxHtmlHelpController to allow the embedded window to be destroyed
65 independently of the help controller.
70 class wxHtmlHelpWindow
: public wxWindow
73 wxHtmlHelpWindow(wxHtmlHelpData
* data
= NULL
);
78 For the values of @a helpStyle, please see the documentation for
81 wxHtmlHelpWindow(wxWindow
* parent
, int wxWindowID
,
82 const wxPoint
& pos
= wxDefaultPosition
,
83 const wxSize
& size
= wxDefaultSize
,
84 int style
= wxTAB_TRAVERSAL
|wxBORDER_NONE
,
85 int helpStyle
= wxHF_DEFAULT_STYLE
,
86 wxHtmlHelpData
* data
= NULL
);
89 Creates the help window. See @ref wxHtmlHelpWindow() "the constructor"
90 for a description of the parameters.
92 bool Create(wxWindow
* parent
, wxWindowID id
,
93 const wxPoint
& pos
= wxDefaultPosition
,
94 const wxSize
& size
= wxDefaultSize
, int style
= wxTAB_TRAVERSAL
|wxBORDER_NONE
,
95 int helpStyle
= wxHF_DEFAULT_STYLE
);
99 If not found it will give the user the choice of searching books.
100 Looking for the page runs in these steps:
101 -# try to locate file named x (if x is for example "doc/howto.htm")
102 -# try to open starting page of book x
103 -# try to find x in contents (if x is for example "How To ...")
104 -# try to find x in index (if x is for example "How To ...")
106 bool Display(const wxString
& x
);
111 This form takes numeric ID as the parameter (uses an extension to MS format,
112 param name="ID" value=id).
114 bool Display(const int id
);
117 Displays contents panel.
119 bool DisplayContents();
122 Displays index panel.
127 Returns the wxHtmlHelpData object, which is usually a pointer to the
130 wxHtmlHelpData
* GetData();
133 Search for given keyword. Optionally it searches through the index
134 (mode = @c wxHELP_SEARCH_INDEX), default the content (mode = @c wxHELP_SEARCH_ALL).
136 bool KeywordSearch(const wxString
& keyword
,
137 wxHelpSearchMode mode
= wxHELP_SEARCH_ALL
);
140 Reads the user's settings for this window.
142 @see wxHtmlHelpController::ReadCustomization
144 void ReadCustomization(wxConfigBase
* cfg
,
145 const wxString
& path
= wxEmptyString
);
148 Associates a wxConfig object with the help window. It is recommended that you
149 use wxHtmlHelpController::UseConfig instead.
151 void UseConfig(wxConfigBase
* config
,
152 const wxString
& rootpath
= wxEmptyString
);
155 Saves the user's settings for this window.
157 @see wxHtmlHelpController::WriteCustomization
159 void WriteCustomization(wxConfigBase
* cfg
,
160 const wxString
& path
= wxEmptyString
);
163 Refresh all panels. This is necessary if a new book was added.
168 wxHtmlHelpController
* GetController() const;
169 void SetController(wxHtmlHelpController
* controller
);
174 Creates search panel.
179 You may override this virtual method to add more buttons to the help window's
180 toolbar. @a toolBar is a pointer to the toolbar and @a style is the style
181 flag as passed to the Create() method.
183 wxToolBar::Realize is called immediately after returning from this function.
184 See @c samples/html/helpview for an example.
186 virtual void AddToolbarButtons(wxToolBar
* toolBar
, int style
);
189 Creates contents panel. (May take some time.)
191 void CreateContents();
194 Creates index panel. (May take some time.)