]>
git.saurik.com Git - wxWidgets.git/blob - interface/wx/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
12 This class is used by wxHtmlHelpController
13 to display help within a frame or dialog, but you can use it yourself to create
14 an embedded HTML help window.
19 // m_embeddedHelpWindow is a wxHtmlHelpWindow
20 // m_embeddedHtmlHelp is a wxHtmlHelpController
22 // Create embedded HTML Help window
23 m_embeddedHelpWindow = new wxHtmlHelpWindow;
24 m_embeddedHtmlHelp.UseConfig(config, rootPath); // Set your own config
26 m_embeddedHtmlHelp.SetHelpWindow(m_embeddedHelpWindow);
27 m_embeddedHelpWindow-Create(this,
28 wxID_ANY, wxDefaultPosition, GetClientSize(),
29 wxTAB_TRAVERSAL|wxBORDER_NONE, wxHF_DEFAULT_STYLE);
30 m_embeddedHtmlHelp.AddBook(wxFileName(_T("doc.zip")));
33 You should pass the style wxHF_EMBEDDED to the style parameter of
34 wxHtmlHelpController to allow
35 the embedded window to be destroyed independently of the help controller.
40 class wxHtmlHelpWindow
: public wxWindow
46 Constructor. For the values of @e helpStyle, please see the documentation for
49 wxHtmlHelpWindow(wxHtmlHelpData
* data
= NULL
);
50 wxHtmlHelpWindow(wxWindow
* parent
, int wxWindowID
,
51 const wxPoint
& pos
= wxDefaultPosition
,
52 const wxSize
& pos
= wxDefaultSize
,
53 int style
= wxTAB_TRAVERSAL
|wxBORDER_NONE
,
54 int helpStyle
= wxHF_DEFAULT_STYLE
,
55 wxHtmlHelpData
* data
= NULL
);
59 You may override this virtual method to add more buttons to the help window's
60 toolbar. @a toolBar is a pointer to the toolbar and @a style is the style
61 flag as passed to the Create method.
62 wxToolBar::Realize is called immediately after returning from this function.
63 See @e samples/html/helpview for an example.
65 virtual void AddToolbarButtons(wxToolBar
* toolBar
, int style
);
68 Creates the help window. See @ref wxhtmlhelpwindow() "the constructor"
69 for a description of the parameters.
71 bool Create(wxWindow
* parent
, wxWindowID id
,
72 const wxPoint
& pos
= wxDefaultPosition
,
73 const wxSize
& pos
= wxDefaultSize
,
74 int style
= wxTAB_TRAVERSAL
|wxBORDER_NONE
,
75 int helpStyle
= wxHF_DEFAULT_STYLE
,
76 wxHtmlHelpData
* data
= NULL
);
79 Creates contents panel. (May take some time.)
82 void CreateContents();
85 Creates index panel. (May take some time.)
97 Displays page x. If not found it will give the user the choice of
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 ...")
104 The second form takes numeric ID as the parameter.
105 (uses extension to MS format, param name="ID" value=id)
107 bool Display(const wxString
& x
);
108 bool Display(const int id
);
112 Displays contents panel.
114 bool DisplayContents();
117 Displays index panel.
122 Returns the wxHtmlHelpData object, which is usually a pointer to the
125 wxHtmlHelpData
* GetData();
128 Search for given keyword. Optionally it searches through the index (mode =
129 wxHELP_SEARCH_INDEX), default the content (mode = wxHELP_SEARCH_ALL).
131 bool KeywordSearch(const wxString
& keyword
,
132 wxHelpSearchMode mode
= wxHELP_SEARCH_ALL
);
135 Reads the user's settings for this window (see
136 wxHtmlHelpController::ReadCustomization)
138 void ReadCustomization(wxConfigBase
* cfg
,
139 const wxString
& path
= wxEmptyString
);
142 Refresh all panels. This is necessary if a new book was added.
148 Sets the frame's title format. @a format must contain exactly one "%s"
149 (it will be replaced by the page title).
151 void SetTitleFormat(const wxString
& format
);
154 Associates a wxConfig object with the help window. It is recommended that you
155 use wxHtmlHelpController::UseConfig instead.
157 void UseConfig(wxConfigBase
* config
,
158 const wxString
& rootpath
= wxEmptyString
);
161 Saves the user's settings for this window(see
162 wxHtmlHelpController::WriteCustomization).
164 void WriteCustomization(wxConfigBase
* cfg
,
165 const wxString
& path
= wxEmptyString
);