# :stopdoc: # This file is automatically generated by the WXRuby3 documentation # generator. Do not alter this file. # :startdoc: module Wx # HELP_NETSCAPE = 1 # Help search modes for {Wx::HelpController#keyword_search}. # # # class HelpSearchMode < Wx::Enum # Search the index only. # HELP_SEARCH_INDEX = Wx::HelpSearchMode.new(0) # Search all entries. # HELP_SEARCH_ALL = Wx::HelpSearchMode.new(1) end # HelpSearchMode # This is an alias for one of a family of help controller classes which is most appropriate for the current platform. # A help controller allows an application to display help, at the contents or at a particular topic, and shut the help program down on termination. This avoids proliferation of many instances of the help viewer whenever the user requests a different topic via the application's menus or buttons. # Typically, an application will create a help controller instance when it starts, and immediately call {Wx::HelpController::Initialize} to associate a filename with it. The help viewer will only get run, however, just before the first call to display something. # Most help controller classes actually derive from {Wx::HelpControllerBase} and have names of the form {Wx::XXXHelpController} or {Wx::HelpControllerXXX}. An appropriate class is aliased to the name {Wx::HelpController} for each platform, as follows: # - On desktop Windows, {Wx::CHMHelpController} is used (MS HTML Help).- On all other platforms, {Wx::HTML::HtmlHelpController} is used if {Wx::HTML} is compiled into wxWidgets; otherwise {Wx::ExtHelpController} is used (for invoking an external browser). # # The remaining help controller classes need to be named explicitly by an application that wishes to make use of them. # The following help controller classes are defined: # - {Wx::WinHelpController}, for controlling Windows Help.- {Wx::CHMHelpController}, for controlling MS HTML Help. To use this, you need to set {Wx::Setup::USE_MS_HTML_HELP} to 1 in setup.h and have the htmlhelp.h header from Microsoft's HTML Help kit. (You don't need the VC++-specific htmlhelp.lib because wxWidgets loads necessary DLL at runtime and so it works with all compilers.)- {Wx::BestHelpController}, for controlling MS HTML Help or, if Microsoft's runtime is not available, {Wx::HTML::HtmlHelpController}. You need to provide both CHM and HTB versions of the help file. For {Wx::MSW} only.- {Wx::ExtHelpController}, for controlling external browsers under Unix. The default browser is Netscape Navigator. The 'help' sample shows its use.- {Wx::HTML::HtmlHelpController}, a sophisticated help controller using {Wx::HTML}, in a similar style to the Microsoft HTML Help viewer and using some of the same files. Although it has an API compatible with other help controllers, it has more advanced features, so it is recommended that you use the specific API for this class instead. Note that if you use .zip or .htb formats for your books, you must add this line to your application initialization: # # wxFileSystem::AddHandler(new wxArchiveFSHandler); # or nothing will be shown in your help window. # # === # # Category: {Wx::HELP} # @see Wx::HTML::HtmlHelpController # @see wxHTML Overview # # class HelpController < Object # Constructs a help instance object, but does not invoke the help viewer. # If you provide a window, it will be used by some help controller classes, such as {Wx::CHMHelpController}, {Wx::WinHelpController} and {Wx::HTML::HtmlHelpController}, as the parent for the help window instead of the value of {Wx::App#get_top_window}. # You can also change the parent window later with {Wx::HelpController#set_parent_window}. # @param parentWindow [Wx::Window] # @return [HelpController] def initialize(parentWindow=nil) end # If the help viewer is not running, runs it and displays the contents. # @return [true,false] def display_contents; end # Displays the section as a popup window using a context id. # Returns false if unsuccessful or not implemented. # @param contextId [Integer] # @return [true,false] def display_context_popup(contextId) end # Displays the text in a popup window, if possible. # Returns false if unsuccessful or not implemented. # @param text [String] # @param pos [Array(Integer, Integer), Wx::Point] # @return [true,false] def display_text_popup(text, pos) end # Returns the window to be used as the parent for the help window. # This window is used by {Wx::CHMHelpController}, {Wx::WinHelpController} and {Wx::HTML::HtmlHelpController}. # @return [Wx::Window] def get_parent_window; end alias_method :parent_window, :get_parent_window # 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. # @param file [String] # @return [true,false] def init(file) end # 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 {Wx::HTML::HtmlHelpController::KeywordSearch}. # @param keyWord [String] # @param mode [HelpSearchMode] # @return [true,false] def keyword_search(keyWord, mode=Wx::HelpSearchMode::HELP_SEARCH_ALL) end # Overridable member called when this application's viewer is quit by the user. # This does not work for all help controllers. # @return [void] def on_quit; end # 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. # @param titleFormat [String] # @param size [Array(Integer, Integer), Wx::Size] # @param pos [Array(Integer, Integer), Wx::Point] # @param newFrameEachTime [true,false] # @return [void] def set_frame_parameters(titleFormat, size, pos=Wx::DEFAULT_POSITION, newFrameEachTime=false) end # Sets the window to be used as the parent for the help window. # This is used by {Wx::CHMHelpController}, {Wx::WinHelpController} and {Wx::HTML::HtmlHelpController}. # @param parentWindow [Wx::Window] # @return [void] def set_parent_window(parentWindow) end alias_method :parent_window=, :set_parent_window # Sets detailed viewer information. # So far this is only relevant to {Wx::ExtHelpController}. Some examples of usage: # # m_help.SetViewer("kdehelp"); # m_help.SetViewer("gnome-help-browser"); # m_help.SetViewer("netscape", wxHELP_NETSCAPE); # # Todomodernize this function with {Wx::LaunchDefaultBrowser} # @param viewer [String] This defaults to "netscape" for {Wx::ExtHelpController}. # @param flags [Integer] This defaults to {Wx::HELP_NETSCAPE} for {Wx::ExtHelpController}, indicating that the viewer is a variant of Netscape Navigator. # @return [void] def set_viewer(viewer, flags=Wx::HELP_NETSCAPE) end alias_method :viewer=, :set_viewer end # HelpController end