]>
git.saurik.com Git - wxWidgets.git/blob - interface/html/helpwnd.h
c7d6add0a16265ff742f80136797bbec894c0578
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: html/helpwnd.h
3 // Purpose: documentation for wxHtmlHelpWindow class
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
48 Constructor. For the values of @e helpStyle, please see the documentation for
51 wxHtmlHelpWindow(wxHtmlHelpData
* data
= @NULL
);
52 wxHtmlHelpWindow(wxWindow
* parent
, int wxWindowID
,
53 const wxPoint
& pos
= wxDefaultPosition
,
54 const wxSize
& pos
= wxDefaultSize
,
55 int style
= wxTAB_TRAVERSAL
|wxBORDER_NONE
,
56 int helpStyle
= wxHF_DEFAULT_STYLE
,
57 wxHtmlHelpData
* data
= @NULL
);
61 You may override this virtual method to add more buttons to the help window's
62 toolbar. @e toolBar is a pointer to the toolbar and @e style is the style
63 flag as passed to the Create method.
65 wxToolBar::Realize is called immediately after returning from this function.
67 See @e samples/html/helpview for an example.
69 virtual void AddToolbarButtons(wxToolBar
* toolBar
, int style
);
72 Creates the help window. See @ref wxhtmlhelpwindow() "the constructor"
73 for a description of the parameters.
75 bool Create(wxWindow
* parent
, wxWindowID id
,
76 const wxPoint
& pos
= wxDefaultPosition
,
77 const wxSize
& pos
= wxDefaultSize
,
78 int style
= wxTAB_TRAVERSAL
|wxBORDER_NONE
,
79 int helpStyle
= wxHF_DEFAULT_STYLE
,
80 wxHtmlHelpData
* data
= @NULL
);
83 Creates contents panel. (May take some time.)
87 void CreateContents();
90 Creates index panel. (May take some time.)
103 Displays page x. If not found it will give the user the choice of
105 Looking for the page runs in these steps:
107 try to locate file named x (if x is for example "doc/howto.htm")
108 try to open starting page of book x
109 try to find x in contents (if x is for example "How To ...")
110 try to find x in index (if x is for example "How To ...")
112 The second form takes numeric ID as the parameter.
113 (uses extension to MS format, param name="ID" value=id)
115 bool Display(const wxString
& x
);
116 bool Display(const int id
);
120 Displays contents panel.
122 bool DisplayContents();
125 Displays index panel.
130 Returns the wxHtmlHelpData object, which is usually a pointer to the
133 wxHtmlHelpData
* GetData();
136 Search for given keyword. Optionally it searches through the index (mode =
137 wxHELP_SEARCH_INDEX), default the content (mode = wxHELP_SEARCH_ALL).
139 bool KeywordSearch(const wxString
& keyword
,
140 wxHelpSearchMode mode
= wxHELP_SEARCH_ALL
);
143 Reads the user's settings for this window (see
144 wxHtmlHelpController::ReadCustomization)
146 void ReadCustomization(wxConfigBase
* cfg
,
147 const wxString
& path
= wxEmptyString
);
150 Refresh all panels. This is necessary if a new book was added.
157 Sets the frame's title format. @e format must contain exactly one "%s"
158 (it will be replaced by the page title).
160 void SetTitleFormat(const wxString
& format
);
163 Associates a wxConfig object with the help window. It is recommended that you
164 use wxHtmlHelpController::UseConfig instead.
166 void UseConfig(wxConfigBase
* config
,
167 const wxString
& rootpath
= wxEmptyString
);
170 Saves the user's settings for this window(see
171 wxHtmlHelpController::WriteCustomization).
173 void WriteCustomization(wxConfigBase
* cfg
,
174 const wxString
& path
= wxEmptyString
);