Module: Shoes::Common::Positioning
- Included in:
- UIElement
- Defined in:
- shoes-core/lib/shoes/common/positioning.rb
Instance Method Summary collapse
-
#_position(left, top) ⇒ Object
NOT part of the public interface e.g.
-
#displace(left, top) ⇒ Object
displace(left: a number, top: a number) >> self Displacing an element moves it.
-
#move(left, top) ⇒ Object
Moves an element to a specific pixel position.
Instance Method Details
#_position(left, top) ⇒ Object
NOT part of the public interface e.g. no Shoes APP should use this however we need it from the Slot code to position elements
16 17 18 19 20 |
# File 'shoes-core/lib/shoes/common/positioning.rb', line 16 def _position(left, top) self.absolute_left = left self.absolute_top = top gui.update_position if gui && gui.respond_to?(:update_position) end |
#displace(left, top) ⇒ Object
displace(left: a number, top: a number) >> self Displacing an element moves it. But without changing the layout around it.
24 25 26 27 28 29 |
# File 'shoes-core/lib/shoes/common/positioning.rb', line 24 def displace(left, top) self.displace_left = left self.displace_top = top gui.update_position self end |
#move(left, top) ⇒ Object
Moves an element to a specific pixel position. The element is still in the slot, but will no longer be stacked or flowed with the other stuff in the slot.
8 9 10 11 12 |
# File 'shoes-core/lib/shoes/common/positioning.rb', line 8 def move(left, top) self.left = left self.top = top self end |