Class: Scroll
- Inherits:
-
UnderOs::UI::View
- Object
- UnderOs::UI::View
- Scroll
- Defined in:
- lib/under_os/ui/scroll.rb
Constant Summary
Constants included from UnderOs::UI::Wrap
UnderOs::UI::Wrap::INSTANCES_CACHE, UnderOs::UI::Wrap::RAW_WRAPS_MAP, UnderOs::UI::Wrap::WRAPS_TAGS_MAP
Instance Method Summary collapse
- #contentSize ⇒ Object
- #contentSize=(*args) ⇒ Object
-
#initialize(options = {}) ⇒ Scroll
constructor
A new instance of Scroll.
- #paging ⇒ Object
- #paging=(value) ⇒ Object
- #repaint(*args) ⇒ Object
Methods inherited from UnderOs::UI::View
Methods included from UnderOs::UI::Manipulation
#append, #clear, #insert, #insertTo, #prepend, #remove
Methods included from UnderOs::UI::Traversing
#children, #empty?, #find, #first, #matches, #parent, #siblings
Methods included from UnderOs::UI::Dimensions
#position, #position=, #size, #size=
Methods included from UnderOs::UI::Animation
#animate, #fade_in, #fade_out, #highlight
Methods included from UnderOs::UI::Commons
#data, #data=, #hidden, #hide, #id, #id=, #page, #show, #tagName, #toggle, #visible
Methods included from UnderOs::UI::Styles
#addClass, #className, #className=, #classNames, #classNames=, #hasClass, #radioClass, #removeClass, #style, #style=, #toggleClass
Methods included from UnderOs::UI::Events
Methods included from UnderOs::UI::Wrap
Constructor Details
#initialize(options = {}) ⇒ Scroll
Returns a new instance of Scroll.
4 5 6 7 8 |
# File 'lib/under_os/ui/scroll.rb', line 4 def initialize(={}) super self.paging = .delete(:paging) end |
Instance Method Details
#contentSize ⇒ Object
19 20 21 |
# File 'lib/under_os/ui/scroll.rb', line 19 def contentSize UnderOs::Point.new(x: @_.contentSize.width, y: @_.contentSize.height) end |
#contentSize=(*args) ⇒ Object
23 24 25 26 |
# File 'lib/under_os/ui/scroll.rb', line 23 def contentSize=(*args) size = UnderOs::Point.new(*args) @_.contentSize = CGSizeMake(size.x, size.y) end |
#paging ⇒ Object
10 11 12 |
# File 'lib/under_os/ui/scroll.rb', line 10 def paging @paging == nil ? false : @paging end |
#paging=(value) ⇒ Object
14 15 16 17 |
# File 'lib/under_os/ui/scroll.rb', line 14 def paging=(value) @paging = value == true ? true : nil @_.pagingEnabled = paging end |
#repaint(*args) ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/under_os/ui/scroll.rb', line 28 def repaint(*args) content_size = {} super *args do |styles| styles.reject do |key, value| if [:contentWidth, :contentHeight].include?(key) content_size[key] = value end end end self.style = content_size unless content_size.empty? end |