Sha256: 98031e7b7041a0bc282f4dc392a991594ce18a453b20c8d29c7182577a45d657

Contents?: true

Size: 1.23 KB

Versions: 41

Compression:

Stored size: 1.23 KB

Contents

module Redcar
  class ApplicationSWT
    class Speedbar
      class SliderItem
        def initialize(speedbar, composite, item)
          slider = Swt::Widgets::Slider.new(composite, Swt::SWT::HORIZONTAL)
          grid_data = Swt::Layout::GridData.new
          grid_data.grabExcessHorizontalSpace = true
          grid_data.horizontalAlignment = Swt::Layout::GridData::FILL
          slider.layout_data = grid_data
          slider.selection = item.value
          slider.maximum   = item.maximum   || 100
          slider.minimum   = item.minimum   || 0
          slider.increment = item.increment || 5
          slider.add_selection_listener do
            item.value = slider.selection
            speedbar.execute_listener_in_model(item, item.value)
          end
          [:minimum, :maximum, :increment, :enabled].each do |ivar|
            item.add_listener(:"changed_#{ivar}") do |new_value|
              speedbar.rescue_speedbar_errors { slider.send(:"#{ivar}=", new_value) }
            end
          end
          item.add_listener(:changed_value) do |new_value|
            speedbar.rescue_speedbar_errors { slider.selection = new_value }
          end
          speedbar.focussable_widgets << slider
        end
      end
    end
  end
end

Version data entries

41 entries across 41 versions & 2 rubygems

Version Path
redcar-dev-0.12.16dev-java plugins/application_swt/lib/application_swt/speedbar/slider_item.rb
redcar-dev-0.12.15dev-java plugins/application_swt/lib/application_swt/speedbar/slider_item.rb
redcar-dev-0.12.14dev-java plugins/application_swt/lib/application_swt/speedbar/slider_item.rb
redcar-dev-0.12.13dev-java plugins/application_swt/lib/application_swt/speedbar/slider_item.rb
redcar-dev-0.12.12dev-java plugins/application_swt/lib/application_swt/speedbar/slider_item.rb
redcar-dev-0.12.11dev-java plugins/application_swt/lib/application_swt/speedbar/slider_item.rb
redcar-dev-0.12.10dev-java plugins/application_swt/lib/application_swt/speedbar/slider_item.rb
redcar-dev-0.12.9dev-java plugins/application_swt/lib/application_swt/speedbar/slider_item.rb
redcar-dev-0.12.8dev-java plugins/application_swt/lib/application_swt/speedbar/slider_item.rb
redcar-dev-0.12.7dev-java plugins/application_swt/lib/application_swt/speedbar/slider_item.rb
redcar-dev-0.12.6dev-java plugins/application_swt/lib/application_swt/speedbar/slider_item.rb
redcar-dev-0.12.4dev-java plugins/application_swt/lib/application_swt/speedbar/slider_item.rb
redcar-dev-0.12.3dev-java plugins/application_swt/lib/application_swt/speedbar/slider_item.rb
redcar-dev-0.12.1dev-java plugins/application_swt/lib/application_swt/speedbar/slider_item.rb
redcar-dev-0.12.0dev-java plugins/application_swt/lib/application_swt/speedbar/slider_item.rb
redcar-0.11 plugins/application_swt/lib/application_swt/speedbar/slider_item.rb
redcar-0.11.0dev plugins/application_swt/lib/application_swt/speedbar/slider_item.rb
redcar-0.10 plugins/application_swt/lib/application_swt/speedbar/slider_item.rb
redcar-0.9.2 plugins/application_swt/lib/application_swt/speedbar/slider_item.rb
redcar-0.9.1 plugins/application_swt/lib/application_swt/speedbar/slider_item.rb