]> git.saurik.com Git - wxWidgets.git/blob - include/wx/stubs/imaglist.h
some minor changes in wxLogWindow
[wxWidgets.git] / include / wx / stubs / imaglist.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: imaglist.h
3 // Purpose: wxImageList class
4 // Author: AUTHOR
5 // Modified by:
6 // Created: ??/??/98
7 // RCS-ID: $Id$
8 // Copyright: (c) AUTHOR
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_IMAGLIST_H_
13 #define _WX_IMAGLIST_H_
14
15 #ifdef __GNUG__
16 #pragma interface "imaglist.h"
17 #endif
18
19 #include "wx/bitmap.h"
20
21 /*
22 * wxImageList is used for wxListCtrl, wxTreeCtrl. These controls refer to
23 * images for their items by an index into an image list.
24 * A wxImageList is capable of creating images with optional masks from
25 * a variety of sources - a single bitmap plus a colour to indicate the mask,
26 * two bitmaps, or an icon.
27 *
28 */
29
30 // Flags for Draw
31 #define wxIMAGELIST_DRAW_NORMAL 0x0001
32 #define wxIMAGELIST_DRAW_TRANSPARENT 0x0002
33 #define wxIMAGELIST_DRAW_SELECTED 0x0004
34 #define wxIMAGELIST_DRAW_FOCUSED 0x0008
35
36 // Flag values for Set/GetImageList
37 enum {
38 wxIMAGE_LIST_NORMAL, // Normal icons
39 wxIMAGE_LIST_SMALL, // Small icons
40 wxIMAGE_LIST_STATE // State icons: unimplemented (see WIN32 documentation)
41 };
42
43 // Eventually we'll make this a reference-counted wxGDIObject. For
44 // now, the app must take care of ownership issues. That is, the
45 // image lists must be explicitly deleted after the control(s) that uses them
46 // is (are) deleted, or when the app exits.
47 class WXDLLEXPORT wxImageList: public wxObject
48 {
49 DECLARE_DYNAMIC_CLASS(wxImageList)
50 public:
51 /*
52 * Public interface
53 */
54
55 wxImageList();
56
57 // Creates an image list.
58 // Specify the width and height of the images in the list,
59 // whether there are masks associated with them (e.g. if creating images
60 // from icons), and the initial size of the list.
61 inline wxImageList(int width, int height, bool mask = TRUE, int initialCount = 1)
62 {
63 Create(width, height, mask, initialCount);
64 }
65 ~wxImageList();
66
67
68 // Attributes
69 ////////////////////////////////////////////////////////////////////////////
70
71 // Returns the number of images in the image list.
72 int GetImageCount() const;
73
74 // Operations
75 ////////////////////////////////////////////////////////////////////////////
76
77 // Creates an image list
78 // width, height specify the size of the images in the list (all the same).
79 // mask specifies whether the images have masks or not.
80 // initialNumber is the initial number of images to reserve.
81 bool Create(int width, int height, bool mask = TRUE, int initialNumber = 1);
82
83 // Adds a bitmap, and optionally a mask bitmap.
84 // Note that wxImageList creates *new* bitmaps, so you may delete
85 // 'bitmap' and 'mask' after calling Add.
86 int Add(const wxBitmap& bitmap, const wxBitmap& mask = wxNullBitmap);
87
88 // Adds a bitmap, using the specified colour to create the mask bitmap
89 // Note that wxImageList creates *new* bitmaps, so you may delete
90 // 'bitmap' after calling Add.
91 int Add(const wxBitmap& bitmap, const wxColour& maskColour);
92
93 // Adds a bitmap and mask from an icon.
94 int Add(const wxIcon& icon);
95
96 // Replaces a bitmap, optionally passing a mask bitmap.
97 // Note that wxImageList creates new bitmaps, so you may delete
98 // 'bitmap' and 'mask' after calling Replace.
99 bool Replace(int index, const wxBitmap& bitmap, const wxBitmap& mask = wxNullBitmap);
100
101 /* Not supported by Win95
102 // Replacing a bitmap, using the specified colour to create the mask bitmap
103 // Note that wxImageList creates new bitmaps, so you may delete
104 // 'bitmap'.
105 bool Replace(int index, const wxBitmap& bitmap, const wxColour& maskColour);
106 */
107
108 // Replaces a bitmap and mask from an icon.
109 // You can delete 'icon' after calling Replace.
110 bool Replace(int index, const wxIcon& icon);
111
112 // Removes the image at the given index.
113 bool Remove(int index);
114
115 // Remove all images
116 bool RemoveAll();
117
118 // Draws the given image on a dc at the specified position.
119 // If 'solidBackground' is TRUE, Draw sets the image list background
120 // colour to the background colour of the wxDC, to speed up
121 // drawing by eliminating masked drawing where possible.
122 bool Draw(int index, wxDC& dc, int x, int y,
123 int flags = wxIMAGELIST_DRAW_NORMAL, bool solidBackground = FALSE);
124
125 /* TODO (optional?)
126 wxIcon *MakeIcon(int index);
127 */
128
129 /* TODO
130 // Implementation
131 ////////////////////////////////////////////////////////////////////////////
132
133 // Returns the native image list handle
134 inline WXHIMAGELIST GetHIMAGELIST() const { return m_hImageList; }
135
136 protected:
137 WXHIMAGELIST m_hImageList;
138 */
139
140 };
141
142 #endif
143 // _WX_IMAGLIST_H_