Phoenix Logo

phoenix_title wx.html.HtmlHelpWindow

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

For example:

def EmbedHTML(self):
    # self.embeddedHelpWindow is a wx.html.HtmlHelpWindow
    # self.embeddedHtmlHelp is a wx.html.HtmlHelpController

    # Create embedded HTML Help window
    self.embeddedHelpWindow = wx.html.HtmlHelpWindow
    self.embeddedHtmlHelp.UseConfig(config, rootPath) # Set your own config object here
    self.embeddedHtmlHelp.SetHelpWindow(self.embeddedHelpWindow)
    self.embeddedHelpWindow.Create(self, wx.ID_ANY, wx.DefaultPosition, self.GetClientSize(),
                                   wx.TAB_TRAVERSAL | wx.BORDER_NONE, wx.html.HF_DEFAULT_STYLE)
    self.embeddedHtmlHelp.AddBook("doc.zip")

You should pass the style wx.html.HF_EMBEDDED to the style parameter of wx.html.HtmlHelpController to allow the embedded window to be destroyed independently of the help controller.


class_hierarchy Class Hierarchy

Inheritance diagram for class HtmlHelpWindow:

method_summary Methods Summary

__init__  
AddToolbarButtons You may override this virtual method to add more buttons to the help window’s toolbar.
Create Creates the help window.
CreateContents Creates contents panel.
CreateIndex Creates index panel.
CreateSearch Creates search panel.
Display Displays page x.
DisplayContents Displays contents panel.
DisplayIndex Displays index panel.
GetController  
GetData Returns the wx.html.HtmlHelpData object, which is usually a pointer to the controller’s data.
KeywordSearch Search for given keyword.
ReadCustomization Reads the user’s settings for this window.
RefreshLists Refresh all panels.
SetController  
UseConfig Associates a Config object with the help window.
WriteCustomization Saves the user’s settings for this window.

property_summary Properties Summary

Controller See GetController and SetController
Data See GetData

api Class API



class wx.html.HtmlHelpWindow(Window)

Possible constructors:

HtmlHelpWindow(data=None)

HtmlHelpWindow(parent, WindowID, pos=DefaultPosition, size=DefaultSize,
               style=TAB_TRAVERSAL|BORDER_NONE, helpStyle=HF_DEFAULT_STYLE, data=None)

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


Methods



__init__(self, *args, **kw)

overload Overloaded Implementations:



__init__ (self, data=None)

Parameters:data (wx.html.HtmlHelpData) –



__init__ (self, parent, WindowID, pos=DefaultPosition, size=DefaultSize, style=TAB_TRAVERSAL|BORDER_NONE, helpStyle=HF_DEFAULT_STYLE, data=None)

Constructor.

For the values of helpStyle, please see the documentation for wx.html.HtmlHelpController.

Parameters:





AddToolbarButtons(self, toolBar, 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.

wx.ToolBar.Realize is called immediately after returning from this function. See samples/html/helpview for an example.

Parameters:


Create(self, parent, id=ID_ANY, pos=DefaultPosition, size=DefaultSize, style=TAB_TRAVERSAL|BORDER_NONE, helpStyle=HF_DEFAULT_STYLE)

Creates the help window.

See the constructor for a description of the parameters.

Parameters:
Return type:

bool



CreateContents(self)

Creates contents panel.

(May take some time.)



CreateIndex(self)

Creates index panel.

(May take some time.)



CreateSearch(self)

Creates search panel.



Display(self, *args, **kw)

overload Overloaded Implementations:



Display (self, 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:

  • try to locate file named x (if x is for example “doc/howto.htm”)
  • try to open starting page of book x
  • try to find x in contents (if x is for example “How To ...”)
  • try to find x in index (if x is for example “How To ...”)
Parameters:x (string) –
Return type:bool



Display (self, id)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters:id (int) –
Return type:bool





DisplayContents(self)

Displays contents panel.

Return type:bool


DisplayIndex(self)

Displays index panel.

Return type:bool


GetController(self)
Return type: wx.html.HtmlHelpController


GetData(self)

Returns the wx.html.HtmlHelpData object, which is usually a pointer to the controller’s data.

Return type: wx.html.HtmlHelpData


KeywordSearch(self, keyword, mode=HELP_SEARCH_ALL)

Search for given keyword.

Optionally it searches through the index (mode = HELP_SEARCH_INDEX ), default the content (mode = HELP_SEARCH_ALL ).

Parameters:
Return type:

bool



ReadCustomization(self, cfg, path="")

Reads the user’s settings for this window.

Parameters:


RefreshLists(self)

Refresh all panels.

This is necessary if a new book was added.



SetController(self, controller)
Parameters:controller (wx.html.HtmlHelpController) –


UseConfig(self, config, rootpath="")

Associates a Config object with the help window.

It is recommended that you use wx.html.HtmlHelpController.UseConfig instead.

Parameters:


WriteCustomization(self, cfg, path="")

Saves the user’s settings for this window.

Parameters:

Properties



Controller

See GetController and SetController



Data

See GetData