Class: Luck::Control
- Inherits:
-
Object
- Object
- Luck::Control
- Defined in:
- lib/luck/control.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#display ⇒ Object
Returns the value of attribute display.
-
#pane ⇒ Object
Returns the value of attribute pane.
-
#x1 ⇒ Object
Returns the value of attribute x1.
-
#x2 ⇒ Object
Returns the value of attribute x2.
-
#y1 ⇒ Object
Returns the value of attribute y1.
-
#y2 ⇒ Object
Returns the value of attribute y2.
Instance Method Summary collapse
- #focus! ⇒ Object
- #height ⇒ Object
-
#initialize(pane, x1, y1, x2, y2, &blck) ⇒ Control
constructor
A new instance of Control.
- #width ⇒ Object
Constructor Details
#initialize(pane, x1, y1, x2, y2, &blck) ⇒ Control
Returns a new instance of Control.
5 6 7 8 9 10 11 12 |
# File 'lib/luck/control.rb', line 5 def initialize pane, x1, y1, x2, y2, &blck @pane = pane @display = pane.display @x1, @y1 = x1, y1 @x2, @y2 = x2, y2 instance_eval &blck if blck end |
Instance Attribute Details
#display ⇒ Object
Returns the value of attribute display.
3 4 5 |
# File 'lib/luck/control.rb', line 3 def display @display end |
#pane ⇒ Object
Returns the value of attribute pane.
3 4 5 |
# File 'lib/luck/control.rb', line 3 def pane @pane end |
#x1 ⇒ Object
Returns the value of attribute x1.
3 4 5 |
# File 'lib/luck/control.rb', line 3 def x1 @x1 end |
#x2 ⇒ Object
Returns the value of attribute x2.
3 4 5 |
# File 'lib/luck/control.rb', line 3 def x2 @x2 end |
#y1 ⇒ Object
Returns the value of attribute y1.
3 4 5 |
# File 'lib/luck/control.rb', line 3 def y1 @y1 end |
#y2 ⇒ Object
Returns the value of attribute y2.
3 4 5 |
# File 'lib/luck/control.rb', line 3 def y2 @y2 end |
Instance Method Details
#focus! ⇒ Object
14 15 16 |
# File 'lib/luck/control.rb', line 14 def focus! @display.active_control = self end |
#height ⇒ Object
35 36 37 |
# File 'lib/luck/control.rb', line 35 def height y2 - y1 end |
#width ⇒ Object
32 33 34 |
# File 'lib/luck/control.rb', line 32 def width x2 - x1 end |