Sha256: 000733630d7b2e09d28907ed6626b471acf2bcd7a75a42fa1f8a3ae197a9530f

Contents?: true

Size: 789 Bytes

Versions: 35

Compression:

Stored size: 789 Bytes

Contents

# Pure-ruby implementation of the corresponding Wx class. Shows a
# relevant section of help, if available, or a native popup
require 'wx/classes/simplehelpprovider'
class Wx::HelpControllerHelpProvider < Wx::SimpleHelpProvider
  def initialize(help_controller)
    super()
    @hc = help_controller
  end

  # 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.
  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
end

Version data entries

35 entries across 35 versions & 3 rubygems

Version Path
wxruby64-2.0.1-x64-mingw32 lib/wx/classes/helpcontrollerhelpprovider.rb
wxruby-ruby19-2.0.1-x86-mingw32 lib/wx/classes/helpcontrollerhelpprovider.rb
wxruby-ruby19-2.0.1-x86-linux lib/wx/classes/helpcontrollerhelpprovider.rb
wxruby-ruby19-2.0.1-x86-darwin-9 lib/wx/classes/helpcontrollerhelpprovider.rb
wxruby-2.0.1-x86-mswin32-60 lib/wx/classes/helpcontrollerhelpprovider.rb
wxruby-2.0.1-x86-mingw32 lib/wx/classes/helpcontrollerhelpprovider.rb
wxruby-2.0.1-x86-linux lib/wx/classes/helpcontrollerhelpprovider.rb
wxruby-2.0.1-universal-darwin-9 lib/wx/classes/helpcontrollerhelpprovider.rb
wxruby-1.9.10-universal-darwin-9 lib/wx/classes/helpcontrollerhelpprovider.rb
wxruby-1.9.10-x86-linux lib/wx/classes/helpcontrollerhelpprovider.rb
wxruby-1.9.10-x86-mingw32 lib/wx/classes/helpcontrollerhelpprovider.rb
wxruby-1.9.10-x86_64-linux lib/wx/classes/helpcontrollerhelpprovider.rb
wxruby-1.9.10-x86-mswin32-60 lib/wx/classes/helpcontrollerhelpprovider.rb
wxruby-1.9.8-universal-darwin-9 lib/wx/classes/helpcontrollerhelpprovider.rb
wxruby-1.9.8-x86-linux lib/wx/classes/helpcontrollerhelpprovider.rb
wxruby-1.9.8-x86-mingw32 lib/wx/classes/helpcontrollerhelpprovider.rb
wxruby-1.9.8-x86-mswin32-60 lib/wx/classes/helpcontrollerhelpprovider.rb
wxruby-1.9.8-x86_64-linux lib/wx/classes/helpcontrollerhelpprovider.rb
wxruby-1.9.9-universal-darwin-9 lib/wx/classes/helpcontrollerhelpprovider.rb
wxruby-1.9.9-x86-mingw32 lib/wx/classes/helpcontrollerhelpprovider.rb