]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/imaglist.tex
a bit more docs
[wxWidgets.git] / docs / latex / wx / imaglist.tex
CommitLineData
a660d684
KB
1\section{\class{wxImageList}}\label{wximagelist}
2
3A wxImageList contains a list of images, which are stored in
4an unspecified form. Images can have masks for transparent
5drawing, and can be made from a variety of sources including bitmaps
6and icons.
7
8wxImageList is used principally in conjunction with \helpref{wxTreeCtrl}{wxtreectrl} and
9\rtfsp\helpref{wxListCtrl}{wxlistctrl} classes.
10
11\wxheading{Derived from}
12
13\helpref{wxObject}{wxobject}
14
15\wxheading{See also}
16
17\helpref{wxTreeCtrl}{wxtreectrl}, \helpref{wxListCtrl}{wxlistctrl}
18
19\latexignore{\rtfignore{\wxheading{Members}}}
20
21\membersection{wxImageList::wxImageList}\label{wximagelistconstr}
22
23\func{}{wxImageList}{\void}
24
25Default constructor.
26
eaaa6a06
JS
27\func{}{wxImageList}{\param{int }{width}, \param{int }{height}, \param{const bool }{mask = TRUE},\rtfsp
28\param{int }{initialCount = 1}}
a660d684
KB
29
30Constructor specifying the image size, whether image masks should be created, and the initial size of the list.
31
32\wxheading{Parameters}
33
34\docparam{width}{Width of the images in the list.}
35
36\docparam{height}{Height of the images in the list.}
37
38\docparam{mask}{TRUE if masks should be created for all images.}
39
40\docparam{initialCount}{The initial size of the list.}
41
42\wxheading{See also}
43
44\helpref{wxImageList::Create}{wximagelistcreate}
45
46\membersection{wxImageList::Add}\label{wximagelistadd}
47
48\func{int}{Add}{\param{const wxBitmap\&}{ bitmap}, \param{const wxBitmap\&}{ mask = wxNullBitmap}}
49
50Adds a new image using a bitmap and optional mask bitmap.
51
52\func{int}{Add}{\param{const wxBitmap\&}{ bitmap}, \param{const wxColour\&}{ maskColour}}
53
54Adds a new image using a bitmap and mask colour.
55
884360bc 56\func{int}{Add}{\param{const wxIcon\&}{ icon}}
a660d684
KB
57
58Adds a new image using an icon.
59
60\wxheading{Parameters}
61
62\docparam{bitmap}{Bitmap representing the opaque areas of the image.}
63
64\docparam{mask}{Monochrome mask bitmap, representing the transparent areas of the image.}
65
66\docparam{maskColour}{Colour indicating which parts of the image are transparent.}
67
68\docparam{icon}{Icon to use as the image.}
69
70\wxheading{Return value}
71
72The new zero-based image index.
73
74\wxheading{Remarks}
75
76The original bitmap or icon is not affected by the {\bf Add} operation, and can be deleted afterwards.
77
78\membersection{wxImageList::Create}\label{wximagelistcreate}
79
eaaa6a06
JS
80\func{bool}{Create}{\param{int }{width}, \param{int }{height}, \param{const bool }{mask = TRUE},\rtfsp
81\param{int }{initialCount = 1}}
a660d684
KB
82
83Initializes the list. See \helpref{wxImageList::wxImageList}{wximagelistconstr} for details.
84
85\membersection{wxImageList::Draw}\label{wximagelistdraw}
86
eaaa6a06
JS
87\func{bool}{Draw}{\param{int}{ index}, \param{wxDC\&}{ dc}, \param{int }{x},\rtfsp
88\param{int }{x}, \param{int }{flags = wxIMAGELIST\_DRAW\_NORMAL},\rtfsp
a660d684
KB
89\param{const bool }{solidBackground = FALSE}}
90
91Draws a specified image onto a device context.
92
93\wxheading{Parameters}
94
95\docparam{index}{Image index, starting from zero.}
96
97\docparam{dc}{Device context to draw on.}
98
99\docparam{x}{X position on the device context.}
100
101\docparam{y}{Y position on the device context.}
102
103\docparam{flags}{How to draw the image. A bitlist of a selection of the following:
104
105\begin{twocollist}\itemsep=0pt
106\twocolitem{{\bf wxIMAGELIST\_DRAW\_NORMAL}}{Draw the image normally.}
107\twocolitem{{\bf wxIMAGELIST\_DRAW\_TRANSPARENT}}{Draw the image with transparency.}
108\twocolitem{{\bf wxIMAGELIST\_DRAW\_SELECTED}}{Draw the image in selected state.}
109\twocolitem{{\bf wxIMAGELIST\_DRAW\_FOCUSED}}{Draw the image in a focussed state.}
110\end{twocollist}
111}
112
113\docparam{solidBackground}{For optimisation - drawing can be faster if the function is told
114that the background is solid.}
115
116\membersection{wxImageList::GetImageCount}\label{wximagelistgetimagecount}
117
118\constfunc{int}{GetImageCount}{\void}
119
120Returns the number of images in the list.
121
122\membersection{wxImageList::Remove}\label{wximagelistremove}
123
eaaa6a06 124\func{bool}{Remove}{\param{int}{ index}}
a660d684
KB
125
126Removes the image at the given position.
127
128\membersection{wxImageList::RemoveAll}\label{wximagelistremoveall}
129
130\func{bool}{RemoveAll}{\void}
131
132Removes all the images in the list.
133
134\membersection{wxImageList::Replace}\label{wximagelistreplace}
135
eaaa6a06 136\func{bool}{Replace}{\param{int}{ index}, \param{const wxBitmap\&}{ bitmap}, \param{const wxBitmap\&}{ mask = wxNullBitmap}}
a660d684
KB
137
138Replaces the existing image with the new image.
139
eaaa6a06 140\func{bool}{Replace}{\param{int}{ index}, \param{const wxIcon\&}{ icon}}
a660d684
KB
141
142Replaces the existing image with the new image.
143
144\wxheading{Parameters}
145
146\docparam{bitmap}{Bitmap representing the opaque areas of the image.}
147
148\docparam{mask}{Monochrome mask bitmap, representing the transparent areas of the image.}
149
150\docparam{icon}{Icon to use as the image.}
151
152\wxheading{Return value}
153
154TRUE if the replacement was successful, FALSE otherwise.
155
156\wxheading{Remarks}
157
158The original bitmap or icon is not affected by the {\bf Replace} operation, and can be deleted afterwards.
159
160