Class: Wx::CustomDataObject

Inherits:
DataObjectSimple show all
Defined in:
lib/wx/doc/gen/data_object.rb

Overview

CustomDataObject is a specialization of DataObjectSimple for some application-specific data in arbitrary (either custom or one of the standard ones).

The only restriction is that it is supposed that this data can be copied bitwise (i.e. with memcpy()), so it would be a bad idea to make it contain a C++ object (though C struct is fine). By default, CustomDataObject stores the data inside in a buffer. To put the data into the buffer you may use either DataObjectSimple#set_data or take_data depending on whether you want the object to make a copy of data or not. This class may be used as is, but if you don’t want store the data inside the object but provide it on demand instead, you should override get_size, get_data and DataObjectSimple#set_data (or may be only the first two or only the last one if you only allow reading/writing the data).

Category: Clipboard and Drag & Drop

See Also:

Requires:

  • USE_CLIPBOARD

Direct Known Subclasses

ImageDataObject

Instance Method Summary collapse

Methods inherited from DataObjectSimple

#get_data_here, #get_data_size, #get_format, #set_data

Methods inherited from DataObject

#get_all_formats, #get_data_here, #get_data_size, #get_format_count, #get_preferred_format, #is_supported, #set_data

Constructor Details

#initialize(format = Wx::FORMAT_INVALID) ⇒ Wx::CustomDataObject

The constructor accepts a format argument which specifies the (single) format supported by this object.

If it isn’t set here, DataObjectSimple#set_format should be used.

Parameters:



364
# File 'lib/wx/doc/gen/data_object.rb', line 364

def initialize(format=Wx::FORMAT_INVALID) end