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-0.13 plugins/application_swt/lib/application_swt/speedbar/slider_item.rb
redcar-dev-0.13.5dev plugins/application_swt/lib/application_swt/speedbar/slider_item.rb
redcar-dev-0.13.4dev plugins/application_swt/lib/application_swt/speedbar/slider_item.rb
redcar-dev-0.13.3dev plugins/application_swt/lib/application_swt/speedbar/slider_item.rb
redcar-dev-0.13.2dev plugins/application_swt/lib/application_swt/speedbar/slider_item.rb
redcar-dev-0.13.1dev plugins/application_swt/lib/application_swt/speedbar/slider_item.rb
redcar-0.12.1 plugins/application_swt/lib/application_swt/speedbar/slider_item.rb
redcar-dev-0.13.0dev plugins/application_swt/lib/application_swt/speedbar/slider_item.rb
redcar-0.12 plugins/application_swt/lib/application_swt/speedbar/slider_item.rb
redcar-dev-0.12.27dev plugins/application_swt/lib/application_swt/speedbar/slider_item.rb
redcar-dev-0.12.26dev plugins/application_swt/lib/application_swt/speedbar/slider_item.rb
redcar-dev-0.12.25dev plugins/application_swt/lib/application_swt/speedbar/slider_item.rb
redcar-dev-0.12.24dev plugins/application_swt/lib/application_swt/speedbar/slider_item.rb
redcar-dev-0.12.23dev plugins/application_swt/lib/application_swt/speedbar/slider_item.rb
redcar-dev-0.12.22dev plugins/application_swt/lib/application_swt/speedbar/slider_item.rb
redcar-dev-0.12.21dev plugins/application_swt/lib/application_swt/speedbar/slider_item.rb
redcar-dev-0.12.20dev plugins/application_swt/lib/application_swt/speedbar/slider_item.rb
redcar-dev-0.12.19dev plugins/application_swt/lib/application_swt/speedbar/slider_item.rb
redcar-dev-0.12.18dev plugins/application_swt/lib/application_swt/speedbar/slider_item.rb
redcar-dev-0.12.17dev plugins/application_swt/lib/application_swt/speedbar/slider_item.rb