Module: Iup::DragDropAttributes

Extended by:
AttributeBuilders
Included in:
Canvas, Dialog, Label, List, Text, Tree
Defined in:
lib/wrapped/drag-drop-attributes.rb

Overview

defines attributes and methods for drag and drop

Steps to use the Drag & Drop support in an IUP application:

AT SOURCE
  • Enable the element as source using the attribute DRAGSOURCE=YES;

  • Define the data types supported by the element for the drag operation using the DRAGTYPES attribute;

  • Register the required callbacks DRAGBEGIN_CB, DRAGDATASIZE_CB and DRAGDATA_CB for drag handling. DRAGEND_CB is the only optional drag callback, all other callbacks and attributes must be set.

AT TARGET
  • Enable the element as target using the attribute DROPTARGET=YES;

  • Define the data types supported by the element for the drop using the DROPTYPES attribute;

  • Register the required callback DROPDATA_CB for handling the data received. This callback and all the drop target attributes must be set too. DROPMOTION_CB is the only optional drop callback.

Instance Method Summary collapse

Methods included from AttributeBuilders

define_attribute, define_id_attribute, define_id_reader, define_id_writer, define_property_attribute, define_property_reader, define_property_writer, define_reader, define_writer

Instance Method Details

#dragbegin_cb=(callback) ⇒ Object



51
52
53
# File 'lib/wrapped/drag-drop-attributes.rb', line 51

def dragbegin_cb= callback
  define_callback callback, 'DRAGBEGIN_CB', :ii_i
end

#dragdata_cb=(callback) ⇒ Object



68
69
70
# File 'lib/wrapped/drag-drop-attributes.rb', line 68

def dragdata_cb= callback
  define_callback callback, 'DRAGDATA_CB', :ssi_i
end

#dragdatasize_cb=(callback) ⇒ Object



59
60
61
# File 'lib/wrapped/drag-drop-attributes.rb', line 59

def dragdatasize_cb= callback
  define_callback callback, 'DRAGDATASIZE_CB', :s_i
end

#dragend_cb=(callback) ⇒ Object



76
77
78
# File 'lib/wrapped/drag-drop-attributes.rb', line 76

def dragend_cb= callback
  define_callback callback, 'DRAGEND_CB', :i_i
end

#dragsourceObject

:attr: dragsource



26
# File 'lib/wrapped/drag-drop-attributes.rb', line 26

define_attribute :dragsource

#dragsourcemoveObject

:attr: dragsourcemove



34
# File 'lib/wrapped/drag-drop-attributes.rb', line 34

define_attribute :dragsourcemove

#dragtypesObject

:attr: dragtypes



30
# File 'lib/wrapped/drag-drop-attributes.rb', line 30

define_attribute :dragtypes

#dropdata_cb=(callback) ⇒ Object



85
86
87
# File 'lib/wrapped/drag-drop-attributes.rb', line 85

def dropdata_cb= callback
  define_callback callback, 'DROPDATA_CB', :ssiii_i
end

#dropmotion_cb=(callback) ⇒ Object



93
94
95
# File 'lib/wrapped/drag-drop-attributes.rb', line 93

def dropmotion_cb= callback
  define_callback callback, 'DROPMOTION_CB', :iis_i
end

#droptargetObject

:attr: droptarget



38
# File 'lib/wrapped/drag-drop-attributes.rb', line 38

define_attribute :droptarget

#droptypesObject

:attr: droptypes



42
# File 'lib/wrapped/drag-drop-attributes.rb', line 42

define_attribute :droptypes