lib/sugarcube/symbol.rb in sugarcube-0.2.2 vs lib/sugarcube/symbol.rb in sugarcube-0.2.3
- old
+ new
@@ -31,10 +31,11 @@
attr_accessor :bordertypes
attr_accessor :controlstates
attr_accessor :controlevents
attr_accessor :system_fonts
attr_accessor :font_sizes
+ attr_accessor :returnkeys
end
@devices = {
iphone: UIUserInterfaceIdiomPhone,
ipad: UIUserInterfaceIdiomPad,
@@ -120,10 +121,24 @@
button: :buttonFontSize,
small: :smallSystemFontSize,
system: :systemFontSize,
}
+ @returnkeys = {
+ default: UIReturnKeyDefault,
+ go: UIReturnKeyGo,
+ google: UIReturnKeyGoogle,
+ join: UIReturnKeyJoin,
+ next: UIReturnKeyNext,
+ route: UIReturnKeyRoute,
+ search: UIReturnKeySearch,
+ send: UIReturnKeySend,
+ yahoo: UIReturnKeyYahoo,
+ done: UIReturnKeyDone,
+ emergencycall: UIReturnKeyEmergencyCall,
+ }
+
private
def look_in(here)
return here[self] if here.has_key? self
raise SugarNotFoundException.new(self)
end
@@ -157,9 +172,13 @@
look_in(Symbol.controlstates)
end
def uicontrolevent
look_in(Symbol.controlevents)
+ end
+
+ def uireturnkey
+ look_in(Symbol.returnkeys)
end
def uifont(size=UIFont.systemFontSize)
# system fonts
begin