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__
18 class WXDLLEXPORT wxDC
;
19 class WXDLLEXPORT wxBitmap
;
20 class WXDLLEXPORT wxColour
;
23 * wxImageList is used for wxListCtrl, wxTreeCtrl. These controls refer to
24 * images for their items by an index into an image list.
25 * A wxImageList is capable of creating images with optional masks from
26 * a variety of sources - a single bitmap plus a colour to indicate the mask,
27 * two bitmaps, or an icon.
29 * Image lists can also create and draw images used for drag and drop functionality.
30 * This is not yet implemented in wxImageList. We need to discuss a generic API
31 * for doing drag and drop and see whether it ties in with the Win95 view of it.
32 * See below for candidate functions and an explanation of how they might be
36 #if !defined(wxIMAGELIST_DRAW_NORMAL)
39 #define wxIMAGELIST_DRAW_NORMAL 0x0001
40 #define wxIMAGELIST_DRAW_TRANSPARENT 0x0002
41 #define wxIMAGELIST_DRAW_SELECTED 0x0004
42 #define wxIMAGELIST_DRAW_FOCUSED 0x0008
44 // Flag values for Set/GetImageList
46 wxIMAGE_LIST_NORMAL
, // Normal icons
47 wxIMAGE_LIST_SMALL
, // Small icons
48 wxIMAGE_LIST_STATE
// State icons: unimplemented (see WIN32 documentation)
53 class WXDLLEXPORT wxGenericImageList
: public wxObject
56 wxGenericImageList() { m_width
= m_height
= 0; }
57 wxGenericImageList( int width
, int height
, bool mask
= true, int initialCount
= 1 );
58 ~wxGenericImageList();
59 bool Create( int width
, int height
, bool mask
= true, int initialCount
= 1 );
62 virtual int GetImageCount() const;
63 virtual bool GetSize( int index
, int &width
, int &height
) const;
65 int Add( const wxBitmap
& bitmap
);
66 int Add( const wxBitmap
& bitmap
, const wxBitmap
& mask
);
67 int Add( const wxBitmap
& bitmap
, const wxColour
& maskColour
);
68 wxBitmap
GetBitmap(int index
) const;
69 wxIcon
GetIcon(int index
) const;
70 bool Replace( int index
, const wxBitmap
&bitmap
);
71 bool Remove( int index
);
74 virtual bool Draw(int index
, wxDC
& dc
, int x
, int y
,
75 int flags
= wxIMAGELIST_DRAW_NORMAL
,
76 bool solidBackground
= false);
79 const wxBitmap
*GetBitmapPtr(int index
) const;
86 DECLARE_DYNAMIC_CLASS(wxGenericImageList
)
89 #if !defined(__WXMSW__) || 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__ || __WXUNIVERSAL__
109 #endif // __IMAGELISTH_G__