Fixed doc bug [ 871974 ] wxCursor(bits, ...) constructor misses fg and bg in doc
Jay Berkenbilt git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@25642 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -50,9 +50,12 @@ wxCROSS\_CURSOR}
|
|||||||
Default constructor.
|
Default constructor.
|
||||||
|
|
||||||
\func{}{wxCursor}{\param{const char}{ bits[]}, \param{int }{width},
|
\func{}{wxCursor}{\param{const char}{ bits[]}, \param{int }{width},
|
||||||
\param{int }{ height}, \param{int }{hotSpotX=-1}, \param{int }{hotSpotY=-1}, \param{const char }{maskBits[]=NULL}}
|
\param{int }{ height}, \param{int }{hotSpotX=-1}, \param{int }{hotSpotY=-1}, \param{const char }{maskBits[]=NULL},
|
||||||
|
\param{wxColour*}{ fg=NULL}, \param{wxColour*}{ bg=NULL}}
|
||||||
|
|
||||||
Constructs a cursor by passing an array of bits (Motif and Xt only). {\it maskBits} is used only under Motif.
|
Constructs a cursor by passing an array of bits (Motif and GTK+ only). {\it maskBits} is used only under
|
||||||
|
Motif and GTK+. The parameters {\it fg} and {\bg } are only present on GTK+, and force the
|
||||||
|
cursor to use particular background and foreground colours.
|
||||||
|
|
||||||
If either {\it hotSpotX} or {\it hotSpotY} is -1, the hotspot will be the centre of the cursor image (Motif only).
|
If either {\it hotSpotX} or {\it hotSpotY} is -1, the hotspot will be the centre of the cursor image (Motif only).
|
||||||
|
|
||||||
@@ -154,14 +157,6 @@ Note that not all cursors are available on all platforms.}
|
|||||||
|
|
||||||
\docparam{cursor}{Pointer or reference to a cursor to copy.}
|
\docparam{cursor}{Pointer or reference to a cursor to copy.}
|
||||||
|
|
||||||
\pythonnote{Constructors supported by wxPython are:\par
|
|
||||||
\indented{2cm}{\begin{twocollist}
|
|
||||||
\twocolitem{{\bf wxCursor(name, flags, hotSpotX=0,
|
|
||||||
hotSpotY=0)}}{Constructs a cursor from a filename}
|
|
||||||
\twocolitem{{\bf wxStockCursor(id)}}{Constructs a stock cursor }
|
|
||||||
\end{twocollist}}
|
|
||||||
}
|
|
||||||
|
|
||||||
\perlnote{Constructors supported by wxPerl are:\par
|
\perlnote{Constructors supported by wxPerl are:\par
|
||||||
\begin{itemize}
|
\begin{itemize}
|
||||||
\item{Wx::Cursor->new( name, type, hotSpotX = 0, hotSpotY = 0 )}
|
\item{Wx::Cursor->new( name, type, hotSpotX = 0, hotSpotY = 0 )}
|
||||||
@@ -171,6 +166,62 @@ hotSpotY=0)}}{Constructs a cursor from a filename}
|
|||||||
\end{itemize}
|
\end{itemize}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
\wxheading{Example}
|
||||||
|
|
||||||
|
The following is an example of creating a
|
||||||
|
cursor from 32x32 bitmap data ({\tt down\_bits}) and a mask
|
||||||
|
({\tt down\_mask}) where 1 is black and 0 is white for
|
||||||
|
the bits, and 1 is opaque and 0 is transparent for
|
||||||
|
the mask. It works on Windows and GTK+.
|
||||||
|
|
||||||
|
\begin{verbatim}
|
||||||
|
static char down_bits[] = { 255, 255, 255, 255, 31,
|
||||||
|
255, 255, 255, 31, 255, 255, 255, 31, 255, 255, 255,
|
||||||
|
31, 255, 255, 255, 31, 255, 255, 255, 31, 255, 255,
|
||||||
|
255, 31, 255, 255, 255, 31, 255, 255, 255, 25, 243,
|
||||||
|
255, 255, 19, 249, 255, 255, 7, 252, 255, 255, 15, 254,
|
||||||
|
255, 255, 31, 255, 255, 255, 191, 255, 255, 255, 255,
|
||||||
|
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
|
||||||
|
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
|
||||||
|
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
|
||||||
|
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
|
||||||
|
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
|
||||||
|
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
|
||||||
|
255 };
|
||||||
|
|
||||||
|
static char down_mask[] = { 240, 1, 0, 0, 240, 1,
|
||||||
|
0, 0, 240, 1, 0, 0, 240, 1, 0, 0, 240, 1, 0, 0, 240, 1,
|
||||||
|
0, 0, 240, 1, 0, 0, 240, 1, 0, 0, 255, 31, 0, 0, 255,
|
||||||
|
31, 0, 0, 254, 15, 0, 0, 252, 7, 0, 0, 248, 3, 0, 0,
|
||||||
|
240, 1, 0, 0, 224, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0 };
|
||||||
|
|
||||||
|
#ifdef __WXMSW__
|
||||||
|
wxBitmap down_bitmap(down_bits, 32, 32);
|
||||||
|
wxBitmap down_mask_bitmap(down_mask, 32, 32);
|
||||||
|
|
||||||
|
down_bitmap.SetMask(new wxMask(down_mask_bitmap));
|
||||||
|
wxImage down_image = down_bitmap.ConvertToImage();
|
||||||
|
down_image.SetOption(wxIMAGE_OPTION_CUR_HOTSPOT_X, 6);
|
||||||
|
down_image.SetOption(wxIMAGE_OPTION_CUR_HOTSPOT_Y, 14);
|
||||||
|
wxCursor down_cursor = wxCursor(down_image);
|
||||||
|
#else
|
||||||
|
wxCursor down_cursor = wxCursor(down_bits, 32, 32,
|
||||||
|
6, 14, down_mask, wxWHITE, wxBLACK);
|
||||||
|
#endif
|
||||||
|
\end{verbatim}
|
||||||
|
|
||||||
|
\pythonnote{Constructors supported by wxPython are:\par
|
||||||
|
\indented{2cm}{\begin{twocollist}
|
||||||
|
\twocolitem{{\bf wxCursor(name, flags, hotSpotX=0,
|
||||||
|
hotSpotY=0)}}{Constructs a cursor from a filename}
|
||||||
|
\twocolitem{{\bf wxStockCursor(id)}}{Constructs a stock cursor }
|
||||||
|
\end{twocollist}}
|
||||||
|
}
|
||||||
|
|
||||||
\membersection{wxCursor::\destruct{wxCursor}}
|
\membersection{wxCursor::\destruct{wxCursor}}
|
||||||
|
|
||||||
\func{}{\destruct{wxCursor}}{\void}
|
\func{}{\destruct{wxCursor}}{\void}
|
||||||
|
Reference in New Issue
Block a user