some files I forgot to add previously...
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4324 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
65
docs/latex/wx/dobjcomp.tex
Normal file
65
docs/latex/wx/dobjcomp.tex
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
%% Name: dobjcomp.tex
|
||||||
|
%% Purpose: wxDataObjectComposite documentation
|
||||||
|
%% Author: Vadim Zeitlin
|
||||||
|
%% Modified by:
|
||||||
|
%% Created: 02.11.99
|
||||||
|
%% RCS-ID: $Id$
|
||||||
|
%% Copyright: (c) Vadim Zeitlin
|
||||||
|
%% Licence: wxWindows licence
|
||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
|
||||||
|
\section{\class{wxDataObjectComposite}}\label{wxdataobjectcomposite}
|
||||||
|
|
||||||
|
wxDataObjectComposite is the simplest
|
||||||
|
\helpref{wxDataObject}{wxdataobject} derivation which may be sued to support
|
||||||
|
multiple formats. It contains several
|
||||||
|
\helpref{wxDataObjectSimple}{wxdataobjectsimple} objects and supports any
|
||||||
|
format supported by at least one of them. Only one of these data objects is
|
||||||
|
{\it preferred} (the first one if not explicitly changed by using the second
|
||||||
|
parameter of \helpref{Add}{wxdataobjectcompositeadd}) and its format determines
|
||||||
|
the preferred format of the composite data object as well.
|
||||||
|
|
||||||
|
See \helpref{wxDataObject}{wxdataobject} documentation for the reasons why you
|
||||||
|
might prefer to use wxDataObject directly instead of wxDataObjectComposite for
|
||||||
|
efficiency reasons.
|
||||||
|
|
||||||
|
\wxheading{Virtual functions to override}
|
||||||
|
|
||||||
|
None, this class should be used directly.
|
||||||
|
|
||||||
|
\wxheading{Derived from}
|
||||||
|
|
||||||
|
\helpref{wxDataObject}{wxdataobject}
|
||||||
|
|
||||||
|
\wxheading{Include files}
|
||||||
|
|
||||||
|
<wx/dataobj.h>
|
||||||
|
|
||||||
|
\wxheading{See also}
|
||||||
|
|
||||||
|
\helpref{Clipboard and drag and drop overview}{wxclipboardonfigoverview},
|
||||||
|
\helpref{wxDataObject}{wxdataobject},
|
||||||
|
\helpref{wxDataObjectSimple}{wxdataobjectsimple},
|
||||||
|
\helpref{wxFileDataObject}{wxfiledataobject},
|
||||||
|
\helpref{wxTextDataObject}{wxtextdataobject},
|
||||||
|
\helpref{wxBitmapDataObject}{wxbitmapdataobject}
|
||||||
|
|
||||||
|
\latexignore{\rtfignore{\wxheading{Members}}}
|
||||||
|
|
||||||
|
\membersection{wxDataObjectComposite::wxDataObjectComposite}\label{wxdataobjectcompositewxdataobjectcomposite}
|
||||||
|
|
||||||
|
\func{}{wxDataObjectComposite}{\void}
|
||||||
|
|
||||||
|
The default constructor.
|
||||||
|
|
||||||
|
\membersection{wxDataObjectComposite::Add}\label{wxdataobjectcompositeadd}
|
||||||
|
|
||||||
|
\func{void}{Add}{
|
||||||
|
\param{wxDataObjectSimple }{*dataObject},
|
||||||
|
\param{bool }{preferred = FALSE}}
|
||||||
|
|
||||||
|
Adds the {\it dataObject} to the list of supported objects and it becomes the
|
||||||
|
preferred object if {\it preferred} is TRUE.
|
||||||
|
|
||||||
|
|
90
docs/latex/wx/dobjsmpl.tex
Normal file
90
docs/latex/wx/dobjsmpl.tex
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
%% Name: dobjsmpl.tex
|
||||||
|
%% Purpose: wxDataObjectSimple documentation
|
||||||
|
%% Author: Vadim Zeitlin
|
||||||
|
%% Modified by:
|
||||||
|
%% Created: 02.11.99
|
||||||
|
%% RCS-ID: $Id$
|
||||||
|
%% Copyright: (c) Vadim Zeitlin
|
||||||
|
%% Licence: wxWindows licence
|
||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
|
||||||
|
\section{\class{wxDataObjectSimple}}\label{wxdataobjectsimple}
|
||||||
|
|
||||||
|
This is the simplest possible implementation of
|
||||||
|
\helpref{wxDataObject}{wxdataobject} class. The data object of (a class derived
|
||||||
|
from) this class only supports one format, so the number of virtual functions
|
||||||
|
to be implemented is reduced.
|
||||||
|
|
||||||
|
Notice that this is still an abstract base class and cannot be used but should
|
||||||
|
be derived from.
|
||||||
|
|
||||||
|
\wxheading{Virtual functions to override}
|
||||||
|
|
||||||
|
The objects supporting rendering the data must override
|
||||||
|
\helpref{GetDataSize}{wxdataobjectsimplegetdatasize} and
|
||||||
|
\helpref{GetDataHere}{wxdataobjectsimplegetdatahere} while the objects which
|
||||||
|
may be set must override \helpref{SetData}{wxdataobjectsimplesetdata}. Of
|
||||||
|
course, the objects supporting both operations must override all threee
|
||||||
|
methods.
|
||||||
|
|
||||||
|
\wxheading{Derived from}
|
||||||
|
|
||||||
|
\helpref{wxDataObject}{wxdataobject}
|
||||||
|
|
||||||
|
\wxheading{Include files}
|
||||||
|
|
||||||
|
<wx/dataobj.h>
|
||||||
|
|
||||||
|
\wxheading{See also}
|
||||||
|
|
||||||
|
\helpref{Clipboard and drag and drop overview}{wxclipboardonfigoverview},
|
||||||
|
\helpref{DnD sample}{samplednd},
|
||||||
|
\helpref{wxFileDataObject}{wxfiledataobject},
|
||||||
|
\helpref{wxTextDataObject}{wxtextdataobject},
|
||||||
|
\helpref{wxBitmapDataObject}{wxbitmapdataobject}
|
||||||
|
|
||||||
|
\latexignore{\rtfignore{\wxheading{Members}}}
|
||||||
|
|
||||||
|
\membersection{wxDataObjectSimple::wxDataObjectSimple}\label{wxdataobjectsimplewxdataobjectsimple}
|
||||||
|
|
||||||
|
\func{}{wxDataObjectSimple}{\param{const wxDataFormat\&}{ format = wxFormatInvalid}}
|
||||||
|
|
||||||
|
Constructor accepts the supported format (none by default) which may also be
|
||||||
|
set later with \helpref{SetFormat}{wxdataobjectsimplesetformat}.
|
||||||
|
|
||||||
|
\membersection{wxDataObjectSimple::GetFormat}\label{wxdataobjectsimplegetformat}
|
||||||
|
|
||||||
|
\constfunc{const wxDataFormat\&}{GetFormat}{\void}
|
||||||
|
|
||||||
|
Returns the (one and only one) format supported by this object. It is supposed
|
||||||
|
that the format is supported in both directions.
|
||||||
|
|
||||||
|
\membersection{wxDataObjectSimple::SetFormat}\label{wxdataobjectsimplesetformat}
|
||||||
|
|
||||||
|
\func{void}{SetFormat}{\param{const wxDataFormat\&}{ format}}
|
||||||
|
|
||||||
|
Sets the supported format.
|
||||||
|
|
||||||
|
\membersection{wxDataObjectSimple::GetDataSize}\label{wxdataobjectsimplegetdatasize}
|
||||||
|
|
||||||
|
\constfunc{virtual size\_t}{GetDataSize}{\void}
|
||||||
|
|
||||||
|
Gets the size of our data. Must be implemented in the derived class if the
|
||||||
|
object supports rendering its data.
|
||||||
|
|
||||||
|
\membersection{wxDataObjectSimple::GetDataHere}\label{wxdataobjectsimplegetdatahere}
|
||||||
|
|
||||||
|
\constfunc{virtual bool}{GetDataHere}{\param{void }{*buf}}
|
||||||
|
|
||||||
|
Copy the data to the buffer, return TRUE on success. Must be implemented in the
|
||||||
|
derived class if the object supports rendering its data.
|
||||||
|
|
||||||
|
\membersection{wxDataObjectSimple::SetData}\label{wxdataobjectsimplesetdata}
|
||||||
|
|
||||||
|
\func{virtual bool}{SetData}{\param{size\_t }{len}, \param{const void }{*buf}}
|
||||||
|
|
||||||
|
Copy the data from the buffer, return TRUE on success. Must be implemented in
|
||||||
|
the derived class if the object supports setting its data.
|
||||||
|
|
||||||
|
|
54
docs/latex/wx/tsamples.tex
Normal file
54
docs/latex/wx/tsamples.tex
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
%% Name: tsamples.tex
|
||||||
|
%% Purpose: Samples description
|
||||||
|
%% Author: Vadim Zeitlin
|
||||||
|
%% Modified by:
|
||||||
|
%% Created: 02.11.99
|
||||||
|
%% RCS-ID: $Id$
|
||||||
|
%% Copyright: (c) wxWindows team
|
||||||
|
%% Licence: wxWindows licence
|
||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
|
||||||
|
\section{wxWindows samples}\label{samples}
|
||||||
|
|
||||||
|
Probably the best way to learn wxWindows is by reading the source of some 50+
|
||||||
|
samples provided with it. Many aspects of wxWindows programming can be learnt
|
||||||
|
from them, but sometimes it is not simple to just choose the right sample to
|
||||||
|
look at. This overview aims at describing what each sample does/demonstrates to
|
||||||
|
make it easier to find the relevant one if a simple grep through all sources
|
||||||
|
didn't help. They also provide some notes about using the samples and what
|
||||||
|
features of wxWindows are they supposed to test.
|
||||||
|
|
||||||
|
\subsection{DnD sample}{samplednd}
|
||||||
|
|
||||||
|
This sample shows both clipboard and drag and drop in action. It is quite non
|
||||||
|
trivial and may be safely used as a basis for implementing the clipboard and
|
||||||
|
drag and drop operations in a real-life program.
|
||||||
|
|
||||||
|
When you run the sample, its screen is split in several parts. On the top,
|
||||||
|
there are two listboxes which show the standard derivations of
|
||||||
|
\helpref{wxDropTarget}{wxdroptarget}:
|
||||||
|
\helpref{wxTextDropTarget}{wxtextdroptarget} and
|
||||||
|
\helpref{wxFileDropTarget}{wxfiledroptarget}.
|
||||||
|
|
||||||
|
The middle of the sample window is taken by the log window which shows what is
|
||||||
|
going on (of course, this only works in debug builds) and may be helpful to see
|
||||||
|
the sequence of steps of data transfer.
|
||||||
|
|
||||||
|
Finally, the last part is used for two things: you can drag text from it to
|
||||||
|
either one of the listboxes (only one will accept it) or another application
|
||||||
|
and, also, bitmap pasted from clipboard will be shown there.
|
||||||
|
|
||||||
|
So far, everything we mentioned was implemented with minimal amount of code
|
||||||
|
using standard wxWindows classes. The more advanced features are demonstrated
|
||||||
|
if you create a shape frame from the main frame menu. A shape is a geometric
|
||||||
|
object which has a position, size and color. It models some
|
||||||
|
application-specific data in this sample. A shape object supports its own
|
||||||
|
private \helpref{wxDataFormat}{wxdataformat} which means that you may cut and
|
||||||
|
paste it or drag and drop (between one and the same or different shapes) from
|
||||||
|
one sample instance to another (or the same). However, chances are that no
|
||||||
|
other program supports this format and so shapes can also be rendered as
|
||||||
|
bitmaps which allows them to be pasted/dropped in many other applications.
|
||||||
|
|
||||||
|
Take a look at DnDShapeDataObject class to see how you may use
|
||||||
|
\helpref{wxDataObject}{wxdataobject} to achieve this.
|
Reference in New Issue
Block a user