- which derive from wxDataObject: wxDataObjectSimple and
- wxDataObjectComposite.
- wxDataObjectSimple is
- the simplest wxDataObject possible and only holds data in a single format (such
- as HTML or text) and wxDataObjectComposite is
- the simplest way to implement a wxDataObject that does support multiple formats
- because it achieves this by simply holding several wxDataObjectSimple objects.
-
- So, you have several solutions when you need a wxDataObject class (and you need
- one as soon as you want to transfer data via the clipboard or drag and drop):
-
-
-
- @b 1. Use one of the built-in classes
-
-
- You may use wxTextDataObject,
- wxBitmapDataObject or wxFileDataObject in the simplest cases when you only need
- to support one format and your data is either text, bitmap or list of files.
-
-
- @b 2. Use wxDataObjectSimple
-
-
- Deriving from wxDataObjectSimple is the simplest
- solution for custom data - you will only support one format and so probably
- won't be able to communicate with other programs, but data transfer will work
- in your program (or between different copies of it).
-
-
- @b 3. Use wxDataObjectComposite
-
-
- This is a simple but powerful
- solution which allows you to support any number of formats (either
- standard or custom if you combine it with the previous solution).
-
-
- @b 4. Use wxDataObject directly
-
-
- This is the solution for
- maximal flexibility and efficiency, but it is also the most difficult to
- implement.
-
-
-
- Please note that the easiest way to use drag and drop and the clipboard with
- multiple formats is by using wxDataObjectComposite, but it is not the most
- efficient one as each wxDataObjectSimple would contain the whole data in its
- respective formats. Now imagine that you want to paste 200 pages of text in
- your proprietary format, as well as Word, RTF, HTML, Unicode and plain text to
- the clipboard and even today's computers are in trouble. For this case, you
- will have to derive from wxDataObject directly and make it enumerate its
- formats and provide the data in the requested format on demand.
-
- Note that neither the GTK+ data transfer mechanisms for clipboard and
- drag and drop, nor OLE data transfer, copy any data until another application
- actually requests the data. This is in contrast to the 'feel' offered to the
- user of a program who would normally think that the data resides in the
- clipboard after having pressed 'Copy' - in reality it is only declared to be
- available.
-
+ which derive from wxDataObject: wxDataObjectSimple and
+ wxDataObjectComposite. wxDataObjectSimple is the simplest wxDataObject
+ possible and only holds data in a single format (such as HTML or text) and
+ wxDataObjectComposite is the simplest way to implement a wxDataObject that
+ does support multiple formats because it achieves this by simply holding
+ several wxDataObjectSimple objects.
+
+ So, you have several solutions when you need a wxDataObject class (and you
+ need one as soon as you want to transfer data via the clipboard or drag and
+ drop):
+
+ -# Use one of the built-in classes.
+ - You may use wxTextDataObject, wxBitmapDataObject or wxFileDataObject
+ in the simplest cases when you only need to support one format and
+ your data is either text, bitmap or list of files.
+ -# Use wxDataObjectSimple
+ - Deriving from wxDataObjectSimple is the simplest solution for custom
+ data - you will only support one format and so probably won't be able
+ to communicate with other programs, but data transfer will work in
+ your program (or between different copies of it).
+ -# Use wxDataObjectComposite
+ - This is a simple but powerful solution which allows you to support
+ any number of formats (either standard or custom if you combine it
+ with the previous solution).
+ -# Use wxDataObject Directly
+ - This is the solution for maximal flexibility and efficiency, but it
+ is also the most difficult to implement.
+
+ Please note that the easiest way to use drag and drop and the clipboard
+ with multiple formats is by using wxDataObjectComposite, but it is not the
+ most efficient one as each wxDataObjectSimple would contain the whole data
+ in its respective formats. Now imagine that you want to paste 200 pages of
+ text in your proprietary format, as well as Word, RTF, HTML, Unicode and
+ plain text to the clipboard and even today's computers are in trouble. For
+ this case, you will have to derive from wxDataObject directly and make it
+ enumerate its formats and provide the data in the requested format on
+ demand.
+
+ Note that neither the GTK+ data transfer mechanisms for clipboard and drag
+ and drop, nor OLE data transfer, copy any data until another application
+ actually requests the data. This is in contrast to the 'feel' offered to
+ the user of a program who would normally think that the data resides in the
+ clipboard after having pressed 'Copy' - in reality it is only declared to
+ be available.
+