1998-05-20 10:25:30 -04:00
\section { \class { wxImageList} } \label { wximagelist}
A wxImageList contains a list of images, which are stored in
an unspecified form. Images can have masks for transparent
drawing, and can be made from a variety of sources including bitmaps
and icons.
wxImageList is used principally in conjunction with \helpref { wxTreeCtrl} { wxtreectrl} and
\rtfsp \helpref { wxListCtrl} { wxlistctrl} classes.
\wxheading { Derived from}
\helpref { wxObject} { wxobject}
1999-02-15 15:41:29 -05:00
\wxheading { Include files}
<wx/imaglist.h>
1998-05-20 10:25:30 -04:00
\wxheading { See also}
\helpref { wxTreeCtrl} { wxtreectrl} , \helpref { wxListCtrl} { wxlistctrl}
\latexignore { \rtfignore { \wxheading { Members} } }
\membersection { wxImageList::wxImageList} \label { wximagelistconstr}
\func { } { wxImageList} { \void }
Default constructor.
2003-01-17 19:16:34 -05:00
\func { } { wxImageList} { \param { int } { width} , \param { int } { height} , \param { const bool } { mask = true} ,\rtfsp
1998-06-14 08:11:50 -04:00
\param { int } { initialCount = 1} }
1998-05-20 10:25:30 -04:00
Constructor specifying the image size, whether image masks should be created, and the initial size of the list.
\wxheading { Parameters}
\docparam { width} { Width of the images in the list.}
\docparam { height} { Height of the images in the list.}
2003-01-17 19:16:34 -05:00
\docparam { mask} { true if masks should be created for all images.}
1998-05-20 10:25:30 -04:00
\docparam { initialCount} { The initial size of the list.}
\wxheading { See also}
\helpref { wxImageList::Create} { wximagelistcreate}
\membersection { wxImageList::Add} \label { wximagelistadd}
\func { int} { Add} { \param { const wxBitmap\& } { bitmap} , \param { const wxBitmap\& } { mask = wxNullBitmap} }
2006-04-30 07:58:40 -04:00
Adds a new image or images using a bitmap and optional mask bitmap.
1998-05-20 10:25:30 -04:00
\func { int} { Add} { \param { const wxBitmap\& } { bitmap} , \param { const wxColour\& } { maskColour} }
2006-04-30 07:58:40 -04:00
Adds a new image or images using a bitmap and mask colour.
1998-05-20 10:25:30 -04:00
1998-07-03 12:39:59 -04:00
\func { int} { Add} { \param { const wxIcon\& } { icon} }
1998-05-20 10:25:30 -04:00
Adds a new image using an icon.
\wxheading { Parameters}
\docparam { bitmap} { Bitmap representing the opaque areas of the image.}
\docparam { mask} { Monochrome mask bitmap, representing the transparent areas of the image.}
\docparam { maskColour} { Colour indicating which parts of the image are transparent.}
\docparam { icon} { Icon to use as the image.}
\wxheading { Return value}
The new zero-based image index.
\wxheading { Remarks}
The original bitmap or icon is not affected by the { \bf Add} operation, and can be deleted afterwards.
2006-04-30 07:58:40 -04:00
If the bitmap is wider than the images in the list, then the bitmap will automatically be split into smaller images, each matching the dimensions of the image list. This does not apply when adding icons.
1999-02-19 02:58:02 -05:00
\pythonnote { In place of a single overloaded method name, wxPython
implements the following methods:\par
\indented { 2cm} { \begin { twocollist}
1999-12-25 15:34:56 -05:00
\twocolitem { { \bf Add(bitmap, mask=wxNullBitmap)} } { }
\twocolitem { { \bf AddWithColourMask(bitmap, colour)} } { }
\twocolitem { { \bf AddIcon(icon)} } { }
1999-02-19 02:58:02 -05:00
\end { twocollist} }
}
1998-05-20 10:25:30 -04:00
\membersection { wxImageList::Create} \label { wximagelistcreate}
2003-01-17 19:16:34 -05:00
\func { bool} { Create} { \param { int } { width} , \param { int } { height} , \param { const bool } { mask = true} ,\rtfsp
1998-06-14 08:11:50 -04:00
\param { int } { initialCount = 1} }
1998-05-20 10:25:30 -04:00
Initializes the list. See \helpref { wxImageList::wxImageList} { wximagelistconstr} for details.
\membersection { wxImageList::Draw} \label { wximagelistdraw}
1998-06-14 08:11:50 -04:00
\func { bool} { Draw} { \param { int} { index} , \param { wxDC\& } { dc} , \param { int } { x} ,\rtfsp
2005-04-08 10:34:30 -04:00
\param { int } { y} , \param { int } { flags = wxIMAGELIST\_ DRAW\_ NORMAL} ,\rtfsp
2003-01-17 19:16:34 -05:00
\param { const bool } { solidBackground = false} }
1998-05-20 10:25:30 -04:00
Draws a specified image onto a device context.
\wxheading { Parameters}
\docparam { index} { Image index, starting from zero.}
\docparam { dc} { Device context to draw on.}
\docparam { x} { X position on the device context.}
\docparam { y} { Y position on the device context.}
\docparam { flags} { How to draw the image. A bitlist of a selection of the following:
\begin { twocollist} \itemsep =0pt
\twocolitem { { \bf wxIMAGELIST\_ DRAW\_ NORMAL} } { Draw the image normally.}
\twocolitem { { \bf wxIMAGELIST\_ DRAW\_ TRANSPARENT} } { Draw the image with transparency.}
\twocolitem { { \bf wxIMAGELIST\_ DRAW\_ SELECTED} } { Draw the image in selected state.}
2002-06-07 16:15:28 -04:00
\twocolitem { { \bf wxIMAGELIST\_ DRAW\_ FOCUSED} } { Draw the image in a focused state.}
1998-05-20 10:25:30 -04:00
\end { twocollist}
}
\docparam { solidBackground} { For optimisation - drawing can be faster if the function is told
that the background is solid.}
2005-02-27 06:55:01 -05:00
\membersection { wxImageList::GetBitmap} \label { wximagelistgetbitmap}
\constfunc { wxBitmap} { GetBitmap} { \param { int } { index} }
Returns the bitmap corresponding to the given index.
\membersection { wxImageList::GetIcon} \label { wximagelistgeticon}
\constfunc { wxIcon} { GetIcon} { \param { int } { index} }
Returns the icon corresponding to the given index.
1998-05-20 10:25:30 -04:00
\membersection { wxImageList::GetImageCount} \label { wximagelistgetimagecount}
\constfunc { int} { GetImageCount} { \void }
Returns the number of images in the list.
2000-07-15 15:51:35 -04:00
\membersection { wxImageList::GetSize} \label { wximagelistgetsize}
\constfunc { bool} { GetSize} { \param { int } { index} , \param { int\& } { width} , \param { int \& } { height} }
Retrieves the size of the images in the list. Currently, the { \it index}
parameter is ignored as all images in the list have the same size.
\wxheading { Parameters}
\docparam { index} { currently unused, should be 0}
\docparam { width} { receives the width of the images in the list}
\docparam { height} { receives the height of the images in the list}
\wxheading { Return value}
2003-01-17 19:16:34 -05:00
true if the function succeeded, false if it failed (for example, if the image
2000-07-15 15:51:35 -04:00
list was not yet initialized).
1998-05-20 10:25:30 -04:00
\membersection { wxImageList::Remove} \label { wximagelistremove}
1998-06-14 08:11:50 -04:00
\func { bool} { Remove} { \param { int} { index} }
1998-05-20 10:25:30 -04:00
Removes the image at the given position.
\membersection { wxImageList::RemoveAll} \label { wximagelistremoveall}
\func { bool} { RemoveAll} { \void }
Removes all the images in the list.
\membersection { wxImageList::Replace} \label { wximagelistreplace}
1998-06-14 08:11:50 -04:00
\func { bool} { Replace} { \param { int} { index} , \param { const wxBitmap\& } { bitmap} , \param { const wxBitmap\& } { mask = wxNullBitmap} }
1998-05-20 10:25:30 -04:00
Replaces the existing image with the new image.
2005-02-06 12:27:04 -05:00
Windows only.
1998-06-14 08:11:50 -04:00
\func { bool} { Replace} { \param { int} { index} , \param { const wxIcon\& } { icon} }
1998-05-20 10:25:30 -04:00
Replaces the existing image with the new image.
\wxheading { Parameters}
\docparam { bitmap} { Bitmap representing the opaque areas of the image.}
\docparam { mask} { Monochrome mask bitmap, representing the transparent areas of the image.}
\docparam { icon} { Icon to use as the image.}
\wxheading { Return value}
2003-01-17 19:16:34 -05:00
true if the replacement was successful, false otherwise.
1998-05-20 10:25:30 -04:00
\wxheading { Remarks}
The original bitmap or icon is not affected by the { \bf Replace} operation, and can be deleted afterwards.
1999-12-25 15:34:56 -05:00
\pythonnote { The second form is called { \tt ReplaceIcon} in wxPython.}
1999-02-19 02:58:02 -05:00
1998-05-20 10:25:30 -04:00