Module: Vedeu::Bindings::Movement
Overview
System events relating to movement of cursors or interfaces.
Class Method Summary collapse
-
.cursor_origin! ⇒ Object
private
See movement.
-
.cursor_position! ⇒ Object
private
See movement.
-
.cursor_reposition! ⇒ Object
private
See movement.
-
.directional! ⇒ Object
private
See movement.
-
.setup! ⇒ TrueClass
Setup events relating to movement.
Instance Method Summary collapse
-
#cursor_origin! ⇒ Object
private
See movement.
-
#cursor_position! ⇒ Object
private
See movement.
-
#cursor_reposition! ⇒ Object
private
See movement.
-
#directional! ⇒ Object
private
See movement.
-
#setup! ⇒ TrueClass
Setup events relating to movement.
Class Method Details
.cursor_origin! ⇒ Object (private)
See movement
48 49 50 51 52 53 54 |
# File 'lib/vedeu/bindings/movement.rb', line 48 def cursor_origin! Vedeu.bind(:_cursor_origin_) do |name| Vedeu.cursors.by_name(name).move_origin end Vedeu.bind_alias(:_cursor_reset_, :_cursor_origin_) end |
.cursor_position! ⇒ Object (private)
See movement
57 58 59 60 61 |
# File 'lib/vedeu/bindings/movement.rb', line 57 def cursor_position! Vedeu.bind(:_cursor_position_) do |name| Vedeu.cursors.by_name(name).position end end |
.cursor_reposition! ⇒ Object (private)
See movement
64 65 66 67 68 69 70 71 72 |
# File 'lib/vedeu/bindings/movement.rb', line 64 def cursor_reposition! Vedeu.bind(:_cursor_reposition_) do |name, y, x| Vedeu.cursors.by_name(name).reposition(y, x) Vedeu.trigger(:_clear_, name) Vedeu.trigger(:_refresh_, name) Vedeu.trigger(:_refresh_cursor_, name) end end |
.directional! ⇒ Object (private)
See movement
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/vedeu/bindings/movement.rb', line 25 def directional! %w(down left right up).each do |direction| Vedeu.bind("_cursor_#{direction}_".to_sym) do |name| Vedeu.cursors.by_name(name).send("move_#{direction}") Vedeu.trigger(:_refresh_cursor_, name) end Vedeu.bind("_view_#{direction}_".to_sym) do |name| Vedeu.geometries.by_name(name).send("move_#{direction}") Vedeu.trigger(:_clear_) Vedeu.trigger(:_refresh_) Vedeu.trigger(:_clear_, name) Vedeu.trigger(:_refresh_, name) end Vedeu.bind_alias("_geometry_#{direction}_".to_sym, "_view_#{direction}_".to_sym) end end |
.setup! ⇒ TrueClass
Setup events relating to movement. This method is called by Vedeu.
15 16 17 18 19 20 |
# File 'lib/vedeu/bindings/movement.rb', line 15 def setup! cursor_origin! cursor_position! cursor_reposition! directional! end |
Instance Method Details
#cursor_origin! ⇒ Object (private)
See movement
48 49 50 51 52 53 54 |
# File 'lib/vedeu/bindings/movement.rb', line 48 def cursor_origin! Vedeu.bind(:_cursor_origin_) do |name| Vedeu.cursors.by_name(name).move_origin end Vedeu.bind_alias(:_cursor_reset_, :_cursor_origin_) end |
#cursor_position! ⇒ Object (private)
See movement
57 58 59 60 61 |
# File 'lib/vedeu/bindings/movement.rb', line 57 def cursor_position! Vedeu.bind(:_cursor_position_) do |name| Vedeu.cursors.by_name(name).position end end |
#cursor_reposition! ⇒ Object (private)
See movement
64 65 66 67 68 69 70 71 72 |
# File 'lib/vedeu/bindings/movement.rb', line 64 def cursor_reposition! Vedeu.bind(:_cursor_reposition_) do |name, y, x| Vedeu.cursors.by_name(name).reposition(y, x) Vedeu.trigger(:_clear_, name) Vedeu.trigger(:_refresh_, name) Vedeu.trigger(:_refresh_cursor_, name) end end |
#directional! ⇒ Object (private)
See movement
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/vedeu/bindings/movement.rb', line 25 def directional! %w(down left right up).each do |direction| Vedeu.bind("_cursor_#{direction}_".to_sym) do |name| Vedeu.cursors.by_name(name).send("move_#{direction}") Vedeu.trigger(:_refresh_cursor_, name) end Vedeu.bind("_view_#{direction}_".to_sym) do |name| Vedeu.geometries.by_name(name).send("move_#{direction}") Vedeu.trigger(:_clear_) Vedeu.trigger(:_refresh_) Vedeu.trigger(:_clear_, name) Vedeu.trigger(:_refresh_, name) end Vedeu.bind_alias("_geometry_#{direction}_".to_sym, "_view_#{direction}_".to_sym) end end |
#setup! ⇒ TrueClass
Setup events relating to movement. This method is called by Vedeu.
15 16 17 18 19 20 |
# File 'lib/vedeu/bindings/movement.rb', line 15 def setup! cursor_origin! cursor_position! cursor_reposition! directional! end |