Sha256: ee3f698259cefa004d5303f3e1d99b8d785589716e935861c47eb693ddb37a10

Contents?: true

Size: 1010 Bytes

Versions: 16

Compression:

Stored size: 1010 Bytes

Contents

# Copyright (c) 2023 M.J.N. Corino, The Netherlands
#
# This software is released under the MIT license.
# 
# Some parts are
# Copyright 2004-2007, wxRuby development team
# released under the MIT-like wxRuby2 license

# 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

16 entries across 16 versions & 1 rubygems

Version Path
wxruby3-1.3.1 lib/wx/core/helpcontrollerhelpprovider.rb
wxruby3-1.3.0 lib/wx/core/helpcontrollerhelpprovider.rb
wxruby3-1.2.1 lib/wx/core/helpcontrollerhelpprovider.rb
wxruby3-1.2.0 lib/wx/core/helpcontrollerhelpprovider.rb
wxruby3-1.1.2 lib/wx/core/helpcontrollerhelpprovider.rb
wxruby3-1.1.1 lib/wx/core/helpcontrollerhelpprovider.rb
wxruby3-1.1.0 lib/wx/core/helpcontrollerhelpprovider.rb
wxruby3-1.0.1 lib/wx/core/helpcontrollerhelpprovider.rb
wxruby3-0.9.8 lib/wx/core/helpcontrollerhelpprovider.rb
wxruby3-0.9.7 lib/wx/core/helpcontrollerhelpprovider.rb
wxruby3-0.9.5 lib/wx/core/helpcontrollerhelpprovider.rb
wxruby3-0.9.4 lib/wx/core/helpcontrollerhelpprovider.rb
wxruby3-0.9.3 lib/wx/core/helpcontrollerhelpprovider.rb
wxruby3-0.9.2 lib/wx/core/helpcontrollerhelpprovider.rb
wxruby3-0.9.1 lib/wx/core/helpcontrollerhelpprovider.rb
wxruby3-0.9.0 lib/wx/core/helpcontrollerhelpprovider.rb