wxPython stuff:
1. Added Clipboard and Drag-and-Drop classes 2. Added wxFontEnumerator 3. Many changes to wxMenu, wxMenubar 4. Various other changes and additions 5. Updates to the demo 6. Documentation updates git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4387 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1,15 +1,20 @@
|
||||
\section{\class{wxBitmapDataObject}}\label{wxbitmapdataobject}
|
||||
|
||||
wxBitmapDataObject is a specialization of wxDataObject for bitmap data. It can
|
||||
be used without change to paste data into the
|
||||
be used without change to paste data into the
|
||||
\helpref{wxClipboard}{wxclipboard} or a \helpref{wxDropSource}{wxdropsource}. A
|
||||
user may wish to derive a new class from this class for providing a bitmap
|
||||
on-demand in order to minimize memory consumption when offering data in several
|
||||
formats, such as a bitmap and GIF.
|
||||
|
||||
\pythonnote{If you wish to create a derived wxBitmapDataObject class in
|
||||
wxPython you should derive the class from wxPyBitmapDataObject
|
||||
in order to get Python-aware capabilities for the various virtual
|
||||
methods.}
|
||||
|
||||
\wxheading{Virtual functions to override}
|
||||
|
||||
This class may be used as is, but
|
||||
This class may be used as is, but
|
||||
\helpref{GetBitmap}{wxbitmapdataobjectgetbitmap} may be overridden to increase
|
||||
efficiency.
|
||||
|
||||
@@ -24,16 +29,16 @@ efficiency.
|
||||
|
||||
\wxheading{See also}
|
||||
|
||||
\helpref{Clipboard and drag and drop overview}{wxdndoverview},
|
||||
\helpref{wxDataObject}{wxdataobject},
|
||||
\helpref{wxDataObjectSimple}{wxdataobjectsimple},
|
||||
\helpref{wxFileDataObject}{wxfiledataobject},
|
||||
\helpref{wxTextDataObject}{wxtextdataobject},
|
||||
\helpref{Clipboard and drag and drop overview}{wxdndoverview},
|
||||
\helpref{wxDataObject}{wxdataobject},
|
||||
\helpref{wxDataObjectSimple}{wxdataobjectsimple},
|
||||
\helpref{wxFileDataObject}{wxfiledataobject},
|
||||
\helpref{wxTextDataObject}{wxtextdataobject},
|
||||
\helpref{wxDataObject}{wxdataobject}
|
||||
|
||||
\func{}{wxBitmapDataObject}{\param{const wxBitmap\& }{bitmap = wxNullBitmap}}
|
||||
|
||||
Constructor, optionally passing a bitmap (otherwise use
|
||||
Constructor, optionally passing a bitmap (otherwise use
|
||||
\helpref{SetBitmap}{wxbitmapdataobjectsetbitmap} later)
|
||||
|
||||
\membersection{wxBitmapDataObject::GetBitmap}\label{wxbitmapdataobjectgetbitmap}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
\section{\class{wxCustomDataObject}}\label{wxcustomdataobject}
|
||||
|
||||
wxCustomDataObject is a specialization of
|
||||
wxCustomDataObject is a specialization of
|
||||
\helpref{wxDataObjectSimple}{wxdataobjectsimple} for some
|
||||
application-specific data in arbitrary (either custom or one of the standard
|
||||
ones). The only restriction is that it is supposed that this data can be
|
||||
@@ -8,8 +8,8 @@ copied bitwise (i.e. with {\tt memcpy()}), so it would be a bad idea to make
|
||||
it contain a C++ object (though C struct is fine).
|
||||
|
||||
By default, wxCustomDataObject stores the data inside in a buffer. To put the
|
||||
data into the buffer you may use either
|
||||
\helpref{SetData}{wxcustomdataobjectsetdata} or
|
||||
data into the buffer you may use either
|
||||
\helpref{SetData}{wxcustomdataobjectsetdata} or
|
||||
\helpref{TakeData}{wxcustomdataobjecttakedata} depending on whether you want
|
||||
the object to make a copy of data or not.
|
||||
|
||||
@@ -20,9 +20,9 @@ the virtual functions mentioned below.
|
||||
\wxheading{Virtual functions to override}
|
||||
|
||||
This class may be used as is, but if you don't want store the data inside the
|
||||
object but provide it on demand instead, you should override
|
||||
object but provide it on demand instead, you should override
|
||||
\helpref{GetSize}{wxcustomdataobjectgetsize},
|
||||
\helpref{GetData}{wxcustomdataobjectgetdata} and
|
||||
\helpref{GetData}{wxcustomdataobjectgetdata} and
|
||||
\helpref{SetData}{wxcustomdataobjectsetdata} (or may be only the first two or
|
||||
only the last one if you only allow reading/writing the data)
|
||||
|
||||
@@ -46,7 +46,7 @@ only the last one if you only allow reading/writing the data)
|
||||
\func{}{wxCustomDataObject}{\param{const wxDataFormat\& }{format = wxFormatInvalid}}
|
||||
|
||||
The constructor accepts a {\it format} argument which specifies the (single)
|
||||
format supported by this object. If it isn't set here,
|
||||
format supported by this object. If it isn't set here,
|
||||
\helpref{SetFormat}{wxdataobjectsimplesetformat} should be used.
|
||||
|
||||
\membersection{wxCustomDataObject::\destruct{wxCustomDataObject}}\label{wxcustomdataobjectdtor}
|
||||
@@ -69,6 +69,9 @@ The default version just uses the operator new.
|
||||
|
||||
\membersection{wxCustomDataObject::Free}\label{wxcustomdataobjectfree}
|
||||
|
||||
\pythonnote{This method expects a string in wxPython. You can pass
|
||||
nearly any object by pickling it first.}
|
||||
|
||||
\func{virtual void}{Free}{\void}
|
||||
|
||||
This function is called when the data is freed, you may override it to anything
|
||||
|
@@ -33,7 +33,7 @@ enum Direction
|
||||
};
|
||||
\end{verbatim}
|
||||
|
||||
which allows to distinguish between them. See
|
||||
which allows to distinguish between them. See
|
||||
\helpref{wxDataFormat}{wxdataformat} documentation for more about formats.
|
||||
|
||||
Not surprizingly, being 'smart' comes at a price of added complexity. This is
|
||||
@@ -42,8 +42,8 @@ but may be annoying if you only want to do something simple like cut and paste
|
||||
text.
|
||||
|
||||
To provide a solution for both cases, wxWindows has two predefined classes
|
||||
which derive from wxDataObject: \helpref{wxDataObjectSimple}{wxdataobjectsimple} and
|
||||
\helpref{wxDataObjectComposite}{wxdataobjectcomposite}.
|
||||
which derive from wxDataObject: \helpref{wxDataObjectSimple}{wxdataobjectsimple} and
|
||||
\helpref{wxDataObjectComposite}{wxdataobjectcomposite}.
|
||||
\helpref{wxDataObjectSimple}{wxdataobjectsimple} is
|
||||
the simplest wxDataObject possible and only holds data in a single format (such
|
||||
as HTML or text) and \helpref{wxDataObjectComposite}{wxdataobjectcomposite} is
|
||||
@@ -86,12 +86,12 @@ clipboard after having pressed 'Copy' - in reality it is only declared to be
|
||||
available.
|
||||
|
||||
There are several predefined data object classes derived from
|
||||
wxDataObjectSimple: \helpref{wxFileDataObject}{wxfiledataobject},
|
||||
\helpref{wxTextDataObject}{wxtextdataobject} and
|
||||
wxDataObjectSimple: \helpref{wxFileDataObject}{wxfiledataobject},
|
||||
\helpref{wxTextDataObject}{wxtextdataobject} and
|
||||
\helpref{wxBitmapDataObject}{wxbitmapdataobject} which can be used without
|
||||
change.
|
||||
|
||||
You may also derive your own data object classes from
|
||||
You may also derive your own data object classes from
|
||||
\helpref{wxCustomDataObject}{wxprivatedataobject} for user-defined types. The
|
||||
format of user-defined data is given as mime-type string literal, such as
|
||||
"application/word" or "image/png". These strings are used as they are under
|
||||
@@ -100,13 +100,17 @@ Windows equivalent under Win32 (using the OLE IDataObject for data exchange to
|
||||
and from the clipboard and for drag and drop). Note that the format string
|
||||
translation under Windows is not yet finished.
|
||||
|
||||
\pythonnote{At this time this class is directly usable from wxPython.
|
||||
Derive a class from \helpref{wxPyDataObjectSimple}{wxdataobjectsimple}
|
||||
instead.}
|
||||
|
||||
\wxheading{Virtual functions to override}
|
||||
|
||||
Each class derived directly from wxDataObject must override and implement all
|
||||
of its functions which are pure virtual in the base class.
|
||||
|
||||
The data objects which only render their data or only set it (i.e. work in
|
||||
only one direction), should return 0 from
|
||||
only one direction), should return 0 from
|
||||
\helpref{GetFormatCount}{wxdataobjectgetformatcount}.
|
||||
|
||||
\wxheading{Derived from}
|
||||
@@ -119,15 +123,15 @@ None
|
||||
|
||||
\wxheading{See also}
|
||||
|
||||
\helpref{Clipboard and drag and drop overview}{wxdndoverview},
|
||||
\helpref{DnD sample}{samplednd},
|
||||
\helpref{wxFileDataObject}{wxfiledataobject},
|
||||
\helpref{wxTextDataObject}{wxtextdataobject},
|
||||
\helpref{wxBitmapDataObject}{wxbitmapdataobject},
|
||||
\helpref{wxPrivateDataObject}{wxprivatedataobject},
|
||||
\helpref{wxDropTarget}{wxdroptarget},
|
||||
\helpref{wxDropSource}{wxdropsource},
|
||||
\helpref{wxTextDropTarget}{wxtextdroptarget},
|
||||
\helpref{Clipboard and drag and drop overview}{wxdndoverview},
|
||||
\helpref{DnD sample}{samplednd},
|
||||
\helpref{wxFileDataObject}{wxfiledataobject},
|
||||
\helpref{wxTextDataObject}{wxtextdataobject},
|
||||
\helpref{wxBitmapDataObject}{wxbitmapdataobject},
|
||||
\helpref{wxPrivateDataObject}{wxprivatedataobject},
|
||||
\helpref{wxDropTarget}{wxdroptarget},
|
||||
\helpref{wxDropSource}{wxdropsource},
|
||||
\helpref{wxTextDropTarget}{wxtextdroptarget},
|
||||
\helpref{wxFileDropTarget}{wxfiledroptarget}
|
||||
|
||||
\latexignore{\rtfignore{\wxheading{Members}}}
|
||||
@@ -148,7 +152,7 @@ Destructor.
|
||||
|
||||
\constfunc{virtual void}{GetAllFormats}{ \param{wxDataFormat *}{formats}, \param{Direction}{ dir = Get}}
|
||||
|
||||
Copy all supported formats in the given direction to the array pointed to by
|
||||
Copy all supported formats in the given direction to the array pointed to by
|
||||
{\it formats}. There is enough space for GetFormatCount(dir) formats in it.
|
||||
|
||||
\membersection{wxDataObject::GetDataHere}\label{wxdataobjectgetdatahere}
|
||||
|
@@ -11,7 +11,7 @@
|
||||
|
||||
\section{\class{wxDataObjectSimple}}\label{wxdataobjectsimple}
|
||||
|
||||
This is the simplest possible implementation of
|
||||
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.
|
||||
@@ -19,10 +19,15 @@ to be implemented is reduced.
|
||||
Notice that this is still an abstract base class and cannot be used but should
|
||||
be derived from.
|
||||
|
||||
\pythonnote{If you wish to create a derived wxDataObjectSimple class in
|
||||
wxPython you should derive the class from wxPyDataObjectSimple
|
||||
in order to get Python-aware capabilities for the various virtual
|
||||
methods.}
|
||||
|
||||
\wxheading{Virtual functions to override}
|
||||
|
||||
The objects supporting rendering the data must override
|
||||
\helpref{GetDataSize}{wxdataobjectsimplegetdatasize} and
|
||||
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
|
||||
@@ -38,10 +43,10 @@ methods.
|
||||
|
||||
\wxheading{See also}
|
||||
|
||||
\helpref{Clipboard and drag and drop overview}{wxdndoverview},
|
||||
\helpref{DnD sample}{samplednd},
|
||||
\helpref{wxFileDataObject}{wxfiledataobject},
|
||||
\helpref{wxTextDataObject}{wxtextdataobject},
|
||||
\helpref{Clipboard and drag and drop overview}{wxdndoverview},
|
||||
\helpref{DnD sample}{samplednd},
|
||||
\helpref{wxFileDataObject}{wxfiledataobject},
|
||||
\helpref{wxTextDataObject}{wxtextdataobject},
|
||||
\helpref{wxBitmapDataObject}{wxbitmapdataobject}
|
||||
|
||||
\latexignore{\rtfignore{\wxheading{Members}}}
|
||||
@@ -80,6 +85,10 @@ object supports rendering its data.
|
||||
Copy the data to the buffer, return TRUE on success. Must be implemented in the
|
||||
derived class if the object supports rendering its data.
|
||||
|
||||
\pythonnote{When implementing this method in wxPython, no additional
|
||||
parameters are required and the data should be returned from the
|
||||
method as a string.}
|
||||
|
||||
\membersection{wxDataObjectSimple::SetData}\label{wxdataobjectsimplesetdata}
|
||||
|
||||
\func{virtual bool}{SetData}{\param{size\_t }{len}, \param{const void }{*buf}}
|
||||
@@ -87,4 +96,7 @@ derived class if the object supports rendering its data.
|
||||
Copy the data from the buffer, return TRUE on success. Must be implemented in
|
||||
the derived class if the object supports setting its data.
|
||||
|
||||
\pythonnote{When implementing this method in wxPython, the data comes
|
||||
as a single string parameter rather than the two shown here.}
|
||||
|
||||
|
||||
|
@@ -25,7 +25,7 @@
|
||||
%\special{!/@scaleunit 1 def}
|
||||
\parskip=10pt
|
||||
\parindent=0pt
|
||||
\title{wxWindows 2.1: a portable C++ and Python GUI toolkit}
|
||||
\title{wxWindows 2.1: A portable C++ and Python GUI toolkit}
|
||||
\winhelponly{\author{by Julian Smart et al
|
||||
%\winhelponly{\\$$\image{1cm;0cm}{wxwin.wmf}$$}
|
||||
}}
|
||||
|
@@ -41,8 +41,7 @@ this window.
|
||||
|
||||
\membersection{wxMenu::wxMenu}\label{wxmenuconstr}
|
||||
|
||||
\func{}{wxMenu}{\param{const wxString\& }{title = ""},
|
||||
\param{const wxFunction}{ func = NULL}, \param{long}{ style = 0}}
|
||||
\func{}{wxMenu}{\param{const wxString\& }{title = ""}, \param{long}{ style = 0}}
|
||||
|
||||
Constructs a wxMenu object.
|
||||
|
||||
@@ -50,18 +49,8 @@ Constructs a wxMenu object.
|
||||
|
||||
\docparam{title}{A title for the popup menu: the empty string denotes no title.}
|
||||
|
||||
\docparam{func}{A callback function if the menu is used as a popup using \helpref{wxWindow::PopupMenu}{wxwindowpopupmenu}.}
|
||||
|
||||
\docparam{style}{If set to \tt{wxMENU_TEAROFF}, the menu will be detachable.}
|
||||
|
||||
\pythonnote{The wxPython version of the \tt{wxMenu} constructor
|
||||
doesn't accept the callback argument because of reference counting
|
||||
issues. There is a specialized wxMenu constructor called
|
||||
\tt{wxPyMenu} which does and can be used for PopupMenus when callbacks
|
||||
are needed. You must retain a reference to the menu while useing it
|
||||
otherwise your callback function will get dereferenced when the menu
|
||||
does.
|
||||
}
|
||||
|
||||
\func{}{wxMenu}{\param{long}{ style}}
|
||||
|
||||
|
@@ -1,20 +1,25 @@
|
||||
\section{\class{wxTextDataObject}}\label{wxtextdataobject}
|
||||
|
||||
wxTextDataObject is a specialization of wxDataObject for text data. It can be
|
||||
used without change to paste data into the \helpref{wxClipboard}{wxclipboard}
|
||||
used without change to paste data into the \helpref{wxClipboard}{wxclipboard}
|
||||
or a \helpref{wxDropSource}{wxdropsource}. A user may wish to derive a new
|
||||
class from this class for providing text on-demand in order to minimize memory
|
||||
consumption when offering data in several formats, such as plain text and RTF
|
||||
because by default the text is stored in a string in this class, but it might
|
||||
as well be generated when requested. For this,
|
||||
\helpref{GetTextLength}{wxtextdataobjectgettextlength} and
|
||||
as well be generated when requested. For this,
|
||||
\helpref{GetTextLength}{wxtextdataobjectgettextlength} and
|
||||
\helpref{GetText}{wxtextdataobjectgettext} will have to be overridden.
|
||||
|
||||
Note that if you already have the text inside a string, you will not achieve
|
||||
any efficiency gain by overriding these functions because copying wxStrings is
|
||||
already a very efficient operation (data is not actualyl copied because
|
||||
already a very efficient operation (data is not actually copied because
|
||||
wxStrings are reference counted).
|
||||
|
||||
\pythonnote{If you wish to create a derived wxTextDataObject class in
|
||||
wxPython you should derive the class from wxPyTextDataObject
|
||||
in order to get Python-aware capabilities for the various virtual
|
||||
methods.}
|
||||
|
||||
\wxheading{Virtual functions to override}
|
||||
|
||||
This class may be used as is, but all of data transfer functions may be
|
||||
@@ -31,10 +36,10 @@ overridden to increase efficiency.
|
||||
|
||||
\wxheading{See also}
|
||||
|
||||
\helpref{Clipboard and drag and drop overview}{wxdndoverview},
|
||||
\helpref{wxDataObject}{wxdataobject},
|
||||
\helpref{wxDataObjectSimple}{wxdataobjectsimple},
|
||||
\helpref{wxFileDataObject}{wxfiledataobject},
|
||||
\helpref{Clipboard and drag and drop overview}{wxdndoverview},
|
||||
\helpref{wxDataObject}{wxdataobject},
|
||||
\helpref{wxDataObjectSimple}{wxdataobjectsimple},
|
||||
\helpref{wxFileDataObject}{wxfiledataobject},
|
||||
\helpref{wxBitmapDataObject}{wxbitmapdataobject}
|
||||
|
||||
\latexignore{\rtfignore{\wxheading{Members}}}
|
||||
@@ -43,7 +48,7 @@ overridden to increase efficiency.
|
||||
|
||||
\func{}{wxTextDataObject}{\param{const wxString\& }{text = wxEmptyString}}
|
||||
|
||||
Constructor, may be used to initialise the text (otherwise
|
||||
Constructor, may be used to initialise the text (otherwise
|
||||
\helpref{SetText}{wxtextdataobjectsettext} should be used later).
|
||||
|
||||
\membersection{wxTextDataObject::GetTextLength}\label{wxtextdataobjectgettextlength}
|
||||
|
Reference in New Issue
Block a user