Module: Shoes::Mod

Included in:
Basic, Slot
Defined in:
lib/shoes/helper_methods.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#hover_procObject (readonly)

Returns the value of attribute hover_proc.



35
36
37
# File 'lib/shoes/helper_methods.rb', line 35

def hover_proc
  @hover_proc
end

#hoveredObject

Returns the value of attribute hovered.



36
37
38
# File 'lib/shoes/helper_methods.rb', line 36

def hovered
  @hovered
end

#leave_procObject (readonly)

Returns the value of attribute leave_proc.



35
36
37
# File 'lib/shoes/helper_methods.rb', line 35

def leave_proc
  @leave_proc
end

#margin_bottomObject (readonly)

Returns the value of attribute margin_bottom.



35
36
37
# File 'lib/shoes/helper_methods.rb', line 35

def margin_bottom
  @margin_bottom
end

#margin_leftObject (readonly)

Returns the value of attribute margin_left.



35
36
37
# File 'lib/shoes/helper_methods.rb', line 35

def margin_left
  @margin_left
end

#margin_rightObject (readonly)

Returns the value of attribute margin_right.



35
36
37
# File 'lib/shoes/helper_methods.rb', line 35

def margin_right
  @margin_right
end

#margin_topObject (readonly)

Returns the value of attribute margin_top.



35
36
37
# File 'lib/shoes/helper_methods.rb', line 35

def margin_top
  @margin_top
end

Instance Method Details

#click(&blk) ⇒ Object



17
18
19
# File 'lib/shoes/helper_methods.rb', line 17

def click &blk
  @app.clickable self, :click, &blk
end

#hidedObject



13
14
15
# File 'lib/shoes/helper_methods.rb', line 13

def hided
  @app.hided or @hided
end

#hover(&blk) ⇒ Object



25
26
27
28
# File 'lib/shoes/helper_methods.rb', line 25

def hover &blk
  @hover_proc = blk
  (@app.mhcs << self) unless @app.mhcs.include? self
end

#leave(&blk) ⇒ Object



30
31
32
33
# File 'lib/shoes/helper_methods.rb', line 30

def leave &blk
  @leave_proc = blk
  (@app.mhcs << self) unless @app.mhcs.include? self
end

#release(&blk) ⇒ Object



21
22
23
# File 'lib/shoes/helper_methods.rb', line 21

def release &blk
  @app.clickable self, :release, &blk
end

#set_marginObject



3
4
5
6
7
8
9
10
11
# File 'lib/shoes/helper_methods.rb', line 3

def set_margin
  @margin ||= [0, 0, 0, 0]
  @margin = [@margin, @margin, @margin, @margin] if @margin.is_a? Integer
  margin_left, margin_top, margin_right, margin_bottom = @margin
  @margin_left ||= margin_left
  @margin_top ||= margin_top
  @margin_right ||= margin_right
  @margin_bottom ||= margin_bottom
end