Class: Fox::Canvas::RectangleShape
Instance Attribute Summary collapse
-
#height ⇒ Object
Returns the value of attribute height.
-
#width ⇒ Object
Returns the value of attribute width.
Attributes inherited from Shape
#foreground, #selector, #target, #x, #y
Instance Method Summary collapse
- #draw(dc) ⇒ Object
-
#initialize(x, y, w, h) ⇒ RectangleShape
constructor
A new instance of RectangleShape.
Methods inherited from Shape
#apply_dc, #bounds, #deselect, #disable, #draggable=, #draggable?, #drawOutline, #enable, #enabled?, #hide, #hit?, #makeControlPoints, #move, #position, #resize, #select, #selected?, #show, #visible?
Constructor Details
#initialize(x, y, w, h) ⇒ RectangleShape
Returns a new instance of RectangleShape.
230 231 232 233 234 |
# File 'lib/fox16/canvas.rb', line 230 def initialize(x, y, w, h) super(x, y) @width = w @height = h end |
Instance Attribute Details
#height ⇒ Object
Returns the value of attribute height.
228 229 230 |
# File 'lib/fox16/canvas.rb', line 228 def height @height end |
#width ⇒ Object
Returns the value of attribute width.
228 229 230 |
# File 'lib/fox16/canvas.rb', line 228 def width @width end |
Instance Method Details
#draw(dc) ⇒ Object
236 237 238 239 240 241 |
# File 'lib/fox16/canvas.rb', line 236 def draw(dc) apply_dc(dc) do dc.lineWidth = 5 if selected? dc.drawRectangle(x, y, width, height) end end |