Class: Symbol

Inherits:
Object show all
Defined in:
lib/osx/sugarcube-ui/symbol.rb,
lib/ios/sugarcube-ui/symbol.rb,
lib/all/sugarcube-unholy/ivar.rb,
lib/osx/sugarcube-color/symbol.rb,
lib/ios/sugarcube-color/symbol.rb,
lib/ios/sugarcube-constants/symbol.rb,
lib/osx/sugarcube-constants/symbol.rb,
lib/cocoa/sugarcube-awesome/awesome_exts.rb

Overview

Adds constant lookups to the Symbol class. These methods are prefixed with ns to make their intent clear, and to provide a little bit of "namespacing"

# alignment
:left.nsalignment => NSLeftTextAlignment

# nscolors
:black.nscolor => NSColor.blackColor

You can extend the defaults by adding entries:

Symbol.css_colors[:my_color] = 0x123456

:my_color.nscolor => NSColor

Class Attribute Summary collapse

Instance Method Summary collapse

Class Attribute Details

.catimingfunctionObject (readonly)

Returns the value of attribute catimingfunction



319
320
321
# File 'lib/ios/sugarcube-constants/symbol.rb', line 319

def catimingfunction
  @catimingfunction
end

.catimingfunction__deprecatedObject (readonly)

Returns the value of attribute catimingfunction__deprecated



320
321
322
# File 'lib/ios/sugarcube-constants/symbol.rb', line 320

def catimingfunction__deprecated
  @catimingfunction__deprecated
end

.cglinecapObject (readonly)

Returns the value of attribute cglinecap



322
323
324
# File 'lib/ios/sugarcube-constants/symbol.rb', line 322

def cglinecap
  @cglinecap
end

.cglinejoinObject (readonly)

Returns the value of attribute cglinejoin



323
324
325
# File 'lib/ios/sugarcube-constants/symbol.rb', line 323

def cglinejoin
  @cglinejoin
end

.css_colorsObject (readonly)

Returns the value of attribute css_colors



4
5
6
# File 'lib/osx/sugarcube-color/symbol.rb', line 4

def css_colors
  @css_colors
end

.css_colors_cacheObject (readonly)

Returns the value of attribute css_colors_cache



5
6
7
# File 'lib/osx/sugarcube-color/symbol.rb', line 5

def css_colors_cache
  @css_colors_cache
end

.nsautoresizingmaskObject (readonly)

Returns the value of attribute nsautoresizingmask



72
73
74
# File 'lib/osx/sugarcube-constants/symbol.rb', line 72

def nsautoresizingmask
  @nsautoresizingmask
end

.nsbezelstyleObject (readonly)

Returns the value of attribute nsbezelstyle



77
78
79
# File 'lib/osx/sugarcube-constants/symbol.rb', line 77

def nsbezelstyle
  @nsbezelstyle
end

.nsbuttontypeObject (readonly)

Returns the value of attribute nsbuttontype



76
77
78
# File 'lib/osx/sugarcube-constants/symbol.rb', line 76

def nsbuttontype
  @nsbuttontype
end

.nscolorsObject (readonly)

Returns the value of attribute nscolors



3
4
5
# File 'lib/osx/sugarcube-color/symbol.rb', line 3

def nscolors
  @nscolors
end

.nsdatestyleObject (readonly)

Returns the value of attribute nsdatestyle



271
272
273
# File 'lib/ios/sugarcube-constants/symbol.rb', line 271

def nsdatestyle
  @nsdatestyle
end

.nsfocusringtypeObject (readonly)

Returns the value of attribute nsfocusringtype



78
79
80
# File 'lib/osx/sugarcube-constants/symbol.rb', line 78

def nsfocusringtype
  @nsfocusringtype
end

.nsfontObject (readonly)

Returns the value of attribute nsfont



48
49
50
# File 'lib/osx/sugarcube-ui/symbol.rb', line 48

def nsfont
  @nsfont
end

.nsfontsizeObject (readonly)

Returns the value of attribute nsfontsize



49
50
51
# File 'lib/osx/sugarcube-ui/symbol.rb', line 49

def nsfontsize
  @nsfontsize
end

.nslinebreakmodeObject (readonly)

Returns the value of attribute nslinebreakmode



267
268
269
# File 'lib/ios/sugarcube-constants/symbol.rb', line 267

def nslinebreakmode
  @nslinebreakmode
end

.nsnumberstyleObject (readonly)

Returns the value of attribute nsnumberstyle



272
273
274
# File 'lib/ios/sugarcube-constants/symbol.rb', line 272

def nsnumberstyle
  @nsnumberstyle
end

.nsnumberstyle__deprecatedObject (readonly)

Returns the value of attribute nsnumberstyle__deprecated



273
274
275
# File 'lib/ios/sugarcube-constants/symbol.rb', line 273

def nsnumberstyle__deprecated
  @nsnumberstyle__deprecated
end

.nstextalignmentObject (readonly)

Returns the value of attribute nstextalignment



266
267
268
# File 'lib/ios/sugarcube-constants/symbol.rb', line 266

def nstextalignment
  @nstextalignment
end

.presentationstyleObject (readonly)

Returns the value of attribute presentationstyle



305
306
307
# File 'lib/ios/sugarcube-constants/symbol.rb', line 305

def presentationstyle
  @presentationstyle
end

.transitionstyleObject (readonly)

Returns the value of attribute transitionstyle



306
307
308
# File 'lib/ios/sugarcube-constants/symbol.rb', line 306

def transitionstyle
  @transitionstyle
end

.uiactionstyleObject (readonly)

Returns the value of attribute uiactionstyle



309
310
311
# File 'lib/ios/sugarcube-constants/symbol.rb', line 309

def uiactionstyle
  @uiactionstyle
end

.uiactivityindicatorstyleObject (readonly)

Returns the value of attribute uiactivityindicatorstyle



286
287
288
# File 'lib/ios/sugarcube-constants/symbol.rb', line 286

def uiactivityindicatorstyle
  @uiactivityindicatorstyle
end

.uiactivityindicatorstyle__deprecatedObject (readonly)

Returns the value of attribute uiactivityindicatorstyle__deprecated



287
288
289
# File 'lib/ios/sugarcube-constants/symbol.rb', line 287

def uiactivityindicatorstyle__deprecated
  @uiactivityindicatorstyle__deprecated
end

.uialertactionstyleObject (readonly)

Returns the value of attribute uialertactionstyle



312
313
314
# File 'lib/ios/sugarcube-constants/symbol.rb', line 312

def uialertactionstyle
  @uialertactionstyle
end

.uialertcontrollerstyleObject (readonly)

Returns the value of attribute uialertcontrollerstyle



311
312
313
# File 'lib/ios/sugarcube-constants/symbol.rb', line 311

def uialertcontrollerstyle
  @uialertcontrollerstyle
end

.uialertstyleObject (readonly)

Returns the value of attribute uialertstyle



308
309
310
# File 'lib/ios/sugarcube-constants/symbol.rb', line 308

def uialertstyle
  @uialertstyle
end

.uianimationcurveObject (readonly)

Returns the value of attribute uianimationcurve



293
294
295
# File 'lib/ios/sugarcube-constants/symbol.rb', line 293

def uianimationcurve
  @uianimationcurve
end

.uianimationoptionObject (readonly)

Returns the value of attribute uianimationoption



294
295
296
# File 'lib/ios/sugarcube-constants/symbol.rb', line 294

def uianimationoption
  @uianimationoption
end

.uiautoresizemaskObject (readonly)

Returns the value of attribute uiautoresizemask



258
259
260
# File 'lib/ios/sugarcube-constants/symbol.rb', line 258

def uiautoresizemask
  @uiautoresizemask
end

.uiautoresizemask__deprecatedObject (readonly)

Returns the value of attribute uiautoresizemask__deprecated



259
260
261
# File 'lib/ios/sugarcube-constants/symbol.rb', line 259

def uiautoresizemask__deprecated
  @uiautoresizemask__deprecated
end

.uibarbuttonitemObject (readonly)

Returns the value of attribute uibarbuttonitem



277
278
279
# File 'lib/ios/sugarcube-constants/symbol.rb', line 277

def uibarbuttonitem
  @uibarbuttonitem
end

.uibarbuttonitem__deprecatedObject (readonly)

Returns the value of attribute uibarbuttonitem__deprecated



278
279
280
# File 'lib/ios/sugarcube-constants/symbol.rb', line 278

def uibarbuttonitem__deprecated
  @uibarbuttonitem__deprecated
end

.uibarbuttonstyleObject (readonly)

Returns the value of attribute uibarbuttonstyle



279
280
281
# File 'lib/ios/sugarcube-constants/symbol.rb', line 279

def uibarbuttonstyle
  @uibarbuttonstyle
end

.uibarmetricsObject (readonly)

Returns the value of attribute uibarmetrics



276
277
278
# File 'lib/ios/sugarcube-constants/symbol.rb', line 276

def uibarmetrics
  @uibarmetrics
end

.uibaselineadjustmentObject (readonly)

Returns the value of attribute uibaselineadjustment



269
270
271
# File 'lib/ios/sugarcube-constants/symbol.rb', line 269

def uibaselineadjustment
  @uibaselineadjustment
end

.uibaselineadjustment__deprecatedObject (readonly)

Returns the value of attribute uibaselineadjustment__deprecated



268
269
270
# File 'lib/ios/sugarcube-constants/symbol.rb', line 268

def uibaselineadjustment__deprecated
  @uibaselineadjustment__deprecated
end

.uibordertypeObject (readonly)

Returns the value of attribute uibordertype



270
271
272
# File 'lib/ios/sugarcube-constants/symbol.rb', line 270

def uibordertype
  @uibordertype
end

.uibuttontypeObject (readonly)

Returns the value of attribute uibuttontype



282
283
284
# File 'lib/ios/sugarcube-constants/symbol.rb', line 282

def uibuttontype
  @uibuttontype
end

.uicolorsObject (readonly)

Returns the value of attribute uicolors



3
4
5
# File 'lib/ios/sugarcube-color/symbol.rb', line 3

def uicolors
  @uicolors
end

.uicolors__deprecatedObject (readonly)

Returns the value of attribute uicolors__deprecated



4
5
6
# File 'lib/ios/sugarcube-color/symbol.rb', line 4

def uicolors__deprecated
  @uicolors__deprecated
end

.uicontentmodeObject (readonly)

Returns the value of attribute uicontentmode



291
292
293
# File 'lib/ios/sugarcube-constants/symbol.rb', line 291

def uicontentmode
  @uicontentmode
end

.uicontentmode__deprecatedObject (readonly)

Returns the value of attribute uicontentmode__deprecated



292
293
294
# File 'lib/ios/sugarcube-constants/symbol.rb', line 292

def uicontentmode__deprecated
  @uicontentmode__deprecated
end

.uicontroleventObject (readonly)

Returns the value of attribute uicontrolevent



284
285
286
# File 'lib/ios/sugarcube-constants/symbol.rb', line 284

def uicontrolevent
  @uicontrolevent
end

.uicontrolevent__deprecatedObject (readonly)

Returns the value of attribute uicontrolevent__deprecated



285
286
287
# File 'lib/ios/sugarcube-constants/symbol.rb', line 285

def uicontrolevent__deprecated
  @uicontrolevent__deprecated
end

.uicontrolstateObject (readonly)

Returns the value of attribute uicontrolstate



283
284
285
# File 'lib/ios/sugarcube-constants/symbol.rb', line 283

def uicontrolstate
  @uicontrolstate
end

.uidatepickermodeObject (readonly)

Returns the value of attribute uidatepickermode



289
290
291
# File 'lib/ios/sugarcube-constants/symbol.rb', line 289

def uidatepickermode
  @uidatepickermode
end

.uidatepickermode__deprecatedObject (readonly)

Returns the value of attribute uidatepickermode__deprecated



290
291
292
# File 'lib/ios/sugarcube-constants/symbol.rb', line 290

def uidatepickermode__deprecated
  @uidatepickermode__deprecated
end

.uideviceObject (readonly)

Returns the value of attribute uidevice



254
255
256
# File 'lib/ios/sugarcube-constants/symbol.rb', line 254

def uidevice
  @uidevice
end

.uideviceorientationObject (readonly)

Returns the value of attribute uideviceorientation



255
256
257
# File 'lib/ios/sugarcube-constants/symbol.rb', line 255

def uideviceorientation
  @uideviceorientation
end

.uifontObject (readonly)

Returns the value of attribute uifont



48
49
50
# File 'lib/ios/sugarcube-ui/symbol.rb', line 48

def uifont
  @uifont
end

.uifontsizeObject (readonly)

Returns the value of attribute uifontsize



49
50
51
# File 'lib/ios/sugarcube-ui/symbol.rb', line 49

def uifontsize
  @uifontsize
end

.uigesturerecognizerstateObject (readonly)

Returns the value of attribute uigesturerecognizerstate



325
326
327
# File 'lib/ios/sugarcube-constants/symbol.rb', line 325

def uigesturerecognizerstate
  @uigesturerecognizerstate
end

.uiimagecameraObject (readonly)

Returns the value of attribute uiimagecamera



316
317
318
# File 'lib/ios/sugarcube-constants/symbol.rb', line 316

def uiimagecamera
  @uiimagecamera
end

.uiimagecaptureObject (readonly)

Returns the value of attribute uiimagecapture



315
316
317
# File 'lib/ios/sugarcube-constants/symbol.rb', line 315

def uiimagecapture
  @uiimagecapture
end

.uiimagequalityObject (readonly)

Returns the value of attribute uiimagequality



317
318
319
# File 'lib/ios/sugarcube-constants/symbol.rb', line 317

def uiimagequality
  @uiimagequality
end

.uiimagesourceObject (readonly)

Returns the value of attribute uiimagesource



314
315
316
# File 'lib/ios/sugarcube-constants/symbol.rb', line 314

def uiimagesource
  @uiimagesource
end

.uiinterfacemaskObject (readonly)

Returns the value of attribute uiinterfacemask



257
258
259
# File 'lib/ios/sugarcube-constants/symbol.rb', line 257

def uiinterfacemask
  @uiinterfacemask
end

.uiinterfaceorientationObject (readonly)

Returns the value of attribute uiinterfaceorientation



256
257
258
# File 'lib/ios/sugarcube-constants/symbol.rb', line 256

def uiinterfaceorientation
  @uiinterfaceorientation
end

.uikeyboardtypeObject (readonly)

Returns the value of attribute uikeyboardtype



263
264
265
# File 'lib/ios/sugarcube-constants/symbol.rb', line 263

def uikeyboardtype
  @uikeyboardtype
end

.uikeyboardtype__deprecatedObject (readonly)

Returns the value of attribute uikeyboardtype__deprecated



264
265
266
# File 'lib/ios/sugarcube-constants/symbol.rb', line 264

def uikeyboardtype__deprecated
  @uikeyboardtype__deprecated
end

.uireturnkeyObject (readonly)

Returns the value of attribute uireturnkey



261
262
263
# File 'lib/ios/sugarcube-constants/symbol.rb', line 261

def uireturnkey
  @uireturnkey
end

.uireturnkey__deprecatedObject (readonly)

Returns the value of attribute uireturnkey__deprecated



262
263
264
# File 'lib/ios/sugarcube-constants/symbol.rb', line 262

def uireturnkey__deprecated
  @uireturnkey__deprecated
end

.uisegmentedstyleObject (readonly)

Returns the value of attribute uisegmentedstyle



288
289
290
# File 'lib/ios/sugarcube-constants/symbol.rb', line 288

def uisegmentedstyle
  @uisegmentedstyle
end

.uistatusbarstyleObject (readonly)

Returns the value of attribute uistatusbarstyle



275
276
277
# File 'lib/ios/sugarcube-constants/symbol.rb', line 275

def uistatusbarstyle
  @uistatusbarstyle
end

.uitabbarsystemitemObject (readonly)

Returns the value of attribute uitabbarsystemitem



280
281
282
# File 'lib/ios/sugarcube-constants/symbol.rb', line 280

def uitabbarsystemitem
  @uitabbarsystemitem
end

.uitablecellaccessorytypeObject (readonly)

Returns the value of attribute uitablecellaccessorytype



299
300
301
# File 'lib/ios/sugarcube-constants/symbol.rb', line 299

def uitablecellaccessorytype
  @uitablecellaccessorytype
end

.uitablecellaccessorytype__deprecatedObject (readonly)

Returns the value of attribute uitablecellaccessorytype__deprecated



300
301
302
# File 'lib/ios/sugarcube-constants/symbol.rb', line 300

def uitablecellaccessorytype__deprecated
  @uitablecellaccessorytype__deprecated
end

.uitablecellselectionstyleObject (readonly)

Returns the value of attribute uitablecellselectionstyle



301
302
303
# File 'lib/ios/sugarcube-constants/symbol.rb', line 301

def uitablecellselectionstyle
  @uitablecellselectionstyle
end

.uitablecellseparatorstyleObject (readonly)

Returns the value of attribute uitablecellseparatorstyle



302
303
304
# File 'lib/ios/sugarcube-constants/symbol.rb', line 302

def uitablecellseparatorstyle
  @uitablecellseparatorstyle
end

.uitablecellseparatorstyle__deprecatedObject (readonly)

Returns the value of attribute uitablecellseparatorstyle__deprecated



303
304
305
# File 'lib/ios/sugarcube-constants/symbol.rb', line 303

def uitablecellseparatorstyle__deprecated
  @uitablecellseparatorstyle__deprecated
end

.uitablecellstyleObject (readonly)

Returns the value of attribute uitablecellstyle



298
299
300
# File 'lib/ios/sugarcube-constants/symbol.rb', line 298

def uitablecellstyle
  @uitablecellstyle
end

.uitablerowanimationObject (readonly)

Returns the value of attribute uitablerowanimation



297
298
299
# File 'lib/ios/sugarcube-constants/symbol.rb', line 297

def uitablerowanimation
  @uitablerowanimation
end

.uitablestyleObject (readonly)

Returns the value of attribute uitablestyle



296
297
298
# File 'lib/ios/sugarcube-constants/symbol.rb', line 296

def uitablestyle
  @uitablestyle
end

.uitextalignmentObject (readonly)

Returns the value of attribute uitextalignment



265
266
267
# File 'lib/ios/sugarcube-constants/symbol.rb', line 265

def uitextalignment
  @uitextalignment
end

Instance Method Details

#awesome_icon(options = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/cocoa/sugarcube-awesome/awesome_exts.rb', line 3

def awesome_icon(options={})
  raise "the MotionAwesome gem is required to use sugarcube-awesome" unless defined? MotionAwesome
  text = MotionAwesome.hex_for_icon( MotionAwesome.xform_icon(self) )

  if options.key?(:size)
    font_size = options[:size]
    font_size = font_size.uifontsize if font_size.respond_to?(:uifontsize)
  else
    font_size = UIFont.systemFontSize
  end

  awesome_attrs = {NSFontAttributeName => MotionAwesome.font(font_size)}
  if options.key?(:color)
    awesome_attrs[NSForegroundColorAttributeName] = options[:color].uicolor
  end

  NSAttributedString.alloc.initWithString(text, attributes: awesome_attrs )
end

#catimingfunctionObject Also known as: catiming



233
234
235
# File 'lib/ios/sugarcube-constants/symbol.rb', line 233

def catimingfunction
  SugarCube.look_in(self, Symbol.catimingfunction, Symbol.catimingfunction__deprecated)
end

#cgcolor(alpha = nil) ⇒ Object



27
28
29
# File 'lib/osx/sugarcube-color/symbol.rb', line 27

def cgcolor(alpha=nil)
  nscolor(alpha).CGColor
end

#cglinecapObject Also known as: cglinecapstyle



238
239
240
# File 'lib/ios/sugarcube-constants/symbol.rb', line 238

def cglinecap
  SugarCube.look_in(self, Symbol.cglinecap)
end

#cglinejoinObject Also known as: cglinejoinstyle



243
244
245
# File 'lib/ios/sugarcube-constants/symbol.rb', line 243

def cglinejoin
  SugarCube.look_in(self, Symbol.cglinejoin)
end

#cvarObject



12
13
14
# File 'lib/all/sugarcube-unholy/ivar.rb', line 12

def cvar
  self.to_s.cvar
end

#ivarObject



4
5
6
# File 'lib/all/sugarcube-unholy/ivar.rb', line 4

def ivar
  self.to_s.ivar
end

#nsautoresizingmaskObject Also known as: nsautoresizemask



19
20
21
# File 'lib/osx/sugarcube-constants/symbol.rb', line 19

def nsautoresizingmask
  SugarCube.look_in(self, Symbol.nsautoresizingmask)
end

#nsbezelstyleObject



43
44
45
# File 'lib/osx/sugarcube-constants/symbol.rb', line 43

def nsbezelstyle
  SugarCube.look_in(self, Symbol.nsbezelstyle)
end

#nsbuttontypeObject



39
40
41
# File 'lib/osx/sugarcube-constants/symbol.rb', line 39

def nsbuttontype
  SugarCube.look_in(self, Symbol.nsbuttontype)
end

#nscolor(alpha = nil) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/osx/sugarcube-color/symbol.rb', line 8

def nscolor(alpha=nil)
  if Symbol.css_colors_cache.has_key? self
    color = Symbol.css_colors_cache[self]
  elsif Symbol.nscolors.has_key? self
    # system colors
    color = NSColor.send(SugarCube.look_in(self, Symbol.nscolors))
  else
    # css colors
    color = SugarCube.look_in(self, Symbol.css_colors).nscolor
    Symbol.css_colors_cache[self] = color
  end

  if alpha
    color = color.colorWithAlphaComponent(alpha.to_f)
  end

  color
end

#nsdatestyleObject Also known as: nsdateformatterstyle



82
83
84
# File 'lib/ios/sugarcube-constants/symbol.rb', line 82

def nsdatestyle
  SugarCube.look_in(self, Symbol.nsdatestyle)
end

#nsfocusringtypeObject



47
48
49
# File 'lib/osx/sugarcube-constants/symbol.rb', line 47

def nsfocusringtype
  SugarCube.look_in(self, Symbol.nsfocusringtype)
end

#nsfont(size = nil) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/osx/sugarcube-ui/symbol.rb', line 17

def nsfont(size=nil)
  size ||= NSFont.systemFontSize
  # system fonts
  if Symbol.nsfont.has_key? self
    font = SugarCube.look_in(self, Symbol.nsfont)
    if size.is_a?(Symbol)
      size = size.nsfontsize
    end

    if font.is_a?(Symbol)
      return NSFont.send(font, size)
    else
      return font.nsfont(size)
    end
  else
    if size.is_a?(Symbol)
        size = size.nsfontsize
    end
    return NSFont.systemFontOfSize(size)
  end
end

#nsfontsizeObject



39
40
41
42
43
44
45
# File 'lib/osx/sugarcube-ui/symbol.rb', line 39

def nsfontsize
  size = SugarCube.look_in(self, Symbol.nsfontsize)
  if size.is_a?(Symbol)
    return NSFont.send(size)
  end
  return size.to_f
end

#nslinebreakmodeObject Also known as: nslinebreak



67
68
69
# File 'lib/ios/sugarcube-constants/symbol.rb', line 67

def nslinebreakmode
  SugarCube.look_in(self, Symbol.nslinebreakmode)
end

#nsnumberstyleObject Also known as: nsnumberformatterstyle



87
88
89
# File 'lib/ios/sugarcube-constants/symbol.rb', line 87

def nsnumberstyle
  SugarCube.look_in(self, Symbol.nsnumberstyle, Symbol.nsnumberstyle__deprecated)
end

#nstextalignmentObject Also known as: nsalignment



57
58
59
# File 'lib/ios/sugarcube-constants/symbol.rb', line 57

def nstextalignment
  SugarCube.look_in(self, Symbol.nstextalignment)
end

#presentationstyleObject



186
187
188
# File 'lib/ios/sugarcube-constants/symbol.rb', line 186

def presentationstyle
  SugarCube.look_in(self, Symbol.presentationstyle)
end

#setterObject



8
9
10
# File 'lib/all/sugarcube-unholy/ivar.rb', line 8

def setter
  self.to_s.setter
end

#skcolor(alpha = nil) ⇒ Object



31
32
33
# File 'lib/osx/sugarcube-color/symbol.rb', line 31

def skcolor(alpha=nil)
  nscolor(alpha)
end

#transitionstyleObject



190
191
192
# File 'lib/ios/sugarcube-constants/symbol.rb', line 190

def transitionstyle
  SugarCube.look_in(self, Symbol.transitionstyle)
end

#uiactionstyleObject Also known as: uiactionsheetstyle



199
200
201
# File 'lib/ios/sugarcube-constants/symbol.rb', line 199

def uiactionstyle
  SugarCube.look_in(self, Symbol.uiactionstyle)
end

#uiactivityindicatorstyleObject Also known as: uiactivityindicatorviewstyle



127
128
129
# File 'lib/ios/sugarcube-constants/symbol.rb', line 127

def uiactivityindicatorstyle
  SugarCube.look_in(self, Symbol.uiactivityindicatorstyle, Symbol.uiactivityindicatorstyle__deprecated)
end

#uialertactionstyleObject



208
209
210
# File 'lib/ios/sugarcube-constants/symbol.rb', line 208

def uialertactionstyle
  SugarCube.look_in(self, Symbol.uialertactionstyle)
end

#uialertcontrollerstyleObject



204
205
206
# File 'lib/ios/sugarcube-constants/symbol.rb', line 204

def uialertcontrollerstyle
  SugarCube.look_in(self, Symbol.uialertcontrollerstyle)
end

#uialertstyleObject Also known as: uialertviewstyle



194
195
196
# File 'lib/ios/sugarcube-constants/symbol.rb', line 194

def uialertstyle
  SugarCube.look_in(self, Symbol.uialertstyle)
end

#uianimationcurveObject Also known as: uiviewanimationcurve



146
147
148
# File 'lib/ios/sugarcube-constants/symbol.rb', line 146

def uianimationcurve
  SugarCube.look_in(self, Symbol.uianimationcurve)
end

#uianimationoptionObject Also known as: uiviewanimationoption



151
152
153
# File 'lib/ios/sugarcube-constants/symbol.rb', line 151

def uianimationoption
  SugarCube.look_in(self, Symbol.uianimationoption)
end

#uiautoresizemaskObject Also known as: uiviewautoresizing, uiautoresizingmask, uiautoresize



36
37
38
# File 'lib/ios/sugarcube-constants/symbol.rb', line 36

def uiautoresizemask
  SugarCube.look_in(self, Symbol.uiautoresizemask, Symbol.uiautoresizemask__deprecated)
end

#uibarbuttonitemObject



100
101
102
# File 'lib/ios/sugarcube-constants/symbol.rb', line 100

def uibarbuttonitem
  SugarCube.look_in(self, Symbol.uibarbuttonitem, Symbol.uibarbuttonitem__deprecated)
end

#uibarbuttonstyleObject



104
105
106
# File 'lib/ios/sugarcube-constants/symbol.rb', line 104

def uibarbuttonstyle
  SugarCube.look_in(self, Symbol.uibarbuttonstyle)
end

#uibarmetricsObject



96
97
98
# File 'lib/ios/sugarcube-constants/symbol.rb', line 96

def uibarmetrics
  SugarCube.look_in(self, Symbol.uibarmetrics)
end

#uibaselineadjustmentObject Also known as: uibaseline



72
73
74
# File 'lib/ios/sugarcube-constants/symbol.rb', line 72

def uibaselineadjustment
  SugarCube.look_in(self, Symbol.uibaselineadjustment, Symbol.uibaselineadjustment__deprecated)
end

#uibordertypeObject Also known as: uiborderstyle



77
78
79
# File 'lib/ios/sugarcube-constants/symbol.rb', line 77

def uibordertype
  SugarCube.look_in(self, Symbol.uibordertype)
end

#uibuttontypeObject



113
114
115
# File 'lib/ios/sugarcube-constants/symbol.rb', line 113

def uibuttontype
  SugarCube.look_in(self, Symbol.uibuttontype)
end

#uicolor(alpha = nil) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/ios/sugarcube-color/symbol.rb', line 9

def uicolor(alpha=nil)
  if Symbol.uicolors.has_key?(self) || Symbol.uicolors__deprecated.has_key?(self)
    # iOS colors
    color = UIColor.send(SugarCube.look_in(self, Symbol.uicolors, Symbol.uicolors__deprecated))

    if alpha
      color = color.colorWithAlphaComponent(alpha.to_f)
    end
  elsif Symbol.css_colors_cache.has_key? self
    color = Symbol.css_colors_cache[self]
  elsif Symbol.uicolors.has_key? self
    # system colors
    color = UIColor.send(SugarCube.look_in(self, Symbol.uicolors, Symbol.uicolors__deprecated))
    Symbol.css_colors_cache[self] = color
  else
    # css colors
    color = SugarCube.look_in(self, Symbol.css_colors).uicolor
    Symbol.css_colors_cache[self] = color
  end

  if alpha
    color = color.colorWithAlphaComponent(alpha.to_f)
  end

  color
end

#uicontentmodeObject Also known as: uiviewcontentmode



141
142
143
# File 'lib/ios/sugarcube-constants/symbol.rb', line 141

def uicontentmode
  SugarCube.look_in(self, Symbol.uicontentmode, Symbol.uicontentmode__deprecated)
end

#uicontroleventObject



123
124
125
# File 'lib/ios/sugarcube-constants/symbol.rb', line 123

def uicontrolevent
  SugarCube.look_in(self, Symbol.uicontrolevent, Symbol.uicontrolevent__deprecated)
end

#uicontrolstateObject Also known as: uistate



117
118
119
# File 'lib/ios/sugarcube-constants/symbol.rb', line 117

def uicontrolstate
  SugarCube.look_in(self, Symbol.uicontrolstate)
end

#uidatepickermodeObject



137
138
139
# File 'lib/ios/sugarcube-constants/symbol.rb', line 137

def uidatepickermode
  SugarCube.look_in(self, Symbol.uidatepickermode, Symbol.uidatepickermode__deprecated)
end

#uideviceObject



19
20
21
# File 'lib/ios/sugarcube-constants/symbol.rb', line 19

def uidevice
  SugarCube.look_in(self, Symbol.uidevice)
end

#uideviceorientationObject



23
24
25
# File 'lib/ios/sugarcube-constants/symbol.rb', line 23

def uideviceorientation
  SugarCube.look_in(self, Symbol.uideviceorientation)
end

#uifont(size = nil) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/ios/sugarcube-ui/symbol.rb', line 17

def uifont(size=nil)
  size ||= UIFont.systemFontSize
  # system fonts
  if Symbol.uifont.has_key? self
    font = SugarCube.look_in(self, Symbol.uifont)
    if size.is_a?(Symbol)
      size = size.uifontsize
    end

    if font.is_a?(Symbol)
      return UIFont.send(font, size)
    else
      return font.uifont(size)
    end
  else
    if size.is_a?(Symbol)
        size = size.uifontsize
    end
    return UIFont.systemFontOfSize(size)
  end
end

#uifontsizeObject



39
40
41
42
43
44
45
# File 'lib/ios/sugarcube-ui/symbol.rb', line 39

def uifontsize
  size = SugarCube.look_in(self, Symbol.uifontsize)
  if size.is_a?(Symbol)
    return UIFont.send(size)
  end
  return size.to_f
end

#uigesturerecognizerstateObject Also known as: uigesturestate



248
249
250
# File 'lib/ios/sugarcube-constants/symbol.rb', line 248

def uigesturerecognizerstate
  SugarCube.look_in(self, Symbol.uigesturerecognizerstate)
end

#uiimagecameraObject Also known as: uiimagecameradevice, uiimagedevice



222
223
224
# File 'lib/ios/sugarcube-constants/symbol.rb', line 222

def uiimagecamera
  SugarCube.look_in(self, Symbol.uiimagecamera)
end

#uiimagecaptureObject Also known as: uiimagecapturemode



217
218
219
# File 'lib/ios/sugarcube-constants/symbol.rb', line 217

def uiimagecapture
  SugarCube.look_in(self, Symbol.uiimagecapture)
end

#uiimagequalityObject Also known as: uiimagequalitytype



228
229
230
# File 'lib/ios/sugarcube-constants/symbol.rb', line 228

def uiimagequality
  SugarCube.look_in(self, Symbol.uiimagequality)
end

#uiimagesourceObject Also known as: uiimagesourcetype



212
213
214
# File 'lib/ios/sugarcube-constants/symbol.rb', line 212

def uiimagesource
  SugarCube.look_in(self, Symbol.uiimagesource)
end

#uiinterfacemaskObject



32
33
34
# File 'lib/ios/sugarcube-constants/symbol.rb', line 32

def uiinterfacemask
  SugarCube.look_in(self, Symbol.uiinterfacemask)
end

#uiinterfaceorientationObject Also known as: uiorientation



27
28
29
# File 'lib/ios/sugarcube-constants/symbol.rb', line 27

def uiinterfaceorientation
  SugarCube.look_in(self, Symbol.uiinterfaceorientation)
end

#uikeyboardtypeObject



47
48
49
# File 'lib/ios/sugarcube-constants/symbol.rb', line 47

def uikeyboardtype
  SugarCube.look_in(self, Symbol.uikeyboardtype, Symbol.uikeyboardtype__deprecated)
end

#uilinebreakmodeObject



62
63
64
65
# File 'lib/ios/sugarcube-constants/symbol.rb', line 62

def uilinebreakmode
  SugarCube.log('uilinebreakmode is deprecated.  Use nslinebreakmode instead.')
  SugarCube.look_in(self, Symbol.nslinebreakmode)
end

#uireturnkeyObject



43
44
45
# File 'lib/ios/sugarcube-constants/symbol.rb', line 43

def uireturnkey
  SugarCube.look_in(self, Symbol.uireturnkey, Symbol.uireturnkey__deprecated)
end

#uisegmentedstyleObject Also known as: uisegmentedcontrolstyle



132
133
134
# File 'lib/ios/sugarcube-constants/symbol.rb', line 132

def uisegmentedstyle
  SugarCube.look_in(self, Symbol.uisegmentedstyle)
end

#uistatusbarstyleObject



92
93
94
# File 'lib/ios/sugarcube-constants/symbol.rb', line 92

def uistatusbarstyle
  SugarCube.look_in(self, Symbol.uistatusbarstyle)
end

#uitabbarsystemitemObject Also known as: uitabbaritem



108
109
110
# File 'lib/ios/sugarcube-constants/symbol.rb', line 108

def uitabbarsystemitem
  SugarCube.look_in(self, Symbol.uitabbarsystemitem)
end

#uitablecellaccessorytypeObject Also known as: uitablecellaccessory, uitableviewcellaccessorytype



171
172
173
# File 'lib/ios/sugarcube-constants/symbol.rb', line 171

def uitablecellaccessorytype
  SugarCube.look_in(self, Symbol.uitablecellaccessorytype, Symbol.uitablecellaccessorytype__deprecated)
end

#uitablecellselectionstyleObject Also known as: uitableviewcellselectionstyle



177
178
179
# File 'lib/ios/sugarcube-constants/symbol.rb', line 177

def uitablecellselectionstyle
  SugarCube.look_in(self, Symbol.uitablecellselectionstyle)
end

#uitablecellseparatorstyleObject



182
183
184
# File 'lib/ios/sugarcube-constants/symbol.rb', line 182

def uitablecellseparatorstyle
  SugarCube.look_in(self, Symbol.uitablecellseparatorstyle, Symbol.uitablecellseparatorstyle__deprecated)
end

#uitablecellstyleObject Also known as: uitableviewcellstyle



166
167
168
# File 'lib/ios/sugarcube-constants/symbol.rb', line 166

def uitablecellstyle
  SugarCube.look_in(self, Symbol.uitablecellstyle)
end

#uitablerowanimationObject Also known as: uitableviewrowanimation



161
162
163
# File 'lib/ios/sugarcube-constants/symbol.rb', line 161

def uitablerowanimation
  SugarCube.look_in(self, Symbol.uitablerowanimation)
end

#uitablestyleObject Also known as: uitableviewstyle



156
157
158
# File 'lib/ios/sugarcube-constants/symbol.rb', line 156

def uitablestyle
  SugarCube.look_in(self, Symbol.uitablestyle)
end

#uitextalignmentObject Also known as: uialignment



51
52
53
54
# File 'lib/ios/sugarcube-constants/symbol.rb', line 51

def uitextalignment
  SugarCube.log('uitextalignment is deprecated.  Use nstextalignment instead.')
  SugarCube.look_in(self, Symbol.nstextalignment)
end