Class: UnderOs::UI::Slider

Inherits:
Input show all
Defined in:
lib/under_os/ui/slider.rb

Constant Summary

Constants inherited from Input

Input::KEYBOARDS

Constants included from Wrap

Wrap::INSTANCES_CACHE, Wrap::RAW_WRAPS_MAP, Wrap::WRAPS_TAGS_MAP

Instance Method Summary collapse

Methods inherited from Input

#blur, #disable, #disabled, #disabled=, #enable, #focus, #hide_keyboard, #keyboard, #keyboard=, #name, #name=, #placeholder, #placeholder=, #textFieldShouldReturn, #type, #type=

Methods inherited from View

#inspect

Methods included from Manipulation

#append, #clear, #insert, #insertTo, #prepend, #remove

Methods included from Traversing

#children, #empty?, #find, #first, #matches, #parent, #siblings

Methods included from Dimensions

#position, #position=, #size, #size=

Methods included from Animation

#animate, #fade_in, #fade_out, #highlight

Methods included from Commons

#data, #data=, #hidden, #hide, #id, #id=, #page, #show, #tagName, #toggle, #visible

Methods included from Styles

#addClass, #className, #className=, #classNames, #classNames=, #hasClass, #radioClass, #removeClass, #repaint, #style, #style=, #toggleClass

Methods included from Events

#emit, #off, #on, #on=

Methods included from Wrap

included

Constructor Details

#initialize(options = {}) ⇒ Slider

Returns a new instance of Slider.



4
5
6
7
8
9
10
11
12
# File 'lib/under_os/ui/slider.rb', line 4

def initialize(options={})
  super

  self.min   = options[:min]   if options[:min]
  self.max   = options[:max]   if options[:max]

  @_.continuous = options.delete(:track) || true # track the changes as they go
  @_.addTarget self, action: :handle_change, forControlEvents:UIControlEventValueChanged
end

Instance Method Details

#maxObject



30
31
32
# File 'lib/under_os/ui/slider.rb', line 30

def max
  @_.maximumValue
end

#max=(value) ⇒ Object



34
35
36
# File 'lib/under_os/ui/slider.rb', line 34

def max=(value)
  @_.maximumValue = value.to_f
end

#minObject



22
23
24
# File 'lib/under_os/ui/slider.rb', line 22

def min
  @_.minimumValue
end

#min=(value) ⇒ Object



26
27
28
# File 'lib/under_os/ui/slider.rb', line 26

def min=(value)
  @_.minimumValue = value.to_f
end

#valueObject



14
15
16
# File 'lib/under_os/ui/slider.rb', line 14

def value
  @_.value
end

#value=(value) ⇒ Object



18
19
20
# File 'lib/under_os/ui/slider.rb', line 18

def value=(value)
  @_.value = value.to_f
end