Class: Wx::SF::ShapeDropEvent

Inherits:
Event
  • Object
show all
Defined in:
lib/wx/shapes/events.rb

Overview

Class encapsulates Wx::SF shape on drop event.

Instance Method Summary collapse

Constructor Details

#initialize(evt_type = Wx::EVT_NULL, x = 0, y = 0, target = nil, def_result = Wx::DragResult::DragNone, id = 0) ⇒ ShapeDropEvent

Constructor

Parameters:

  • evt_type (Integer) (defaults to: Wx::EVT_NULL)
  • x (Integer) (defaults to: 0)
  • y (Integer) (defaults to: 0)
  • target (Wx::SF::ShapeCanvas) (defaults to: nil)
  • def_result (Wx::DragResult) (defaults to: Wx::DragResult::DragNone)
  • id (Integer) (defaults to: 0)


215
216
217
218
219
220
221
# File 'lib/wx/shapes/events.rb', line 215

def initialize(evt_type = Wx::EVT_NULL, x = 0, y = 0, target = nil, def_result = Wx::DragResult::DragNone, id = 0)
  super(evt_type, id.to_i)
  @dropped_shapes = []
  @drop_position = Wx::Point.new(x, y)
  @drop_target = target
  @drag_result = def_result
end

Instance Method Details

#get_drag_resultWx::DragResult Also known as: drag_result

Get drag result

Returns:

  • (Wx::DragResult)

    drag result



274
275
276
# File 'lib/wx/shapes/events.rb', line 274

def get_drag_result
  @drag_result
end

#get_drop_positionWx::Point Also known as: drop_position

Get drop position

Returns:



246
247
248
# File 'lib/wx/shapes/events.rb', line 246

def get_drop_position
  @drop_position
end

#get_drop_targetWx::SF::ShapeCanvas Also known as: drop_target

Get drop target

Returns:



260
261
262
# File 'lib/wx/shapes/events.rb', line 260

def get_drop_target
  @drop_target
end

#get_dropped_shapesArray<Wx::SF::Shape> Also known as: dropped_shapes

Get list of dropped shapes

Returns:



232
233
234
# File 'lib/wx/shapes/events.rb', line 232

def get_dropped_shapes
  @dropped_shapes
end

#set_drag_result(dr) ⇒ Object Also known as: drag_result=

Set drag result

Parameters:

  • dr (Wx::DragResult)

    drag result



267
268
269
# File 'lib/wx/shapes/events.rb', line 267

def set_drag_result(dr)
  @drag_result = dr
end

#set_drop_position(pos) ⇒ Object Also known as: drop_position=

Set position where shapes were dropped

Parameters:



239
240
241
# File 'lib/wx/shapes/events.rb', line 239

def set_drop_position(pos)
  @drop_position = pos.to_point
end

#set_drop_target(trg) ⇒ Object Also known as: drop_target=

Set target (shape canvas) where shapes were dropped

Parameters:



253
254
255
# File 'lib/wx/shapes/events.rb', line 253

def set_drop_target(trg)
  @drop_target = trg
end

#set_dropped_shapes(shapes) ⇒ Object Also known as: dropped_shapes=

Add given shapes to dropped shapes list.

Parameters:



225
226
227
# File 'lib/wx/shapes/events.rb', line 225

def set_dropped_shapes(shapes)
  @dropped_shapes.concat(shapes)
end