Type DataFormat
object
--+
|
DataFormat
A wx.DataFormat is an encapsulation of a platform-specific format
handle which is used by the system for the clipboard and drag and drop
operations. The applications are usually only interested in, for
example, pasting data from the clipboard only if the data is in a
format the program understands. A data format is is used to uniquely
identify this format.
On the system level, a data format is usually just a number, (which
may be the CLIPFORMAT under Windows or Atom under X11, for example.)
The standard format IDs are:
wx.DF_INVALID |
An invalid format |
wx.DF_TEXT |
Text format |
wx.DF_BITMAP |
A bitmap (wx.Bitmap) |
wx.DF_METAFILE |
A metafile (wx.Metafile, Windows only) |
wx.DF_FILENAME |
A list of filenames |
wx.DF_HTML |
An HTML string. This is only valid on
Windows and non-unicode builds |
Besies the standard formats, the application may also use custom
formats which are identified by their names (strings) and not numeric
identifiers. Although internally custom format must be created (or
registered) first, you shouldn't care about it because it is done
automatically the first time the wxDataFormat object corresponding to
a given format name is created.
Method Summary |
DataFormat |
__init__ (self,
type)
Constructs a data format object for one of the standard data formats
or an empty data object (use SetType or SetId later in this case) |
|
__del__(self)
|
bool |
__eq__ (self,
format)
__eq__(self, DataFormat format) -> bool |
bool |
__ne__ (self,
format)
__ne__(self, DataFormat format) -> bool |
|
GetId (self)
Returns the name of a custom format (this function will fail for a
format). |
int |
GetType (self)
Returns the platform-specific number identifying the format. |
|
SetId (self,
format)
Sets the format to be the custom format identified by the given name. |
|
SetType (self,
format)
Sets the format to the given value, which should be one of wx.DF_XXX
constants. |
__init__(self,
type)
(Constructor)
Constructs a data format object for one of the standard data formats
or an empty data object (use SetType or SetId later in this case)
-
- Parameters:
type
(type=int)
- Returns:
-
DataFormat
- Overrides:
__builtin__.object.__init__
|
__eq__(self,
format)
(Equality operator)
__eq__(self, DataFormat format) -> bool
-
- Parameters:
format
(type=int)
- Returns:
-
bool
|
__ne__(self,
format)
__ne__(self, DataFormat format) -> bool
-
- Parameters:
format
(type=int)
- Returns:
-
bool
|
GetId(self)
Returns the name of a custom format (this function will fail for a
format).
-
|
GetType(self)
Returns the platform-specific number identifying the format.
-
- Returns:
-
int
|
SetId(self,
format)
Sets the format to be the custom format identified by the given name.
-
- Parameters:
format
(type=String)
|
SetType(self,
format)
Sets the format to the given value, which should be one of wx.DF_XXX
constants.
-
- Parameters:
format
(type=int)
|
thisown
The membership flag
-
|