wDataObject

A wDataObject represents data that can be copied to or from the clipboard, or dragged and dropped. For now, only text, files list, and bitmap are supported.

Seealso:wWindow wDragDropEvent
Effects:
Drag-Drop EffectsDescription
wDragNoneDrop target cannot accept the data.
wDragCopyDrop results in a copy.
wDragMoveDrag source should remove the data.
wDragLinkDrag source should create a link to the original data.

Types

wDataObjectError = object of wError
  
An error raised when wDataObject creation or operation failure.

Consts

wDragNone = 0
wDragCopy = 1
wDragMove = 2
wDragLink = 4
wDragError = 8
wDragCancel = 16

Procs

proc isText(self: wDataObject): bool {...}{.validate, raises: [], tags: [].}
Checks the data is text or not.
proc getText(self: wDataObject): string {...}{.validate, property, raises: [], tags: [].}
Gets the data in text format.
proc isFiles(self: wDataObject): bool {...}{.validate, raises: [], tags: [].}
Checks the data is files list or not.
proc getFiles(self: wDataObject): seq[string] {...}{.validate, property, raises: [], tags: [].}
Gets the files list as seq.
proc isBitmap(self: wDataObject): bool {...}{.validate, raises: [], tags: [].}
Checks the data is bitmap or not.
proc getBitmap(self: wDataObject): wBitmap {...}{.validate, property, raises: [], tags: [].}
Gets the data in bitmap format.
proc doDragDrop(self: wDataObject; flags: int = 3 or 4): int {...}{.validate, discardable,
    raises: [], tags: [].}
Starts the drag-and-drop operation which will terminate when the user releases the mouse. The result will be one of drag-drop effect, wDragCancel, or wDragError.
proc delete(self: wDataObject) {...}{.validate, raises: [], tags: [].}
Nim's garbage collector will delete this object by default. However, sometimes you maybe want do that by yourself. Moreover, if the data object is still on the clipboard, delete it will force to flush it.
proc final(self: wDataObject) {...}{.raises: [], tags: [].}
Default finalizer for wDataObject.
proc init(self: wDataObject; dataObj: ptr IDataObject) {...}{.validate, inline, raises: [],
    tags: [].}
Initializer.
proc DataObject(dataObj: ptr IDataObject): wDataObject {...}{.inline, raises: [], tags: [].}
Constructor.
proc init(self: wDataObject; text: string) {...}{.validate, raises: [], tags: [].}
Initializer.
proc DataObject(text: string): wDataObject {...}{.inline, raises: [], tags: [].}
Constructor from text.
proc init(self: wDataObject; files: openArray[string]) {...}{.validate, raises: [], tags: [].}
Initializer.
proc DataObject(files: openArray[string]): wDataObject {...}{.inline, raises: [], tags: [].}
Constructor from files. The path must exist.
proc init(self: wDataObject; bmp: wBitmap) {...}{.validate, raises: [], tags: [].}
Initializer.
proc DataObject(bmp: wBitmap): wDataObject {...}{.inline, raises: [], tags: [].}
Constructor from bitmap.
proc init(self: wDataObject; dataObj: wDataObject) {...}{.validate, raises: [], tags: [].}
Initializer.
proc DataObject(dataObj: wDataObject): wDataObject {...}{.inline, raises: [], tags: [].}
Copy constructor.

Iterators

iterator getFiles(self: wDataObject): string {...}{.validate, raises: [], tags: [].}
Iterate each file in this file list.

Converters

converter BmpDataObjectToIUnknown(x: ptr BmpDataObject): ptr IUnknown {...}{.raises: [],
    tags: [].}