wx.Clipboard Class Reference

Inheritance diagram for wx.Clipboard:

wx.Object

List of all members.

Public Member Functions

bool AddData (DataObject data)
void Clear ()
 Clipboard ()
 Clipboard (IntPtr wxObject)
void Close ()
bool Flush ()
bool GetData (DataObject data)
bool IsOpened ()
bool IsSupported (DataFormat format)
bool Open ()
bool SetData (DataObject data)
virtual void UsePrimarySelection (bool primary)

Properties

static Clipboard TheClipboard [get]


Detailed Description

A class for manipulating the clipboard. Note that this is not compatible with the clipboard class from wxWidgets 1.xx, which has the same name but a different implementation.

To use the clipboard, you call member functions of the global TheClipboard object.

Cf. Drag and drop overview.

Call wx.Clipboard.Open to get ownership of the clipboard. If this operation returns true, you now own the clipboard. Call wx.Clipboard.SetData to put data on the clipboard, or wx.Clipboard.GetData to retrieve data from the clipboard. Call wx.Clipboard.Close to close the clipboard and relinquish ownership. You should keep the clipboard open only momentarily.


Constructor & Destructor Documentation

wx.Clipboard.Clipboard ( IntPtr  wxObject  ) 

wx.Clipboard.Clipboard (  ) 

Creates an instance.


Member Function Documentation

bool wx.Clipboard.AddData ( DataObject  data  ) 

Call this function to add the data object to the clipboard. You may call this function repeatedly after having cleared the clipboard using wx.Clipboard.Clear.

After this function has been called, the clipboard owns the data, so do not delete the data explicitly.

Parameters:
data The data to be added
Returns:

void wx.Clipboard.Clear (  ) 

Clears the global clipboard object and the system's clipboard if possible.

void wx.Clipboard.Close (  ) 

Call this function to close the clipboard, having opened it with wx.Clipboard.Open.

bool wx.Clipboard.Flush (  ) 

Flushes the clipboard: this means that the data which is currently on clipboard will stay available even after the application exits (possibly eating memory), otherwise the clipboard will be emptied on exit.

Returns:
Returns false if the operation is unsuccessful for any reason.

bool wx.Clipboard.GetData ( DataObject  data  ) 

Call this function to fill data with data on the clipboard, if available in the required format. Returns true on success.

Parameters:
data This data object will be loaded with the data from the clipboard.
Returns:

bool wx.Clipboard.IsOpened (  ) 

Returns true if the clipboard has been opened.

Returns:

bool wx.Clipboard.IsSupported ( DataFormat  format  ) 

Returns true if there is data which matches the data format of the given data object currently available on the clipboard.

Parameters:
format The requested format
Returns:

bool wx.Clipboard.Open (  ) 

Call this function to open the clipboard before calling wx.Clipboard.SetData and wx.Clipboard.GetData.

Call wx.Clipboard.Close when you have finished with the clipboard. You should keep the clipboard open for only a very short time.

Returns:
Returns true on success. This should be tested (as in the sample shown above).

bool wx.Clipboard.SetData ( DataObject  data  ) 

Call this function to set the data object to the clipboard. This function will clear all previous contents in the clipboard, so calling it several times does not make any sense.

After this function has been called, the clipboard owns the data, so do not delete the data explicitly.

Parameters:
data The data that will be set.
Returns:

virtual void wx.Clipboard.UsePrimarySelection ( bool  primary  )  [virtual]

On platforms supporting it (currently only GTK), selects the so called PRIMARY SELECTION as the clipboard as opposed to the normal clipboard, if primary is true.

Parameters:
primary True iff the so-called PRIMARY SELECTION shall be used if available.


Property Documentation

Clipboard wx.Clipboard.TheClipboard [static, get]

The static default instance of this class.


Manual of the wx.NET   (c) 2003-2011 the wx.NET project at   Get wx.NET at SourceForge.net. Fast, secure and Free Open Source software downloads