Sha256: 85727f1da5a1ccbed0ae8a2185b507351f9851af2bc12d75c67ca5c5b550cefc

Contents?: true

Size: 653 Bytes

Versions: 38

Compression:

Stored size: 653 Bytes

Contents

require 'ostruct'

class FakeEvent
  def initialize(event_type, widget, options = {})
    untyped_event = Swt::Widgets::Event.new.tap do |e|
      e.display = Swt.display
      e.widget = widget
      e.x = options[:x] || 0
      e.y = options[:y] || 0
      e.button = options[:button] if options[:button]
    end
    widget.notify_listeners(event_type, untyped_event)
  end
end

class FakeKeyEvent
  def initialize(key_code, widget)
    event = Swt::Widgets::Event.new
    event.display = Swt.display
    event.widget  = widget
    event.type    = Swt::SWT::KeyDown
    event.keyCode = key_code

    widget.notify_listeners(event.type,event)
  end
end

Version data entries

38 entries across 38 versions & 2 rubygems

Version Path
redcar-0.13 plugins/application/features/support/fake_event.rb
redcar-dev-0.13.5dev plugins/application/features/support/fake_event.rb
redcar-dev-0.13.4dev plugins/application/features/support/fake_event.rb
redcar-dev-0.13.3dev plugins/application/features/support/fake_event.rb
redcar-dev-0.13.2dev plugins/application/features/support/fake_event.rb
redcar-dev-0.13.1dev plugins/application/features/support/fake_event.rb
redcar-0.12.1 plugins/application/features/support/fake_event.rb
redcar-dev-0.13.0dev plugins/application/features/support/fake_event.rb
redcar-0.12 plugins/application/features/support/fake_event.rb
redcar-dev-0.12.27dev plugins/application/features/support/fake_event.rb
redcar-dev-0.12.26dev plugins/application/features/support/fake_event.rb
redcar-dev-0.12.25dev plugins/application/features/support/fake_event.rb
redcar-dev-0.12.24dev plugins/application/features/support/fake_event.rb
redcar-dev-0.12.23dev plugins/application/features/support/fake_event.rb
redcar-dev-0.12.22dev plugins/application/features/support/fake_event.rb
redcar-dev-0.12.21dev plugins/application/features/support/fake_event.rb
redcar-dev-0.12.20dev plugins/application/features/support/fake_event.rb
redcar-dev-0.12.19dev plugins/application/features/support/fake_event.rb
redcar-dev-0.12.18dev plugins/application/features/support/fake_event.rb
redcar-dev-0.12.17dev plugins/application/features/support/fake_event.rb