]>
git.saurik.com Git - wxWidgets.git/blob - interface/html/helpwnd.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: html/helpwnd.h
3 // Purpose: interface of wxHtmlHelpWindow
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
10 @class wxHtmlHelpWindow
11 @headerfile helpwnd.h wx/html/helpwnd.h
13 This class is used by wxHtmlHelpController
14 to display help within a frame or dialog, but you can use it yourself to create
15 an embedded HTML help window.
20 // m_embeddedHelpWindow is a wxHtmlHelpWindow
21 // m_embeddedHtmlHelp is a wxHtmlHelpController
23 // Create embedded HTML Help window
24 m_embeddedHelpWindow = new wxHtmlHelpWindow;
25 m_embeddedHtmlHelp.UseConfig(config, rootPath); // Set your own config
27 m_embeddedHtmlHelp.SetHelpWindow(m_embeddedHelpWindow);
28 m_embeddedHelpWindow-Create(this,
29 wxID_ANY, wxDefaultPosition, GetClientSize(),
30 wxTAB_TRAVERSAL|wxBORDER_NONE, wxHF_DEFAULT_STYLE);
31 m_embeddedHtmlHelp.AddBook(wxFileName(_T("doc.zip")));
34 You should pass the style wxHF_EMBEDDED to the style parameter of
35 wxHtmlHelpController to allow
36 the embedded window to be destroyed independently of the help controller.
41 class wxHtmlHelpWindow
: public wxWindow
47 Constructor. For the values of @e helpStyle, please see the documentation for
50 wxHtmlHelpWindow(wxHtmlHelpData
* data
= NULL
);
51 wxHtmlHelpWindow(wxWindow
* parent
, int wxWindowID
,
52 const wxPoint
& pos
= wxDefaultPosition
,
53 const wxSize
& pos
= wxDefaultSize
,
54 int style
= wxTAB_TRAVERSAL
|wxBORDER_NONE
,
55 int helpStyle
= wxHF_DEFAULT_STYLE
,
56 wxHtmlHelpData
* data
= NULL
);
60 You may override this virtual method to add more buttons to the help window's
61 toolbar. @a toolBar is a pointer to the toolbar and @a style is the style
62 flag as passed to the Create method.
63 wxToolBar::Realize is called immediately after returning from this function.
64 See @e samples/html/helpview for an example.
66 virtual void AddToolbarButtons(wxToolBar
* toolBar
, int style
);
69 Creates the help window. See @ref wxhtmlhelpwindow() "the constructor"
70 for a description of the parameters.
72 bool Create(wxWindow
* parent
, wxWindowID id
,
73 const wxPoint
& pos
= wxDefaultPosition
,
74 const wxSize
& pos
= wxDefaultSize
,
75 int style
= wxTAB_TRAVERSAL
|wxBORDER_NONE
,
76 int helpStyle
= wxHF_DEFAULT_STYLE
,
77 wxHtmlHelpData
* data
= NULL
);
80 Creates contents panel. (May take some time.)
83 void CreateContents();
86 Creates index panel. (May take some time.)
98 Displays page x. If not found it will give the user the choice of
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 ...")
105 The second form takes numeric ID as the parameter.
106 (uses extension to MS format, param name="ID" value=id)
108 bool Display(const wxString
& x
);
109 bool Display(const int id
);
113 Displays contents panel.
115 bool DisplayContents();
118 Displays index panel.
123 Returns the wxHtmlHelpData object, which is usually a pointer to the
126 wxHtmlHelpData
* GetData();
129 Search for given keyword. Optionally it searches through the index (mode =
130 wxHELP_SEARCH_INDEX), default the content (mode = wxHELP_SEARCH_ALL).
132 bool KeywordSearch(const wxString
& keyword
,
133 wxHelpSearchMode mode
= wxHELP_SEARCH_ALL
);
136 Reads the user's settings for this window (see
137 wxHtmlHelpController::ReadCustomization)
139 void ReadCustomization(wxConfigBase
* cfg
,
140 const wxString
& path
= wxEmptyString
);
143 Refresh all panels. This is necessary if a new book was added.
149 Sets the frame's title format. @a format must contain exactly one "%s"
150 (it will be replaced by the page title).
152 void SetTitleFormat(const wxString
& format
);
155 Associates a wxConfig object with the help window. It is recommended that you
156 use wxHtmlHelpController::UseConfig instead.
158 void UseConfig(wxConfigBase
* config
,
159 const wxString
& rootpath
= wxEmptyString
);
162 Saves the user's settings for this window(see
163 wxHtmlHelpController::WriteCustomization).
165 void WriteCustomization(wxConfigBase
* cfg
,
166 const wxString
& path
= wxEmptyString
);