Small doc updates.
Distrib and makefile updates. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4285 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -6,8 +6,8 @@ clipboard class from wxWindows 1.xx, which has the same name but a different imp
|
||||
To use the clipboard, you call member functions of the global {\bf wxTheClipboard} object.
|
||||
|
||||
Call \helpref{wxClipboard::Open}{wxclipboardopen} to get ownership of the clipboard. If this operation returns TRUE, you
|
||||
now own the clipboard. Call \helpref{wxClipboard::AddData}{wxclipboardadddata} to put data
|
||||
on the clipboard (one or more times), or \helpref{wxClipboard::GetData}{wxclipboardgetdata} to
|
||||
now own the clipboard. Call \helpref{wxClipboard::SetData}{wxclipboardsetdata} to put data
|
||||
on the clipboard, or \helpref{wxClipboard::GetData}{wxclipboardgetdata} to
|
||||
retrieve data from the clipboard. Call \helpref{wxClipboard::Close}{wxclipboardclose} to close
|
||||
the clipboard and relinquish ownership. You should keep the clipboard open only momentarily.
|
||||
|
||||
@@ -26,10 +26,10 @@ For example:
|
||||
// Read some text
|
||||
if (wxTheClipboard->Open())
|
||||
{
|
||||
if (wxTheClipboard->IsSupported( "STRING" ))
|
||||
if (wxTheClipboard->IsSupported( wxDF_TEXT ))
|
||||
{
|
||||
wxTextDataObject data;
|
||||
wxTheClipboard->GetData( &data );
|
||||
wxTheClipboard->GetData( data );
|
||||
wxMessageBox( data.GetText() );
|
||||
}
|
||||
wxTheClipboard->Close();
|
||||
@@ -62,13 +62,6 @@ Constructor.
|
||||
|
||||
Destructor.
|
||||
|
||||
\membersection{wxClipboard::AddData}\label{wxclipboardadddata}
|
||||
|
||||
\func{bool}{AddData}{\param{wxDataObject*}{ data}}
|
||||
|
||||
Call this function to add a data object to the clipboard. This function can be called several times
|
||||
to put different formats on the clipboard.
|
||||
|
||||
\membersection{wxClipboard::Clear}\label{wxclipboardclear}
|
||||
|
||||
\func{void}{Clear}{\void}
|
||||
@@ -83,14 +76,14 @@ Call this function to close the clipboard, having opened it with \helpref{wxClip
|
||||
|
||||
\membersection{wxClipboard::GetData}\label{wxclipboardgetdata}
|
||||
|
||||
\func{bool}{GetData}{\param{wxDataObject*}{ data}}
|
||||
\func{bool}{GetData}{\param{wxDataObject\&}{ data}}
|
||||
|
||||
Call this function to fill {\it data} with data on the clipboard, if available in the required
|
||||
format. Returns TRUE on success.
|
||||
|
||||
\membersection{wxClipboard::IsSupported}\label{wxclipboardissupported}
|
||||
|
||||
\func{bool}{IsSupported}{\param{wxDataFormat}{ format}}
|
||||
\func{bool}{IsSupported}{\param{const wxDataFormat\&}{ format}}
|
||||
|
||||
Returns TRUE if the format of the given data object is available on the clipboard.
|
||||
|
||||
|
@@ -1,43 +1,34 @@
|
||||
\section{\class{wxDataObject}}\label{wxdataobject}
|
||||
|
||||
A wxDataObject represents data that can be copied to or from the clipboard, or
|
||||
dragged and dropped.
|
||||
dragged and dropped. There are two classes directly derived from wxDataObject:
|
||||
wxDataObjectSimple and wxDataObjectComposite. As you will guess, wxDataObjectSimple
|
||||
holds data for a single format (such as HTML or text) and wxDataObjectComposite
|
||||
can hold any number of wxDataObjectSimple classes. Please note that this is an
|
||||
easy way to use Drag'n'Drop and the clipboard with multiple formats, but not the
|
||||
most efficient one as each wxDataObjectSimple would contain the whole data in its
|
||||
respective formars. 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.
|
||||
|
||||
There are several predefined data object classes, such as \helpref{wxFileDataObject}{wxfiledataobject},
|
||||
\helpref{wxTextDataObject}{wxtextdataobject}, and \helpref{wxBitmapDataObject}{wxbitmapdataobject} which
|
||||
can be used without change or can be altered (by deriving a new class from them) in order to deliver
|
||||
data and data size on-demand. There is no need to ever use wxDataObject itself or derive directly from it.
|
||||
|
||||
You may also derive your own data object classes from \helpref{wxPrivateDataObject}{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 Unix (so
|
||||
far only GTK) to identify a format and are translated into their Windows equivalent under
|
||||
Win32 (using the OLE IDataObject for data exchange to and from the clipboard and for Drag'n'Drop).
|
||||
Note that the format string translation under Windows is not yet finnished.
|
||||
|
||||
As mentioned above, data may be placed into the \helpref{wxClipboard}{wxclipboard}
|
||||
or a \helpref{wxDropSource}{wxdropsource} instance either directly or on-demand.
|
||||
As long as only one format is offerred, putting data directly into the clipboard may
|
||||
be sufficient. But imagine that you paste a large piece of text to the clipboard and
|
||||
offer it in "text/plain", "text/rtf", "text/html", "application/word" and your own
|
||||
format for internal use - here offering data on-demand is required to minimize memory
|
||||
consumption. This would generally get implemented using a central object that
|
||||
contains clipboard information in the format with the maximum of information. Note
|
||||
that neither the GTK data transfer mechanisms for the clipboard and Drag'n'Drop
|
||||
Note that neither the GTK data transfer mechanisms for the clipboard and Drag'n'Drop
|
||||
nor the OLE data transfer copies 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.
|
||||
|
||||
Let's assume that you have written an HTML editor and want it to paste contents
|
||||
in the formats "text/plain" and "text/html" to the clipboard. For offering
|
||||
data on-demand in "text/plain" you would derive your class from \helpref{wxTextDataObject}{wxtextdataobject}
|
||||
and for offering data on-demand in "text/html" you would derive your own class from
|
||||
\helpref{wxPrivateDataObject}{wxprivatedataobject} and set its ID string
|
||||
identifying the format to "text/html" using \helpref{wxPrivateDataObject::SetId}{wxprivatedataobjectsetid}.
|
||||
In your two derived classed you'd then have a pointer or reference to the central
|
||||
data container and you'd override the methods returning the size of the
|
||||
available data and the WriteData() methods in both classes.
|
||||
There are several predefined data object classes derived from 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 \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 Unix (so
|
||||
far only GTK) to identify a format and are translated into their Windows equivalent under
|
||||
Win32 (using the OLE IDataObject for data exchange to and from the clipboard and for Drag'n'Drop).
|
||||
Note that the format string translation under Windows is not yet finnished.
|
||||
|
||||
\wxheading{Derived from}
|
||||
|
||||
@@ -71,18 +62,34 @@ Constructor.
|
||||
|
||||
Destructor.
|
||||
|
||||
\membersection{wxDataObject::WriteData}\label{wxdataobjectwritedata}
|
||||
\membersection{wxDataObject::GetFormatCount}\label{wxdataobjectgetformatcount}
|
||||
|
||||
\constfunc{virtual void}{WriteData}{\param{void}{*dest} }
|
||||
\constfunc{virtual size_t}{GetFormatCount}{\void}
|
||||
|
||||
Write the data owned by this class to {\it dest}. This method is a pure
|
||||
virtual function and must be overridden.
|
||||
Return the number of available formats.
|
||||
|
||||
\membersection{wxDataObject::GetSize}\label{wxdataobjectgetdatasize}
|
||||
\membersection{wxDataObject::GetDataHere}\label{wxdataobjectgetdatahere}
|
||||
|
||||
\constfunc{virtual size\_t}{GetSize}{\void}
|
||||
\constfunc{virtual bool}{GetDataHere}{\param{const wxDataFormat\&}{ format}, \param{void}{*buf} }
|
||||
|
||||
Returns the data size. This method is a pure
|
||||
virtual function and must be overridden.
|
||||
The method will write the data of the format {\it format} in the buffer {\it buf}.
|
||||
|
||||
\membersection{wxDataObject::GetDataSize}\label{wxdataobjectgetdatasize}
|
||||
|
||||
\constfunc{virtual size\_t}{GetDataSize}{\param{const wxDataFormat\&}{ format} }
|
||||
|
||||
Returns the data size of the given format {\it format}.
|
||||
|
||||
\membersection{wxDataObject::GetPreferredFormat}\label{wxdataobjectgetpreferredformat}
|
||||
|
||||
\constfunc{virtual wxDataFormat}{GetPreferredFormat}{\void}
|
||||
|
||||
Returns the preferred format. Usually the first format in the list of available formats.
|
||||
|
||||
\membersection{wxDataObject::SetData}\label{wxdataobjectsetdata}
|
||||
|
||||
\func{virtual bool}{SetData}{\param{const wxDataFormat\&}{ format}, \param{size_t}{ len}, \param{const void}{*buf} }
|
||||
|
||||
Set the data of the format {\it format} and the size {\it len} provided in the buffer {\it buf}.
|
||||
|
||||
|
||||
|
@@ -44,14 +44,6 @@ call \helpref{wxDropSource::SetData}{wxdropsourcesetdata} later.
|
||||
|
||||
{\it win} is required by wxGTK and therefore should always be set.
|
||||
|
||||
\func{}{wxDropSource}{\param{wxDataObject\& }{data}, \param{wxWindow*}{ win = NULL}}
|
||||
|
||||
\wxheading{Parameters}
|
||||
|
||||
\docparam{data}{A reference to the \helpref{data object}{wxdataobject} associated with the drop source.}
|
||||
|
||||
\docparam{win}{Only used by wxGTK. TODO}
|
||||
|
||||
\membersection{wxDropSource::\destruct{wxDropSource}}\label{wxdropsourcedtor}
|
||||
|
||||
\func{virtual }{\destruct{wxDropSource}}{\void}
|
||||
@@ -64,16 +56,15 @@ Sets the data \helpref{data object}{wxdataobject} associated with the drop sourc
|
||||
|
||||
\membersection{wxDropSource::DoDragDrop}\label{wxdropsourcedodragdrop}
|
||||
|
||||
\func{virtual wxDragResult}{DoDragDrop}{\param{bool }{bAllowMove = FALSE}}
|
||||
\func{virtual wxDragResult}{DoDragDrop}{\param{bool }{allowMove = FALSE}}
|
||||
|
||||
Do it (call this in response to a mouse button press, for example).
|
||||
|
||||
If {\bf bAllowMove} is FALSE, data can only be copied. Under GTK, data
|
||||
is always copied.
|
||||
If {\bf allowMove} is FALSE, data can only be copied.
|
||||
|
||||
\membersection{wxDropSource::GiveFeedback}\label{wxdropsourcegivefeedback}
|
||||
|
||||
\func{virtual bool}{GiveFeedback}{\param{wxDragResult }{effect}, \param{bool }{bScrolling}}
|
||||
\func{virtual bool}{GiveFeedback}{\param{wxDragResult }{effect}, \param{bool }{scrolling}}
|
||||
|
||||
Overridable: you may give some custom UI feedback during the drag and drop operation
|
||||
in this function. It is called on each mouse move, so your implementation must not be too
|
||||
@@ -81,12 +72,12 @@ slow.
|
||||
|
||||
\wxheading{Parameters}
|
||||
|
||||
\docparam{effect}{The effect to implement. One of wxDragCopy, wxDragMove. MSW only. }
|
||||
\docparam{effect}{The effect to implement. One of wxDragCopy, wxDragMove and wxDragNone. }
|
||||
|
||||
\docparam{bScrolling}{TRUE if the window is scrolling. MSW only. }
|
||||
\docparam{scrolling}{TRUE if the window is scrolling. MSW only. }
|
||||
|
||||
\wxheading{Return value}
|
||||
|
||||
Return FALSE if you want default feedback, or TRUE if you implement your own
|
||||
feedback.
|
||||
feedback. The return values is ignored under GTK.
|
||||
|
||||
|
@@ -87,7 +87,7 @@ Returns the Windows directory under Windows; on other platforms returns the empt
|
||||
|
||||
Adds some common image format handlers, which, depending on wxWindows
|
||||
configuration, can be handlers for BMP (loading) (always installed), GIF
|
||||
(loading and saving), PCX (loading and saving), PNM (loading and saving as raw
|
||||
(loading), PCX (loading), PNM (loading and saving as raw
|
||||
rgb), PNG (loading and saving), JPEG (loading and saving), file formats.
|
||||
|
||||
See also: \helpref{wxImage}{wximage} \helpref{wxImageHandler}{wximagehandler}
|
||||
|
@@ -259,6 +259,13 @@ Gets the green value of the mask colour.
|
||||
|
||||
Gets the red value of the mask colour.
|
||||
|
||||
\membersection{wxImage::GetSubImage}\label{wximagegetsubimage}
|
||||
|
||||
\constfunc{wxImage}{GetSubImage}{\param{const wxRect&}{rect}}
|
||||
|
||||
Returns a sub image of the current one as long as the rect belongs entirely to
|
||||
the image.
|
||||
|
||||
\membersection{wxImage::GetWidth}\label{wximagegetwidth}
|
||||
|
||||
\constfunc{int}{GetWidth}{\void}
|
||||
@@ -458,8 +465,8 @@ Returns a scaled version of the image. This is also useful for
|
||||
scaling bitmaps in general as the only other way to scale bitmaps
|
||||
is to blit a wxMemoryDC into another wxMemoryDC.
|
||||
|
||||
NB: although Windows can do such scaling itself but in the GTK port, scaling
|
||||
bitmaps is done using this routine internally.
|
||||
It may be mentioned that the GTK post uses this function internally
|
||||
to scale bitmaps when using mapping mode in wxDC.
|
||||
|
||||
Example:
|
||||
|
||||
@@ -484,13 +491,6 @@ Example:
|
||||
|
||||
\helpref{Rescale}{wximagerescale}
|
||||
|
||||
\membersection{wxImage::GetSubImage}\label{wximagegetsubimage}
|
||||
|
||||
\constfunc{wxImage}{GetSubImage}{\param{const wxRect&}{rect}}
|
||||
|
||||
Returns a sub image of the current one as long as the rect belongs entirely to
|
||||
the image.
|
||||
|
||||
\membersection{wxImage::SetData}\label{wximagesetdata}
|
||||
|
||||
\func{void}{SetData}{\param{unsigned char*}{data}}
|
||||
|
@@ -170,6 +170,24 @@ Checks or unchecks the menu item.
|
||||
|
||||
\helpref{wxMenu::IsChecked}{wxmenuischecked}
|
||||
|
||||
\membersection{wxMenu::Delete}\label{wxmenudelete}
|
||||
|
||||
\func{void}{Delete}{\param{int }{id}}
|
||||
|
||||
Deletes the menu item from the menu.
|
||||
|
||||
\wxheading{Parameters}
|
||||
|
||||
\docparam{id}{Menu item to be deleted.}
|
||||
|
||||
\wxheading{Remarks}
|
||||
|
||||
Does not delete a sub menu, if any.
|
||||
|
||||
\wxheading{See also}
|
||||
|
||||
\helpref{wxMenu::FindItemForId}{wxmenufinditemforid}
|
||||
|
||||
\membersection{wxMenu::Enable}\label{wxmenuenable}
|
||||
|
||||
\func{void}{Enable}{\param{int}{ id}, \param{const bool}{ enable}}
|
||||
@@ -198,7 +216,7 @@ Finds the menu item id for a menu item string.
|
||||
|
||||
\wxheading{Return value}
|
||||
|
||||
Menu item identifier, or -1 if none is found.
|
||||
Menu item identifier, or wxNOT_FOUND if none is found.
|
||||
|
||||
\wxheading{Remarks}
|
||||
|
||||
@@ -211,14 +229,14 @@ before matching.
|
||||
|
||||
\membersection{wxMenu::FindItemForId}\label{wxmenufinditemforid}
|
||||
|
||||
\constfunc{wxMenuItem*}{FindItemForId}{\param{int}{ id}, \param{wxMenu **}{ menuForItem = NULL}}
|
||||
\constfunc{wxMenuItem*}{FindItemForId}{\param{int}{ id}}
|
||||
\constfunc{wxMenuItem*}{FindItem}{\param{int}{ id}}
|
||||
|
||||
Finds the menu item object associated with the given menu item identifier.
|
||||
|
||||
\wxheading{Parameters}
|
||||
|
||||
\docparam{id}{Menu item identifier.}
|
||||
\docparam{menuForItem}{will be filled with the menu for this item if not NULL.}
|
||||
|
||||
\wxheading{Return value}
|
||||
|
||||
@@ -515,22 +533,23 @@ Finds the menu item id for a menu name/menu item string pair.
|
||||
|
||||
\wxheading{Return value}
|
||||
|
||||
The menu item identifier, or -1 if none was found.
|
||||
The menu item identifier, or wxNOT_FOUND if none was found.
|
||||
|
||||
\wxheading{Remarks}
|
||||
|
||||
Any special menu codes are stripped out of source and target strings
|
||||
before matching.
|
||||
|
||||
\membersection{wxMenuBar::FindItemForId}\label{wxmenubarfinditemforid}
|
||||
\membersection{wxMenuBar::FindItem}\label{wxmenubarfinditem}
|
||||
|
||||
\constfunc{wxMenuItem *}{FindItemForId}{\param{int}{ id}}
|
||||
\constfunc{wxMenuItem *}{FindItem}{\param{int}{ id}, \param{wxMenu}{ **menu = NULL}
|
||||
|
||||
Finds the menu item object associated with the given menu item identifier,
|
||||
Finds the menu item object associated with the given menu item identifier.
|
||||
|
||||
\wxheading{Parameters}
|
||||
|
||||
\docparam{id}{Menu item identifier.}
|
||||
\docparam{menu}{If not NULL, menu will get set to the associated menu.}
|
||||
|
||||
\wxheading{Return value}
|
||||
|
||||
|
@@ -77,7 +77,7 @@ to indicate if a child of a sizer can change its size in the main orientation of
|
||||
0 stands for not changable and a value of more than zero in interpreted relative to the value of other
|
||||
children of the same wxBoxSizer. You might, e.g., have a horizontal wxBoxSizer with three children, two
|
||||
of which are supposed to change their size with the sizer, then the two stretchable windows would get a
|
||||
value of 1 each to make them grow and shrink equally with the sizer's vertical dimension.}
|
||||
value of 1 each to make them grow and shrink equally with the sizer's horizontal dimension.}
|
||||
|
||||
\docparam{flag}{This parameter can be used to set a number of flags which can be combined using
|
||||
the binary OR operator |. Two main behaviours are defined using these flags: One is the border
|
||||
@@ -89,7 +89,7 @@ if you created a wxBoxSizer with the wxVERTICAL option, these flags will be rele
|
||||
sizer changes its horizontal size. A child may get resized to completely fill out the new size (using
|
||||
either wxGROW or wxEXPAND), may get centered (wxCENTER or wxCENTRE) or may get aligned to either
|
||||
side (wxALIGN\_LEFT and wxALIGN\_TOP are set to 0 and thus represent the default, wxALIGN\_RIGHT and
|
||||
wxALIGN\_BOTTOM have their obvious meaning.}
|
||||
wxALIGN\_BOTTOM have their obvious meaning).}
|
||||
|
||||
\docparam{border}{Determines the border width, if the {\it flag} parameter is set to any border.}
|
||||
|
||||
|
Reference in New Issue
Block a user