]>
git.saurik.com Git - wxWidgets.git/blob - interface/wx/html/helpwnd.h
e175f4d14c678039e23fa7c9b9c1d8dccd14f94c
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: html/helpwnd.h
3 // Purpose: interface of wxHtmlHelpWindow
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
10 @class wxHtmlHelpWindow
12 This class is used by wxHtmlHelpController to display help within a frame or
13 dialog, but you can use it yourself to create an embedded HTML help window.
17 // m_embeddedHelpWindow is a wxHtmlHelpWindow
18 // m_embeddedHtmlHelp is a wxHtmlHelpController
20 // Create embedded HTML Help window
21 m_embeddedHelpWindow = new wxHtmlHelpWindow;
22 m_embeddedHtmlHelp.UseConfig(config, rootPath); // Set your own config object here
23 m_embeddedHtmlHelp.SetHelpWindow(m_embeddedHelpWindow);
24 m_embeddedHelpWindow->Create(this, wxID_ANY, wxDefaultPosition, GetClientSize(),
25 wxTAB_TRAVERSAL|wxBORDER_NONE, wxHF_DEFAULT_STYLE);
26 m_embeddedHtmlHelp.AddBook(wxFileName(_T("doc.zip")));
29 You should pass the style wxHF_EMBEDDED to the style parameter of
30 wxHtmlHelpController to allow the embedded window to be destroyed
31 independently of the help controller.
36 class wxHtmlHelpWindow
: public wxWindow
39 wxHtmlHelpWindow(wxHtmlHelpData
* data
= NULL
);
44 For the values of @a helpStyle, please see the documentation for
47 wxHtmlHelpWindow(wxWindow
* parent
, int wxWindowID
,
48 const wxPoint
& pos
= wxDefaultPosition
,
49 const wxSize
& pos
= wxDefaultSize
,
50 int style
= wxTAB_TRAVERSAL
|wxBORDER_NONE
,
51 int helpStyle
= wxHF_DEFAULT_STYLE
,
52 wxHtmlHelpData
* data
= NULL
);
55 You may override this virtual method to add more buttons to the help window's
56 toolbar. @a toolBar is a pointer to the toolbar and @a style is the style
57 flag as passed to the Create() method.
59 wxToolBar::Realize is called immediately after returning from this function.
60 See @c samples/html/helpview for an example.
62 virtual void AddToolbarButtons(wxToolBar
* toolBar
, int style
);
65 Creates the help window. See @ref wxHtmlHelpWindow() "the constructor"
66 for a description of the parameters.
68 bool Create(wxWindow
* parent
, wxWindowID id
,
69 const wxPoint
& pos
= wxDefaultPosition
,
70 const wxSize
& size
= wxDefaultSize
, int style
= wxTAB_TRAVERSAL
|wxBORDER_NONE
,
71 int helpStyle
= wxHF_DEFAULT_STYLE
);
80 If not found it will give the user the choice of searching books.
81 Looking for the page runs in these steps:
82 -# try to locate file named x (if x is for example "doc/howto.htm")
83 -# try to open starting page of book x
84 -# try to find x in contents (if x is for example "How To ...")
85 -# try to find x in index (if x is for example "How To ...")
87 bool Display(const wxString
& x
);
92 This form takes numeric ID as the parameter (uses an extension to MS format,
93 param name="ID" value=id).
95 bool Display(const int id
);
98 Displays contents panel.
100 bool DisplayContents();
103 Displays index panel.
108 Returns the wxHtmlHelpData object, which is usually a pointer to the
111 wxHtmlHelpData
* GetData();
114 Search for given keyword. Optionally it searches through the index
115 (mode = @c wxHELP_SEARCH_INDEX), default the content (mode = @c wxHELP_SEARCH_ALL).
117 bool KeywordSearch(const wxString
& keyword
,
118 wxHelpSearchMode mode
= wxHELP_SEARCH_ALL
);
121 Reads the user's settings for this window.
123 @see wxHtmlHelpController::ReadCustomization
125 void ReadCustomization(wxConfigBase
* cfg
,
126 const wxString
& path
= wxEmptyString
);
129 Sets the frame's title format.
131 @a format must contain exactly one "%s" (it will be replaced by the page title).
133 void SetTitleFormat(const wxString
& format
);
136 Associates a wxConfig object with the help window. It is recommended that you
137 use wxHtmlHelpController::UseConfig instead.
139 void UseConfig(wxConfigBase
* config
,
140 const wxString
& rootpath
= wxEmptyString
);
143 Saves the user's settings for this window.
145 @see wxHtmlHelpController::WriteCustomization
147 void WriteCustomization(wxConfigBase
* cfg
,
148 const wxString
& path
= wxEmptyString
);
153 Creates contents panel. (May take some time.)
155 void CreateContents();
158 Creates index panel. (May take some time.)
163 Refresh all panels. This is necessary if a new book was added.