# wxHtmlHelpWindow Class Reference
[Help, HTML]

`#include <wx/html/helpwnd.h>`

Inheritance diagram for wxHtmlHelpWindow:
[legend]

## Detailed Description

This class is used by wxHtmlHelpController to display help within a frame or dialog, but you can use it yourself to create an embedded HTML help window.

For example:

            // m_embeddedHelpWindow is a wxHtmlHelpWindow
            // m_embeddedHtmlHelp is a wxHtmlHelpController

            // Create embedded HTML Help window
            m_embeddedHelpWindow = new wxHtmlHelpWindow;
            m_embeddedHtmlHelp.UseConfig(config, rootPath); // Set your own config object here
            m_embeddedHtmlHelp.SetHelpWindow(m_embeddedHelpWindow);
            m_embeddedHelpWindow->Create(this, wxID_ANY, wxDefaultPosition, GetClientSize(),
                                         wxTAB_TRAVERSAL|wxBORDER_NONE, wxHF_DEFAULT_STYLE);
            m_embeddedHtmlHelp.AddBook(wxFileName(wxT("doc.zip")));

You should pass the style wxHF_EMBEDDED to the style parameter of wxHtmlHelpController to allow the embedded window to be destroyed independently of the help controller.

##

Library: wxHTML

Category: Help, HTML

## Public Member Functions
| wxHtmlHelpWindow (wxHtmlHelpData *data=NULL)
| wxHtmlHelpWindow (wxWindow *parent, int wxWindowID, const wxPoint &pos=wxDefaultPosition, const wxSize &pos=wxDefaultSize, int style=wxTAB_TRAVERSAL|wxBORDER_NONE, int helpStyle=wxHF_DEFAULT_STYLE, wxHtmlHelpData *data=NULL)
| Constructor.
bool | Create (wxWindow *parent, wxWindowID id, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, int style=wxTAB_TRAVERSAL|wxBORDER_NONE, int helpStyle=wxHF_DEFAULT_STYLE)
| Creates the help window.
bool | Display (const wxString &x)
| Displays page x.
bool | Display (const int id)
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. This form takes numeric ID as the parameter (uses an extension to MS format, param name="ID" value=id).
bool | DisplayContents ()
| Displays contents panel.
bool | DisplayIndex ()
| Displays index panel.
wxHtmlHelpData * | GetData ()
| Returns the wxHtmlHelpData object, which is usually a pointer to the controller's data.
bool | KeywordSearch (const wxString &keyword, wxHelpSearchMode mode=wxHELP_SEARCH_ALL)
| Search for given keyword.
void | ReadCustomization (wxConfigBase *cfg, const wxString &path=wxEmptyString)
| Reads the user's settings for this window.
void | UseConfig (wxConfigBase *config, const wxString &rootpath=wxEmptyString)
| Associates a wxConfig object with the help window.
void | WriteCustomization (wxConfigBase *cfg, const wxString &path=wxEmptyString)
| Saves the user's settings for this window.
void | RefreshLists ()
| Refresh all panels.
## Protected Member Functions
void | CreateSearch ()
| Creates search panel.
virtual void | AddToolbarButtons (wxToolBar *toolBar, int style)
| You may override this virtual method to add more buttons to the help window's toolbar.
void | CreateContents ()
| Creates contents panel.
void | CreateIndex ()
| Creates index panel.

List of all members.

## Constructor & Destructor Documentation

wxHtmlHelpWindow::wxHtmlHelpWindow | ( | wxHtmlHelpData * | data = `NULL` | ) |

wxHtmlHelpWindow::wxHtmlHelpWindow | ( | wxWindow * | parent,
|  | int | wxWindowID,
|  | const wxPoint & | pos = `wxDefaultPosition`,
|  | const wxSize & | pos = `wxDefaultSize`,
|  | int | style = `wxTAB_TRAVERSAL|wxBORDER_NONE`,
|  | int | helpStyle = `wxHF_DEFAULT_STYLE`,
|  | wxHtmlHelpData * | data = `NULL` |
| ) |  |  |

Constructor.

For the values of helpStyle, please see the documentation for wxHtmlHelpController.

## Member Function Documentation

virtual void wxHtmlHelpWindow::AddToolbarButtons | ( | wxToolBar * | toolBar,
|  | int | style |
| ) |  |  | `[protected, virtual]`

You may override this virtual method to add more buttons to the help window's toolbar.

toolBar is a pointer to the toolbar and style is the style flag as passed to the Create() method.

wxToolBar::Realize is called immediately after returning from this function. See `samples/html/helpview` for an example.

bool wxHtmlHelpWindow::Create | ( | wxWindow * | parent,
|  | wxWindowID | id,
|  | const wxPoint & | pos = `wxDefaultPosition`,
|  | const wxSize & | size = `wxDefaultSize`,
|  | int | style = `wxTAB_TRAVERSAL|wxBORDER_NONE`,
|  | int | helpStyle = `wxHF_DEFAULT_STYLE` |
| ) |  |  |

Creates the help window.

See the constructor for a description of the parameters.

void wxHtmlHelpWindow::CreateContents | ( |  | ) | `[protected]`

Creates contents panel.

(May take some time.)

void wxHtmlHelpWindow::CreateIndex | ( |  | ) | `[protected]`

Creates index panel.

(May take some time.)

void wxHtmlHelpWindow::CreateSearch | ( |  | ) | `[protected]`

Creates search panel.

bool wxHtmlHelpWindow::Display | ( | const int | id | ) |

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. This form takes numeric ID as the parameter (uses an extension to MS format, param name="ID" value=id).

bool wxHtmlHelpWindow::Display | ( | const wxString & | x | ) |

Displays page x.

If not found it will give the user the choice of searching books. Looking for the page runs in these steps:

1. try to locate file named x (if x is for example "doc/howto.htm")
2. try to open starting page of book x
3. try to find x in contents (if x is for example "How To ...")
4. try to find x in index (if x is for example "How To ...")

bool wxHtmlHelpWindow::DisplayContents | ( |  | ) |

Displays contents panel.

bool wxHtmlHelpWindow::DisplayIndex | ( |  | ) |

Displays index panel.

wxHtmlHelpData* wxHtmlHelpWindow::GetData | ( |  | ) |

Returns the wxHtmlHelpData object, which is usually a pointer to the controller's data.

bool wxHtmlHelpWindow::KeywordSearch | ( | const wxString & | keyword,
|  | wxHelpSearchMode | mode = `wxHELP_SEARCH_ALL` |
| ) |  |  |

Search for given keyword.

Optionally it searches through the index (mode = `wxHELP_SEARCH_INDEX`), default the content (mode = `wxHELP_SEARCH_ALL`).

void wxHtmlHelpWindow::ReadCustomization | ( | wxConfigBase * | cfg,
|  | const wxString & | path = `wxEmptyString` |
| ) |  |  |

Reads the user's settings for this window.

See also:
  wxHtmlHelpController::ReadCustomization

void wxHtmlHelpWindow::RefreshLists | ( |  | ) |

Refresh all panels.

This is necessary if a new book was added.

void wxHtmlHelpWindow::UseConfig | ( | wxConfigBase * | config,
|  | const wxString & | rootpath = `wxEmptyString` |
| ) |  |  |

Associates a wxConfig object with the help window.

It is recommended that you use wxHtmlHelpController::UseConfig instead.

void wxHtmlHelpWindow::WriteCustomization | ( | wxConfigBase * | cfg,
|  | const wxString & | path = `wxEmptyString` |
| ) |  |  |

Saves the user's settings for this window.

See also:
  wxHtmlHelpController::WriteCustomization

|  | [ top ]