Sha256: 348713e93c2c591822a1e947ef2bcd9ed8576a8c605b14a374ac5cb97b0f7a43
Contents?: true
Size: 1.65 KB
Versions: 19
Compression:
Stored size: 1.65 KB
Contents
--- :wxDataObjectComposite: :detail: :pre: :programlisting: - :pattern: !ruby/regexp /.*/ :replace: | ```ruby class MyDropTarget < Wx::DropTarget def initialize dataobj = Wx::DataObjectComposite.new dataobj.add(Wx::BitmapDataObject.new, true) dataobj.add(Wx::FileDataObject.new) set_data_object(dataobj) end def on_data(x, y, defaultDragResult) return Wx::DragNone unless get_data dataobj_comp = get_data_object format = dataobj_comp.get_received_format dataobj = dataobj_comp.get_object(format) case format.get_type when Wx::DataFormatId::DF_BITMAP # dataobj is Wx::BitmapDataObject ... use dataobj.get_bitmap ... when Wx::DataFormatId::DF_FILENAME # dataobj is Wx::FileDataObject ... use dataobj->GetFilenames() ... else Wx.log_error("unexpected data object format") end defaultDragResult end end ``` :wxURLDataObject: :detail: :pre: :programlisting: - :pattern: !ruby/regexp /.*/ :replace: | ```ruby Wx::Clipboard.open { |clip| clip.place(Wx::URLDataObject.new(url)) ```
Version data entries
19 entries across 19 versions & 1 rubygems