Class: Shoes::Pattern

Inherits:
Basic show all
Defined in:
lib/shoes/basic.rb,
lib/shoes/style.rb

Direct Known Subclasses

Background, Border

Instance Attribute Summary

Attributes inherited from Basic

#args, #cleared, #hided, #initials, #parent, #shows

Attributes included from Mod

#click_proc, #hover_proc, #hovered, #leave_proc, #margin_bottom, #margin_left, #margin_right, #margin_top, #release_proc

Instance Method Summary collapse

Methods inherited from Basic

#clear, #fix_size, #hide, #initialize, #move, #move3, #positioning, #remove, #show, #toggle

Methods included from Mod

#click, #hover, #leave, #release, #set_margin

Constructor Details

This class inherits a constructor from Shoes::Basic

Instance Method Details

#move2(x, y) ⇒ Object



185
186
187
188
189
190
191
192
193
194
195
196
197
# File 'lib/shoes/basic.rb', line 185

def move2 x, y
  return if @hided
  clear if @real
  @left, @top, @width, @height = parent.left, parent.top, parent.width, parent.height
  @width = @args[:width] unless @args[:width].zero?
  @height = @args[:height] unless @args[:height].zero?
  m = self.class.to_s.downcase[7..-1]
  args = eval "{#{@args.keys.map{|k| "#{k}: @#{k}"}.join(', ')}}"
  args = [@pattern, args.merge({create_real: true, nocontrol: true})]
  pt = @app.send(m, *args)
  @real = pt.real
  @width, @height = 0, 0
end

#style(args) ⇒ Object



34
35
36
37
38
39
40
41
# File 'lib/shoes/style.rb', line 34

def style args
  real.clear if real
  args[:pattern] ||= @pattern
  m = self.class.to_s.downcase[7..-1]
  args = @args.merge args
  obj = @app.send m, args[:pattern], args, &args[:block]
  obj.instance_variables.each{|iv| eval "#{iv} = obj.instance_variable_get('#{iv}')"}
end