1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/generic/imaglist.h
4 // Author: Robert Roebling
7 // Copyright: (c) 1998 Robert Roebling and Julian Smart
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 #ifndef __IMAGELISTH_G__
12 #define __IMAGELISTH_G__
14 #if defined(__GNUG__) && !defined(__APPLE__)
15 #pragma interface "imaglist.h"
21 class WXDLLEXPORT wxDC
;
22 class WXDLLEXPORT wxBitmap
;
23 class WXDLLEXPORT wxColour
;
26 * wxImageList is used for wxListCtrl, wxTreeCtrl. These controls refer to
27 * images for their items by an index into an image list.
28 * A wxImageList is capable of creating images with optional masks from
29 * a variety of sources - a single bitmap plus a colour to indicate the mask,
30 * two bitmaps, or an icon.
32 * Image lists can also create and draw images used for drag and drop functionality.
33 * This is not yet implemented in wxImageList. We need to discuss a generic API
34 * for doing drag and drop and see whether it ties in with the Win95 view of it.
35 * See below for candidate functions and an explanation of how they might be
39 #if !defined(wxIMAGELIST_DRAW_NORMAL)
42 #define wxIMAGELIST_DRAW_NORMAL 0x0001
43 #define wxIMAGELIST_DRAW_TRANSPARENT 0x0002
44 #define wxIMAGELIST_DRAW_SELECTED 0x0004
45 #define wxIMAGELIST_DRAW_FOCUSED 0x0008
47 // Flag values for Set/GetImageList
49 wxIMAGE_LIST_NORMAL
, // Normal icons
50 wxIMAGE_LIST_SMALL
, // Small icons
51 wxIMAGE_LIST_STATE
// State icons: unimplemented (see WIN32 documentation)
56 class WXDLLEXPORT wxGenericImageList
: public wxObject
59 wxGenericImageList() { }
60 wxGenericImageList( int width
, int height
, bool mask
= TRUE
, int initialCount
= 1 );
61 ~wxGenericImageList();
62 bool Create( int width
, int height
, bool mask
= TRUE
, int initialCount
= 1 );
65 virtual int GetImageCount() const;
66 virtual bool GetSize( int index
, int &width
, int &height
) const;
68 int Add( const wxBitmap
& bitmap
);
69 int Add( const wxBitmap
& bitmap
, const wxBitmap
& mask
);
70 int Add( const wxBitmap
& bitmap
, const wxColour
& maskColour
);
71 const wxBitmap
*GetBitmap(int index
) const;
72 bool Replace( int index
, const wxBitmap
&bitmap
);
73 bool Remove( int index
);
76 virtual bool Draw(int index
, wxDC
& dc
, int x
, int y
,
77 int flags
= wxIMAGELIST_DRAW_NORMAL
,
78 bool solidBackground
= FALSE
);
86 DECLARE_DYNAMIC_CLASS(wxGenericImageList
)
89 #if !defined(__WXMSW__) || defined(__WIN16__) || defined(__WXUNIVERSAL__)
91 * wxImageList has to be a real class or we have problems with
92 * the run-time information.
95 class WXDLLEXPORT wxImageList
: public wxGenericImageList
97 DECLARE_DYNAMIC_CLASS(wxImageList
)
102 wxImageList( int width
, int height
, bool mask
= TRUE
, int initialCount
= 1 )
103 : wxGenericImageList(width
, height
, mask
, initialCount
)
107 #endif // !__WXMSW__ || __WIN16__ || __WXUNIVERSAL__
109 #endif // __IMAGELISTH_G__