Class: Fox::Canvas::SelectionPolicy
- Inherits:
-
Object
- Object
- Fox::Canvas::SelectionPolicy
- Defined in:
- lib/fox16/canvas.rb
Overview
Base class for canvas selection policies
Direct Known Subclasses
Instance Method Summary collapse
- #deselectShape(shape, notify) ⇒ Object
-
#initialize(canvas) ⇒ SelectionPolicy
constructor
A new instance of SelectionPolicy.
- #selectShape(shape, notify) ⇒ Object
Constructor Details
#initialize(canvas) ⇒ SelectionPolicy
Returns a new instance of SelectionPolicy.
306 307 308 |
# File 'lib/fox16/canvas.rb', line 306 def initialize(canvas) @canvas = canvas end |
Instance Method Details
#deselectShape(shape, notify) ⇒ Object
320 321 322 323 324 325 326 327 328 |
# File 'lib/fox16/canvas.rb', line 320 def deselectShape(shape, notify) if shape.selected? shape.deselect @canvas.updateShape(shape) if notify && (@canvas.target != nil) @canvas.target.handle(@canvas, MKUINT(@canvas., SEL_DESELECTED), shape) end end end |
#selectShape(shape, notify) ⇒ Object
310 311 312 313 314 315 316 317 318 |
# File 'lib/fox16/canvas.rb', line 310 def selectShape(shape, notify) unless shape.selected? shape.select @canvas.updateShape(shape) if notify && (@canvas.target != nil) @canvas.target.handle(@canvas, MKUINT(@canvas., SEL_SELECTED), shape) end end end |