Class: Wx::SF::CanvasDropTarget

Inherits:
DropTarget
  • Object
show all
Defined in:
lib/wx/shapes/shape_canvas.rb

Overview

Auxiliary class encapsulating shape drop target.

Instance Method Summary collapse

Constructor Details

#initialize(data, parent) ⇒ CanvasDropTarget

Returns a new instance of CanvasDropTarget.

Parameters:



20
21
22
23
# File 'lib/wx/shapes/shape_canvas.rb', line 20

def initialize(data, parent)
  super(data)
  @parent_canvas = parent
end

Instance Method Details

#on_data(x, y, deflt) ⇒ Wx::DragResult

Parameters:

  • x (Integer)
  • y (Integer)
  • deflt (Wx::DragResult)

Returns:

  • (Wx::DragResult)


29
30
31
32
33
34
# File 'lib/wx/shapes/shape_canvas.rb', line 29

def on_data(x, y, deflt)
  return Wx::DragResult::DragNone unless get_data

  @parent_canvas.__send__(:_on_drop, x, y, deflt, get_data_object)
  deflt
end