Class: DragDropText

Inherits:
DragDropObject show all
Defined in:
lib/vr/dragdropformat.rb

Constant Summary collapse

FormatName =

DragDropText

This class deals the structure for drag-and-drop files.

Class Methods

— set(files)

Creates object and sets the file pathes in ((|files|)) to the object.

— get(handle)

Create object and sets the file pathes containing in ((|handle|)).
The ((|handle|)) is a global heap handle.

Methods

— text

Returns the text.
"CF_TEXT"
FormatId =
ClipboardFormat::CF_TEXT

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from DragDropObject

#free_handle, #handle, #objectformat

Constructor Details

#initialize(text, handle = 0) ⇒ DragDropText

Returns a new instance of DragDropText.



75
76
77
78
# File 'lib/vr/dragdropformat.rb', line 75

def initialize(text,handle=0)
  @__binarydata = @__texts = text.to_str.dup
  @handle=handle
end

Class Method Details

.get(handle) ⇒ Object



84
85
86
# File 'lib/vr/dragdropformat.rb', line 84

def self.get(handle)
  self.new(GMEM::Get(handle),handle)
end

.set(texts) ⇒ Object



80
81
82
# File 'lib/vr/dragdropformat.rb', line 80

def self.set(texts)
  self.new(texts)
end

Instance Method Details

#textObject



88
89
90
# File 'lib/vr/dragdropformat.rb', line 88

def text
  @__texts.dup
end