Sha256: 310f026ec2ac9689b19a8e7d230029d78c75628230411329d7cf9d290d42b595

Contents?: true

Size: 790 Bytes

Versions: 9

Compression:

Stored size: 790 Bytes

Contents

# Pure-ruby implementation of the corresponding Wx class. Shows a
# relevant section of help, if available, or a native popup
require_relative './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

9 entries across 9 versions & 1 rubygems

Version Path
wxruby3-0.9.0.pre.rc.3 lib/wx/core/helpcontrollerhelpprovider.rb
wxruby3-0.9.0.pre.rc.2 lib/wx/core/helpcontrollerhelpprovider.rb
wxruby3-0.9.0.pre.rc.1 lib/wx/core/helpcontrollerhelpprovider.rb
wxruby3-0.9.0.pre.beta.14 lib/wx/core/helpcontrollerhelpprovider.rb
wxruby3-0.9.0.pre.beta.13 lib/wx/core/helpcontrollerhelpprovider.rb
wxruby3-0.9.0.pre.beta.11 lib/wx/core/helpcontrollerhelpprovider.rb
wxruby3-0.9.0.pre.beta.10 lib/wx/core/helpcontrollerhelpprovider.rb
wxruby3-0.9.0.pre.beta.9 lib/wx/core/helpcontrollerhelpprovider.rb
wxruby3-0.9.0.pre.beta.8 lib/wx/core/helpcontrollerhelpprovider.rb