Class: Wx::HTML::HtmlHelpController

Inherits:
Object
  • Object
show all
Defined in:
lib/wx/doc/gen/html/html_help_controller.rb

Overview

This help controller provides an easy way of displaying HTML help in your application (see HTML Sample, test example).

The help system is based on books (see #add_book). A book is a logical section of documentation (for example “User’s Guide” or “Programmer’s Guide” or “C++ Reference” or “wxWidgets Reference”). The help controller can handle as many books as you want. Although this class has an API compatible with other wxWidgets help controllers as documented by Wx::HelpController, it is recommended that you use the enhanced capabilities of HtmlHelpController‘s API. Wx::HTML uses Microsoft’s HTML Help Workshop project files (.hhp, .hhk, .hhc) as its native format. The file format is described in Help Files Format. The directory helpfiles in the HTML Sample contains sample project files. Note that the Microsoft’s HTML Help Workshop (www.microsoft.com/downloads/details.aspx?FamilyID=00535334-c8a6-452f-9aa0-d597d16580cc) also runs on other platforms using WINE (www.winehq.org/) and it can be used to create the .hpp, .hhk and .hhc files through a friendly GUI. The commercial tool HelpBlocks (www.helpblocks.com) can also create these files.

Category: Wx::HELP, Wx::HTML

See Also:

  • wxBestHelpController
  • Wx::HtmlHelpFrame
  • Wx::HtmlHelpDialog
  • HtmlHelpWindow
  • Wx::HtmlModalHelp

Requires:

  • USE_HELP
  • USE_HTML

Instance Method Summary collapse

Methods inherited from Object

#clone, #dup, #is_same_as, #un_share

Constructor Details

#initialize(style = Wx::HF_DEFAULT_STYLE, parentWindow = nil) ⇒ Wx::HTML::HtmlHelpController #initialize(parentWindow, style = Wx::HF_DEFAULT_STYLE) ⇒ Wx::HTML::HtmlHelpController

Returns a new instance of HtmlHelpController.

Overloads:



130
# File 'lib/wx/doc/gen/html/html_help_controller.rb', line 130

def initialize(*args) end

Instance Method Details

#add_book(bookFile, showWaitMsg = false) ⇒ Boolean #add_book(bookUrl, showWaitMsg = false) ⇒ Boolean

Overloads:

  • #add_book(bookFile, showWaitMsg = false) ⇒ Boolean

    Adds a book (i.e.

    a .hhp file; an HTML Help Workshop project file) into the list of loaded books. This must be called at least once before displaying any help. bookFile or bookUrl may be either ".hhp" file or a ZIP archive that contains an arbitrary number of ".hhp" files in its top-level directory. This ZIP archive must have ".zip" or ".htb" extension (the latter stands for “HTML book”). In other words,

    add_book('help.zip')
    

    is possible and is the recommended way.

    Parameters:

    • bookFile (String)

      Help book filename. It is recommended to use this prototype instead of the one taking URL, because it is less error-prone.

    • showWaitMsg (Boolean) (defaults to: false)

      If true then a decoration-less window with progress message is displayed.

    Returns:

    • (Boolean)
  • #add_book(bookUrl, showWaitMsg = false) ⇒ Boolean

    Adds a book (i.e.

    a .hhp file; an HTML Help Workshop project file) into the list of loaded books. See the other overload for additional info.

    Parameters:

    • bookUrl (String)

      Help book URL (note that syntax of filename and URL is different on most platforms).

    • showWaitMsg (Boolean) (defaults to: false)

      If true then a decoration-less window with progress message is displayed.

    Returns:

    • (Boolean)


152
# File 'lib/wx/doc/gen/html/html_help_controller.rb', line 152

def add_book(*args) end

#display(x) ⇒ Boolean #display(id) ⇒ Boolean

Overloads:

  • #display(x) ⇒ Boolean

    Displays page x.

    This is THE important function - it is used to display the help in application. You can specify the page in many ways:

    • as direct filename of HTML document

    • as chapter name (from contents) or as a book name

    • as some word from index

    • even as any word (will be searched)

    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 named 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 …”)

    • switch to Search panel and start searching

    Parameters:

    • x (String)

    Returns:

    • (Boolean)
  • #display(id) ⇒ Boolean

    This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. This alternative form is used to search help contents by numeric IDs.

    Parameters:

    • id (Integer)

    Returns:

    • (Boolean)


178
# File 'lib/wx/doc/gen/html/html_help_controller.rb', line 178

def display(*args) end

#display_contentsBoolean

Displays help window and focuses contents panel.

Returns:

  • (Boolean)


182
# File 'lib/wx/doc/gen/html/html_help_controller.rb', line 182

def display_contents; end

#display_context_popup(contextId) ⇒ Boolean

Displays the section as a popup window using a context id.

Returns false if unsuccessful or not implemented.

Parameters:

  • contextId (Integer)

Returns:

  • (Boolean)


267
# File 'lib/wx/doc/gen/html/html_help_controller.rb', line 267

def display_context_popup(contextId) end

#display_indexBoolean

Displays help window and focuses index panel.

Returns:

  • (Boolean)


186
# File 'lib/wx/doc/gen/html/html_help_controller.rb', line 186

def display_index; end

#display_text_popup(text, pos) ⇒ Boolean

Displays the text in a popup window, if possible.

Returns false if unsuccessful or not implemented.

Parameters:

  • text (String)
  • pos (Array(Integer, Integer), Wx::Point)

Returns:

  • (Boolean)


275
# File 'lib/wx/doc/gen/html/html_help_controller.rb', line 275

def display_text_popup(text, pos) end

#get_help_windowWx::HTML::HtmlHelpWindow Also known as: help_window

Get the current help window.



251
# File 'lib/wx/doc/gen/html/html_help_controller.rb', line 251

def get_help_window; end

#get_parent_windowWx::Window Also known as: parent_window

Returns the window to be used as the parent for the help window.

This window is used by CHMHelpController, WinHelpController and Wx::HTML::HtmlHelpController.

Returns:



281
# File 'lib/wx/doc/gen/html/html_help_controller.rb', line 281

def get_parent_window; end

#init(file) ⇒ Boolean

Initializes the help instance with a help filename.

Does not invoke the help viewer. This must be called directly after the help instance object is created and before any attempts to communicate with the viewer. You may omit the file extension and a suitable one will be chosen. For Wx::HTML::HtmlHelpController, the extensions zip, htb and hhp will be appended while searching for a suitable file. For WinHelp, the hlp extension is appended.

Parameters:

  • file (String)

Returns:

  • (Boolean)


290
# File 'lib/wx/doc/gen/html/html_help_controller.rb', line 290

def init(file) end

#keyword_search(keyword, mode = Wx::HelpSearchMode::HELP_SEARCH_ALL) ⇒ Boolean

Displays the help window, focuses search panel and starts searching.

Returns true if the keyword was found. Optionally it searches through the index (mode = Wx::HelpSearchMode::HELP_SEARCH_INDEX), default the content (mode = Wx::HelpSearchMode::HELP_SEARCH_ALL).

Note:

#keyword_search searches only pages listed in ".hhc" file(s). You should list all pages in the contents file.

Parameters:

  • keyword (String)
  • mode (Wx::HelpSearchMode) (defaults to: Wx::HelpSearchMode::HELP_SEARCH_ALL)

Returns:

  • (Boolean)


200
# File 'lib/wx/doc/gen/html/html_help_controller.rb', line 200

def keyword_search(keyword, mode=Wx::HelpSearchMode::HELP_SEARCH_ALL) end

#on_quitvoid

This method returns an undefined value.

Overridable member called when this application’s viewer is quit by the user.

This does not work for all help controllers.



296
# File 'lib/wx/doc/gen/html/html_help_controller.rb', line 296

def on_quit; end

#read_customization(cfg, path = ('')) ⇒ void

This method returns an undefined value.

Reads the controller’s setting (position of window, etc.)

Parameters:



206
# File 'lib/wx/doc/gen/html/html_help_controller.rb', line 206

def read_customization(cfg, path=('')) end

#set_frame_parameters(titleFormat, size, pos = Wx::DEFAULT_POSITION, newFrameEachTime = false) ⇒ void

This method returns an undefined value.

Set the parameters of the frame window.

For Wx::HTML::HtmlHelpController, titleFormat specifies the title string format (with s being replaced by the actual page title) and size and position specify the geometry of the frame. For all other help controllers this function has no effect. Finally, newFrameEachTime is always ignored currently.

Parameters:

  • titleFormat (String)
  • size (Array(Integer, Integer), Wx::Size)
  • pos (Array(Integer, Integer), Wx::Point) (defaults to: Wx::DEFAULT_POSITION)
  • newFrameEachTime (Boolean) (defaults to: false)


308
# File 'lib/wx/doc/gen/html/html_help_controller.rb', line 308

def set_frame_parameters(titleFormat, size, pos=Wx::DEFAULT_POSITION, newFrameEachTime=false) end

#set_help_window(helpWindow) ⇒ void Also known as: help_window=

This method returns an undefined value.

Set the help window to be managed by this controller.

This makes it possible to have a help window that might not be in a Wx::HtmlHelpFrame or dialog but is embedded in some other window in the application. Be sure to use the Wx::HTML::HF_EMBEDDED style in this case.

Parameters:



259
# File 'lib/wx/doc/gen/html/html_help_controller.rb', line 259

def set_help_window(helpWindow) end

#set_parent_window(parentWindow) ⇒ void Also known as: parent_window=

This method returns an undefined value.

Sets the window to be used as the parent for the help window.

This is used by CHMHelpController, WinHelpController and Wx::HTML::HtmlHelpController.

Parameters:



315
# File 'lib/wx/doc/gen/html/html_help_controller.rb', line 315

def set_parent_window(parentWindow) end

#set_should_prevent_app_exit(enable) ⇒ void Also known as: should_prevent_app_exit=

This method returns an undefined value.

Sets whether the help frame should prevent application from exiting if it’s the only remaining top level window.

Parameters:

  • enable (Boolean)

    If true, the application will not quit unless the help frame is closed. Default is false, i.e. the application does exit if only the help window remains opened.

See Also:



214
# File 'lib/wx/doc/gen/html/html_help_controller.rb', line 214

def set_should_prevent_app_exit(enable) end

#set_temp_dir(path) ⇒ void Also known as: temp_dir=

This method returns an undefined value.

Sets the path for storing temporary files - cached binary versions of index and contents files.

These binary forms are much faster to read. Default value is empty string (empty string means that no cached data are stored). Note that these files are not deleted when program exits. Once created these cached files will be used in all subsequent executions of your application. If cached files become older than corresponding ".hhp" file (e.g. if you regenerate documentation) it will be refreshed.

Parameters:

  • path (String)


223
# File 'lib/wx/doc/gen/html/html_help_controller.rb', line 223

def set_temp_dir(path) end

#set_title_format(format) ⇒ void Also known as: title_format=

This method returns an undefined value.

Sets format of title of the frame.

Must contain exactly one “%s” (for title of displayed HTML page).

Parameters:

  • format (String)


231
# File 'lib/wx/doc/gen/html/html_help_controller.rb', line 231

def set_title_format(format) end

#set_viewer(viewer, flags = Wx::HELP_NETSCAPE) ⇒ void Also known as: viewer=

This method returns an undefined value.

Sets detailed viewer information.

So far this is only relevant to ExtHelpController. Some examples of usage:

@help.set_viewer('kdehelp')
  @help.set_viewer('gnome-help-browser')
  @help.set_viewer('netscape', Wx::HELP_NETSCAPE)

Todomodernize this function with LaunchDefaultBrowser

Parameters:



332
# File 'lib/wx/doc/gen/html/html_help_controller.rb', line 332

def set_viewer(viewer, flags=Wx::HELP_NETSCAPE) end

#use_config(config, rootpath = ('')) ⇒ void

This method returns an undefined value.

Associates the config object with the controller.

If there is associated config object, Wx::HTML::HtmlHelpController automatically reads and writes settings (including Wx::HTML::HtmlWindow‘s settings) when needed. The only thing you must do is create Config object and call #use_config. If you do not use #use_config, Wx::HTML::HtmlHelpController will use the default Config object if available (for details see ConfigBase::Get and ConfigBase::Set).

Parameters:



241
# File 'lib/wx/doc/gen/html/html_help_controller.rb', line 241

def use_config(config, rootpath=('')) end

#write_customization(cfg, path = ('')) ⇒ void

This method returns an undefined value.

Stores controllers setting (position of window etc.)

Parameters:



247
# File 'lib/wx/doc/gen/html/html_help_controller.rb', line 247

def write_customization(cfg, path=('')) end