Class: Wx::HTML::HtmlHelpController
- Defined in:
- lib/wx/doc/gen/html/html_help_controller.rb,
lib/wx/doc/html/html_help_controller.rb
Overview
This help controller provides an easy way of displaying HTML help in your application (see page_samples_html, 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 page_samples_html contains sample project files. Note that the Microsoft's HTML Help Workshop (http://www.microsoft.com/downloads/details.aspx?FamilyID=00535334-c8a6-452f-9aa0-d597d16580cc) also runs on other platforms using WINE (http://www.winehq.org/) and it can be used to create the .hpp, .hhk and .hhc files through a friendly GUI. The commercial tool HelpBlocks (http://www.helpblocks.com) can also create these files.
Instance Method Summary collapse
- #add_book(*args) ⇒ Object
- #display(*args) ⇒ Object
-
#display_block(blockNo) ⇒ Boolean
If the help viewer is not running, runs it and displays the file at the given block number.
-
#display_contents ⇒ Boolean
If the help viewer is not running, runs it and displays the contents.
-
#display_context_popup(contextId) ⇒ Boolean
Displays the section as a popup window using a context id.
-
#display_index ⇒ Boolean
Displays help window and focuses index panel.
- #display_section(*args) ⇒ Object
-
#display_text_popup(text, pos) ⇒ Boolean
Displays the text in a popup window, if possible.
-
#get_frame_parameters ⇒ Array(Wx::Frame,Wx::Size,Wx::Point,Boolean)
Returns the latest frame size and position settings and whether a new frame is drawn with each invocation.
-
#get_help_window ⇒ Wx::HTML::HtmlHelpWindow
(also: #help_window)
Get the current help window.
-
#get_parent_window ⇒ Wx::Window
(also: #parent_window)
Returns the window to be used as the parent for the help window.
-
#init(file) ⇒ Boolean
Initializes the help instance with a help filename.
-
#initialize(*args) ⇒ HtmlHelpController
constructor
A new instance of HtmlHelpController.
-
#keyword_search(keyWord, mode = Wx::HelpSearchMode::HELP_SEARCH_ALL) ⇒ Boolean
If the help viewer is not running, runs it, and searches for sections matching the given keyword.
-
#load_file(file = ('')) ⇒ Boolean
If the help viewer is not running, runs it and loads the given file.
-
#on_quit ⇒ void
Overridable member called when this application's viewer is quit by the user.
-
#quit ⇒ Boolean
If the viewer is running, quits it by disconnecting.
-
#read_customization(cfg, path = ('')) ⇒ void
Reads the controller's setting (position of window, etc.).
-
#set_frame_parameters(titleFormat, size, pos = Wx::DEFAULT_POSITION, newFrameEachTime = false) ⇒ void
Set the parameters of the frame window.
-
#set_help_window(helpWindow) ⇒ void
(also: #help_window=)
Set the help window to be managed by this controller.
-
#set_parent_window(parentWindow) ⇒ void
(also: #parent_window=)
Sets the window to be used as the parent for the help window.
-
#set_should_prevent_app_exit(enable) ⇒ void
(also: #should_prevent_app_exit=)
Sets whether the help frame should prevent application from exiting if it's the only remaining top level window.
-
#set_temp_dir(path) ⇒ void
(also: #temp_dir=)
Sets the path for storing temporary files - cached binary versions of index and contents files.
-
#set_title_format(format) ⇒ void
(also: #title_format=)
Sets format of title of the frame.
-
#set_viewer(viewer, flags = Wx::HTML::HELP_NETSCAPE) ⇒ void
(also: #viewer=)
Sets detailed viewer information.
-
#use_config(config, rootpath = ('')) ⇒ void
Associates the config object with the controller.
-
#write_customization(cfg, path = ('')) ⇒ void
Stores controllers setting (position of window etc.).
Methods inherited from Object
#clone, #dup, #is_same_as, #un_share
Constructor Details
#initialize(style = Wx::HTML::HF_DEFAULT_STYLE, parentWindow = nil) ⇒ Wx::HTML::HtmlHelpController #initialize(parentWindow, style = Wx::HTML::HF_DEFAULT_STYLE) ⇒ Wx::HTML::HtmlHelpController
Returns a new instance of HtmlHelpController.
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
152 |
# File 'lib/wx/doc/gen/html/html_help_controller.rb', line 152 def add_book(*args) end |
#display(x) ⇒ Boolean #display(id) ⇒ Boolean
178 |
# File 'lib/wx/doc/gen/html/html_help_controller.rb', line 178 def display(*args) end |
#display_block(blockNo) ⇒ Boolean
If the help viewer is not running, runs it and displays the file at the given block number.
- WinHelp: Refers to the context number.
- MS HTML Help: Refers to the context number.
- External HTML help: the same as for #display_section.
- Wx::HTML::HtmlHelpController: sectionNo is an identifier as specified in the
.hhc file. See Help Files Format. DeprecatedThis function is for backward compatibility only, and applications should use #display_section instead.
253 |
# File 'lib/wx/doc/gen/html/html_help_controller.rb', line 253 def display_block(blockNo) end |
#display_contents ⇒ Boolean
If the help viewer is not running, runs it and displays the contents.
257 |
# File 'lib/wx/doc/gen/html/html_help_controller.rb', line 257 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.
264 |
# File 'lib/wx/doc/gen/html/html_help_controller.rb', line 264 def display_context_popup(contextId) end |
#display_index ⇒ Boolean
Displays help window and focuses index panel.
182 |
# File 'lib/wx/doc/gen/html/html_help_controller.rb', line 182 def display_index; end |
#display_section(section) ⇒ Boolean #display_section(sectionNo) ⇒ Boolean
281 |
# File 'lib/wx/doc/gen/html/html_help_controller.rb', line 281 def display_section(*args) end |
#display_text_popup(text, pos) ⇒ Boolean
Displays the text in a popup window, if possible.
Returns false if unsuccessful or not implemented.
289 |
# File 'lib/wx/doc/gen/html/html_help_controller.rb', line 289 def display_text_popup(text, pos) end |
#get_frame_parameters ⇒ Array(Wx::Frame,Wx::Size,Wx::Point,Boolean)
Returns the latest frame size and position settings and whether a new frame is drawn with each invocation.
16 |
# File 'lib/wx/doc/html/html_help_controller.rb', line 16 def get_frame_parameters; end |
#get_help_window ⇒ Wx::HTML::HtmlHelpWindow Also known as: help_window
Get the current help window.
233 |
# File 'lib/wx/doc/gen/html/html_help_controller.rb', line 233 def get_help_window; end |
#get_parent_window ⇒ Wx::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.
295 |
# File 'lib/wx/doc/gen/html/html_help_controller.rb', line 295 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.
304 |
# File 'lib/wx/doc/gen/html/html_help_controller.rb', line 304 def init(file) end |
#keyword_search(keyWord, mode = Wx::HelpSearchMode::HELP_SEARCH_ALL) ⇒ Boolean
If the help viewer is not running, runs it, and searches for sections matching the given keyword.
If one match is found, the file is displayed at this section. The optional parameter allows searching the index (Wx::HelpSearchMode::HELP_SEARCH_INDEX) but this currently is only supported by the Wx::HTML::HtmlHelpController.
- WinHelp, MS HTML Help: If more than one match is found, the first topic is displayed.
- MS HTML Help: Pass an empty string to display the search page.
- External HTML help, simple Wx::HTML help: If more than one match is found, a choice of topics is displayed.
- Wx::HTML::HtmlHelpController: see #keyword_search.
317 |
# File 'lib/wx/doc/gen/html/html_help_controller.rb', line 317 def keyword_search(keyWord, mode=Wx::HelpSearchMode::HELP_SEARCH_ALL) end |
#load_file(file = ('')) ⇒ Boolean
If the help viewer is not running, runs it and loads the given file.
If the filename is not supplied or is empty, the file specified in #initialize is used. If the viewer is already displaying the specified file, it will not be reloaded. This member function may be used before each display call in case the user has opened another file. Wx::HTML::HtmlHelpController ignores this call.
326 |
# File 'lib/wx/doc/gen/html/html_help_controller.rb', line 326 def load_file(file=('')) end |
#on_quit ⇒ void
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.
332 |
# File 'lib/wx/doc/gen/html/html_help_controller.rb', line 332 def on_quit; end |
#quit ⇒ Boolean
If the viewer is running, quits it by disconnecting.
For Windows Help, the viewer will only close if no other application is using it.
338 |
# File 'lib/wx/doc/gen/html/html_help_controller.rb', line 338 def quit; end |
#read_customization(cfg, path = ('')) ⇒ void
This method returns an undefined value.
Reads the controller's setting (position of window, etc.).
188 |
# File 'lib/wx/doc/gen/html/html_help_controller.rb', line 188 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.
350 |
# File 'lib/wx/doc/gen/html/html_help_controller.rb', line 350 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.
241 |
# File 'lib/wx/doc/gen/html/html_help_controller.rb', line 241 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.
357 |
# File 'lib/wx/doc/gen/html/html_help_controller.rb', line 357 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.
196 |
# File 'lib/wx/doc/gen/html/html_help_controller.rb', line 196 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.
205 |
# File 'lib/wx/doc/gen/html/html_help_controller.rb', line 205 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).
213 |
# File 'lib/wx/doc/gen/html/html_help_controller.rb', line 213 def set_title_format(format) end |
#set_viewer(viewer, flags = Wx::HTML::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
374 |
# File 'lib/wx/doc/gen/html/html_help_controller.rb', line 374 def set_viewer(viewer, flags=Wx::HTML::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).
223 |
# File 'lib/wx/doc/gen/html/html_help_controller.rb', line 223 def use_config(config, rootpath=('')) end |
#write_customization(cfg, path = ('')) ⇒ void
This method returns an undefined value.
Stores controllers setting (position of window etc.).
229 |
# File 'lib/wx/doc/gen/html/html_help_controller.rb', line 229 def write_customization(cfg, path=('')) end |