module UnderOs::UI::Commons

Public Instance Methods

data(key=nil) click to toggle source
# File lib/under_os/ui/utils/commons.rb, line 28
def data(key=nil)
  key && @_data ? @_data[key.to_sym] : @_data
end
data=(hash) click to toggle source
# File lib/under_os/ui/utils/commons.rb, line 32
def data=(hash)
  @_data = hash
end
hidden() click to toggle source
# File lib/under_os/ui/utils/commons.rb, line 60
def hidden
  @_.isHidden
end
Also aliased as: hidden?
hidden?()
Alias for: hidden
hide() click to toggle source
# File lib/under_os/ui/utils/commons.rb, line 48
def hide
  style.display = :none
end
id() click to toggle source
# File lib/under_os/ui/utils/commons.rb, line 2
def id
  @_id
end
id=(id) click to toggle source
# File lib/under_os/ui/utils/commons.rb, line 6
def id=(id)
  @_id = id
end
page() click to toggle source
# File lib/under_os/ui/utils/commons.rb, line 36
def page
  resp = @_

  while resp = resp.nextResponder
    if resp.is_a?(UIViewController)
      return resp.wrapper
    end
  end

  nil
end
show() click to toggle source
# File lib/under_os/ui/utils/commons.rb, line 52
def show
  style.display = :block
end
tagName() click to toggle source
# File lib/under_os/ui/utils/commons.rb, line 10
def tagName
  @_tag_name ||= begin
    wraps = UnderOs::UI::Wrap::WRAPS_TAGS_MAP
    klass = self.class; tag = 'VIEW'

    while klass
      if wrap = wraps.detect{|t,k| k == klass}
        tag = wrap[0].upcase
        break
      else
        klass = klass.superclass
      end
    end

    tag
  end
end
toggle() click to toggle source
# File lib/under_os/ui/utils/commons.rb, line 56
def toggle
  hidden ? show : hide
end
visible() click to toggle source
# File lib/under_os/ui/utils/commons.rb, line 64
def visible
  !hidden
end
Also aliased as: visible?
visible?()
Alias for: visible