Class: Wx::HTML::HtmlHelpController
- 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.
Instance Method Summary collapse
- #add_book(*args) ⇒ Object
- #display(*args) ⇒ Object
-
#display_contents ⇒ Boolean
Displays help window and focuses contents panel.
-
#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_text_popup(text, pos) ⇒ Boolean
Displays the text in a popup window, if possible.
-
#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
Displays the help window, focuses search panel and starts searching.
-
#on_quit ⇒ void
Overridable member called when this application’s viewer is quit by the user.
-
#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::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::HF_DEFAULT_STYLE, parentWindow = nil) ⇒ Wx::HTML::HtmlHelpController #initialize(parentWindow, style = Wx::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_contents ⇒ Boolean
Displays help window and focuses contents panel.
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.
267 |
# File 'lib/wx/doc/gen/html/html_help_controller.rb', line 267 def display_context_popup(contextId) end |
#display_index ⇒ Boolean
Displays help window and focuses index panel.
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.
275 |
# File 'lib/wx/doc/gen/html/html_help_controller.rb', line 275 def display_text_popup(text, pos) end |
#get_help_window ⇒ Wx::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_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.
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.
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).
#keyword_search searches only pages listed in ".hhc"
file(s). You should list all pages in the contents file.
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_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.
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.)
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.
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.
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.
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.
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.
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).
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
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).
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.)
247 |
# File 'lib/wx/doc/gen/html/html_help_controller.rb', line 247 def write_customization(cfg, path=('')) end |