Class: Wx::HelpControllerHelpProvider

Inherits:
SimpleHelpProvider show all
Defined in:
lib/wx/classes/helpcontrollerhelpprovider.rb

Instance Method Summary collapse

Methods inherited from SimpleHelpProvider

#add_help, #get_help, #remove_help

Constructor Details

#initialize(help_controller) ⇒ HelpControllerHelpProvider

Returns a new instance of HelpControllerHelpProvider.



5
6
7
8
# File 'lib/wx/classes/helpcontrollerhelpprovider.rb', line 5

def initialize(help_controller)
  super()
  @hc = help_controller
end

Instance Method Details

#show_help(win) ⇒ Object

Show help for win; if the help text for win is a string with a single integer only, treats that as a section id for help and shows that, otherwise shows a popup (native-style on Windows) of the text.



13
14
15
16
17
18
19
20
21
22
# File 'lib/wx/classes/helpcontrollerhelpprovider.rb', line 13

def show_help(win)
  help_text = get_help(win)
  return false if help_text.empty?
  if help_text =~ /\A\d+\z/
    @hc.display_context_popup(help_text.to_i)
  else
    @hc.display_text_popup(help_text, Wx::get_mouse_position)
  end
  true
end