Contents Up Previous Next

wxHtmlHelpWindow

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|wxNO_BORDER, wxHF_DEFAULT_STYLE);        
    m_embeddedHtmlHelp.AddBook(wxFileName(_T("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.

Derived from

wxWindow

Include files

<wx/html/helpwnd.h>

Members

wxHtmlHelpWindow::wxHtmlHelpWindow
wxHtmlHelpWindow::Create
wxHtmlHelpWindow::CreateContents
wxHtmlHelpWindow::CreateIndex
wxHtmlHelpWindow::CreateSearch
wxHtmlHelpWindow::Display
wxHtmlHelpWindow::DisplayContents
wxHtmlHelpWindow::DisplayIndex
wxHtmlHelpWindow::GetData
wxHtmlHelpWindow::KeywordSearch
wxHtmlHelpWindow::ReadCustomization
wxHtmlHelpWindow::RefreshLists
wxHtmlHelpWindow::SetTitleFormat
wxHtmlHelpWindow::UseConfig
wxHtmlHelpWindow::WriteCustomization
wxHtmlHelpWindow::AddToolbarButtons


wxHtmlHelpWindow::wxHtmlHelpWindow

wxHtmlHelpWindow(wxHtmlHelpData* data = NULL)

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

Constructor.

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


wxHtmlHelpWindow::Create

bool Create(wxWindow* parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& pos = wxDefaultSize, int style = wxTAB_TRAVERSAL|wxTAB_wxNO_BORDER, int helpStyle = wxHF_DEFAULT_STYLE, wxHtmlHelpData* data = NULL)

Creates the help window. See the constructor for a description of the parameters.


wxHtmlHelpWindow::CreateContents

void CreateContents()

Creates contents panel. (May take some time.)

Protected.


wxHtmlHelpWindow::CreateIndex

void CreateIndex()

Creates index panel. (May take some time.)

Protected.


wxHtmlHelpWindow::CreateSearch

void CreateSearch()

Creates search panel.


wxHtmlHelpWindow::Display

bool Display(const wxString& x)

bool Display(const int id)

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 ...")

The second form takes numeric ID as the parameter. (uses extension to MS format, <param name="ID" value=id>)

wxPython note: The second form of this method is named DisplayId in wxPython.


wxHtmlHelpWindow::DisplayContents

bool DisplayContents()

Displays contents panel.


wxHtmlHelpWindow::DisplayIndex

bool DisplayIndex()

Displays index panel.


wxHtmlHelpWindow::GetData

wxHtmlHelpData* GetData()

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


wxHtmlHelpWindow::KeywordSearch

bool 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).


wxHtmlHelpWindow::ReadCustomization

void ReadCustomization(wxConfigBase* cfg, const wxString& path = wxEmptyString)

Reads the user's settings for this window (see wxHtmlHelpController::ReadCustomization)


wxHtmlHelpWindow::RefreshLists

void RefreshLists()

Refresh all panels. This is necessary if a new book was added.

Protected.


wxHtmlHelpWindow::SetTitleFormat

void SetTitleFormat(const wxString& format)

Sets the frame's title format. format must contain exactly one "%s" (it will be replaced by the page title).


wxHtmlHelpWindow::UseConfig

void UseConfig(wxConfigBase* config, const wxString& rootpath = wxEmptyString)

Associates a wxConfig object with the help window. It is recommended that you use wxHtmlHelpController::UseConfig instead.


wxHtmlHelpWindow::WriteCustomization

void WriteCustomization(wxConfigBase* cfg, const wxString& path = wxEmptyString)

Saves the user's settings for this window(see wxHtmlHelpController::WriteCustomization).


wxHtmlHelpWindow::AddToolbarButtons

virtual void AddToolbarButtons(wxToolBar *toolBar, int style)

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.