Clipboard

A Clipboard component monitors the system clipboard. It is used to implement "Edit" menu functionality. There is a clipboard component in the system module. Most applications that need custom Edit menu behavior will interact with this component. For example, to determine whether the current clipboard can be pasted as a string, one would use the following code:

IF system:clipboard!QueryItem("string") THEN
...
END IF

Applications may have their own Clipboard components, useful if you wish to handle its events.

Clipboard Properties

Standard Properties:
class, parent, proto, version

activeSelection component
This read-only property keeps track of the component which has the active selection: the component which most recently gained the exclusive focus (its focusState property became 2) while its clipboardable property was set. If no component is the active selection, then this property will be the null component: you may test for this condition with the IsNullComponent() function.

copyable integer (0-1)
The copyable property is read-only, and specifies whether the current active selection is a possible candidate for being copied to the clipboard.

deletable integer (0-1)
The deletable property is read-only, and specifies whether the current active selection could be deleted.

pastable integer (0-1)
The pastable property is read-only, and specifies whether the active selection could accept the current contents of the clipboard.

Clipboard Events

_clipboardChanged()

_clipboardChanged( self AS clipboard )

This event is called whenever the current clipboard item changes.

_selectionChanged()

_selectionChanged( self AS clipboard )

This event is called whenever the current selection changes.

Clipboard Actions

Copy()

Copy()

Tells the component with the active selection to "copy" its selection to the clipboard.

Pass:

Nothing.

Cut()

Cut()

Tells the component with the active selection to "cut" its selection--actually a "copy" followed by a "delete."

Pass:

Nothing.

Delete()

Delete()

Tells the component with the active selection to delete the selected data.

Pass:

Nothing.

GetItem()

GetItem( format AS string ) AS ...

This action returns the specified format if it is currently available on the clipboard.

Pass:

format string
The data type of interest. Possibilities include:
"array," "fax," "float," "graphic," "integer," "long," "sound," "spreadsheet," and "string."

Paste()

Paste()

Tells the component with the active selection to paste the clipboard data to the selection.

Pass:

Nothing.

QueryItem()

QueryItem( format AS string ) AS integer

This action determines whether the specified format is currently available on the clipboard without actually returning the item.

Pass:

format string
The data type of interest. Possibilities include:
"array," "fax," "float," "graphic," "integer," "long," "sound," "spreadsheet," and "string."

SetItem()

SetItem( item )

This action sets the current clipboard item to the passed item, in the format implied by the variant type.

Pass:

item
The data to be registered as the current clipboard item. Supported data types include: array, fax, float, graphic, integer, long, sound, spreadsheet, and string.