1 /////////////////////////////////////////////////////////////////////////////
2 // Name: html/helpwnd.h
3 // Purpose: interface of wxHtmlHelpWindow
4 // Author: wxWidgets team
5 // Licence: wxWindows licence
6 /////////////////////////////////////////////////////////////////////////////
13 //wxID_HTML_HELPFRAME = wxID_HIGHEST + 1,
14 wxID_HTML_PANEL
= wxID_HIGHEST
+ 10,
23 wxID_HTML_BOOKMARKSLIST
,
24 wxID_HTML_BOOKMARKSADD
,
25 wxID_HTML_BOOKMARKSREMOVE
,
30 wxID_HTML_INDEXBUTTON
,
31 wxID_HTML_INDEXBUTTONALL
,
36 wxID_HTML_SEARCHBUTTON
,
37 wxID_HTML_SEARCHCHOICE
,
43 @class wxHtmlHelpWindow
45 This class is used by wxHtmlHelpController to display help within a frame or
46 dialog, but you can use it yourself to create an embedded HTML help window.
50 // m_embeddedHelpWindow is a wxHtmlHelpWindow
51 // m_embeddedHtmlHelp is a wxHtmlHelpController
53 // Create embedded HTML Help window
54 m_embeddedHelpWindow = new wxHtmlHelpWindow;
55 m_embeddedHtmlHelp.UseConfig(config, rootPath); // Set your own config object here
56 m_embeddedHtmlHelp.SetHelpWindow(m_embeddedHelpWindow);
57 m_embeddedHelpWindow->Create(this, wxID_ANY, wxDefaultPosition, GetClientSize(),
58 wxTAB_TRAVERSAL|wxBORDER_NONE, wxHF_DEFAULT_STYLE);
59 m_embeddedHtmlHelp.AddBook(wxFileName(wxT("doc.zip")));
62 You should pass the style wxHF_EMBEDDED to the style parameter of
63 wxHtmlHelpController to allow the embedded window to be destroyed
64 independently of the help controller.
69 class wxHtmlHelpWindow
: public wxWindow
72 wxHtmlHelpWindow(wxHtmlHelpData
* data
= NULL
);
77 For the values of @a helpStyle, please see the documentation for
80 wxHtmlHelpWindow(wxWindow
* parent
, int wxWindowID
,
81 const wxPoint
& pos
= wxDefaultPosition
,
82 const wxSize
& size
= wxDefaultSize
,
83 int style
= wxTAB_TRAVERSAL
|wxBORDER_NONE
,
84 int helpStyle
= wxHF_DEFAULT_STYLE
,
85 wxHtmlHelpData
* data
= NULL
);
88 Creates the help window. See @ref wxHtmlHelpWindow() "the constructor"
89 for a description of the parameters.
91 bool Create(wxWindow
* parent
, wxWindowID id
,
92 const wxPoint
& pos
= wxDefaultPosition
,
93 const wxSize
& size
= wxDefaultSize
, int style
= wxTAB_TRAVERSAL
|wxBORDER_NONE
,
94 int helpStyle
= wxHF_DEFAULT_STYLE
);
98 If not found it will give the user the choice of searching books.
99 Looking for the page runs in these steps:
100 -# try to locate file named x (if x is for example "doc/howto.htm")
101 -# try to open starting page of book x
102 -# try to find x in contents (if x is for example "How To ...")
103 -# try to find x in index (if x is for example "How To ...")
105 bool Display(const wxString
& x
);
110 This form takes numeric ID as the parameter (uses an extension to MS format,
111 param name="ID" value=id).
113 bool Display(const int id
);
116 Displays contents panel.
118 bool DisplayContents();
121 Displays index panel.
126 Returns the wxHtmlHelpData object, which is usually a pointer to the
129 wxHtmlHelpData
* GetData();
132 Search for given keyword. Optionally it searches through the index
133 (mode = @c wxHELP_SEARCH_INDEX), default the content (mode = @c wxHELP_SEARCH_ALL).
135 bool KeywordSearch(const wxString
& keyword
,
136 wxHelpSearchMode mode
= wxHELP_SEARCH_ALL
);
139 Reads the user's settings for this window.
141 @see wxHtmlHelpController::ReadCustomization
143 void ReadCustomization(wxConfigBase
* cfg
,
144 const wxString
& path
= wxEmptyString
);
147 Associates a wxConfig object with the help window. It is recommended that you
148 use wxHtmlHelpController::UseConfig instead.
150 void UseConfig(wxConfigBase
* config
,
151 const wxString
& rootpath
= wxEmptyString
);
154 Saves the user's settings for this window.
156 @see wxHtmlHelpController::WriteCustomization
158 void WriteCustomization(wxConfigBase
* cfg
,
159 const wxString
& path
= wxEmptyString
);
162 Refresh all panels. This is necessary if a new book was added.
167 wxHtmlHelpController
* GetController() const;
168 void SetController(wxHtmlHelpController
* controller
);
173 Creates search panel.
178 You may override this virtual method to add more buttons to the help window's
179 toolbar. @a toolBar is a pointer to the toolbar and @a style is the style
180 flag as passed to the Create() method.
182 wxToolBar::Realize is called immediately after returning from this function.
183 See @c samples/html/helpview for an example.
185 virtual void AddToolbarButtons(wxToolBar
* toolBar
, int style
);
188 Creates contents panel. (May take some time.)
190 void CreateContents();
193 Creates index panel. (May take some time.)