Class: Wx::SF::ShapeDropEvent
- Inherits:
-
Event
- Object
- Event
- Wx::SF::ShapeDropEvent
- Defined in:
- lib/wx/shapes/events.rb
Overview
Class encapsulates Wx::SF shape on drop event.
Instance Method Summary collapse
-
#get_drag_result ⇒ Wx::DragResult
(also: #drag_result)
Get drag result.
-
#get_drop_position ⇒ Wx::Point
(also: #drop_position)
Get drop position.
-
#get_drop_target ⇒ Wx::SF::ShapeCanvas
(also: #drop_target)
Get drop target.
-
#get_dropped_shapes ⇒ Array<Wx::SF::Shape>
(also: #dropped_shapes)
Get list of dropped shapes.
-
#initialize(evt_type = Wx::EVT_NULL, x = 0, y = 0, target = nil, def_result = Wx::DragResult::DragNone, id = 0) ⇒ ShapeDropEvent
constructor
Constructor.
-
#set_drag_result(dr) ⇒ Object
(also: #drag_result=)
Set drag result.
-
#set_drop_position(pos) ⇒ Object
(also: #drop_position=)
Set position where shapes were dropped.
-
#set_drop_target(trg) ⇒ Object
(also: #drop_target=)
Set target (shape canvas) where shapes were dropped.
-
#set_dropped_shapes(shapes) ⇒ Object
(also: #dropped_shapes=)
Add given shapes to dropped shapes list.
Constructor Details
#initialize(evt_type = Wx::EVT_NULL, x = 0, y = 0, target = nil, def_result = Wx::DragResult::DragNone, id = 0) ⇒ ShapeDropEvent
Constructor
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_result ⇒ Wx::DragResult Also known as: drag_result
Get drag result
274 275 276 |
# File 'lib/wx/shapes/events.rb', line 274 def get_drag_result @drag_result end |
#get_drop_position ⇒ Wx::Point Also known as: drop_position
Get drop position
246 247 248 |
# File 'lib/wx/shapes/events.rb', line 246 def get_drop_position @drop_position end |
#get_drop_target ⇒ Wx::SF::ShapeCanvas Also known as: drop_target
Get drop target
260 261 262 |
# File 'lib/wx/shapes/events.rb', line 260 def get_drop_target @drop_target end |
#get_dropped_shapes ⇒ Array<Wx::SF::Shape> Also known as: dropped_shapes
Get list of dropped shapes
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
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
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
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.
225 226 227 |
# File 'lib/wx/shapes/events.rb', line 225 def set_dropped_shapes(shapes) @dropped_shapes.concat(shapes) end |