]> git.saurik.com Git - wxWidgets.git/blob - include/wx/generic/imaglist.h
No real changes, just replace -1 with wxNOT_FOUND in wxBookCtrl code.
[wxWidgets.git] / include / wx / generic / imaglist.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/generic/imaglist.h
3 // Purpose:
4 // Author: Robert Roebling
5 // Created: 01/02/97
6 // Id: $Id$
7 // Copyright: (c) 1998 Robert Roebling and Julian Smart
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
10
11 #ifndef _WX_IMAGLISTG_H_
12 #define _WX_IMAGLISTG_H_
13
14 #include "wx/list.h"
15
16 class WXDLLIMPEXP_FWD_CORE wxDC;
17 class WXDLLIMPEXP_FWD_CORE wxBitmap;
18 class WXDLLIMPEXP_FWD_CORE wxIcon;
19 class WXDLLIMPEXP_FWD_CORE wxColour;
20
21
22 class WXDLLIMPEXP_CORE wxGenericImageList: public wxObject
23 {
24 public:
25 wxGenericImageList() { m_width = m_height = 0; }
26 wxGenericImageList( int width, int height, bool mask = true, int initialCount = 1 );
27 virtual ~wxGenericImageList();
28 bool Create( int width, int height, bool mask = true, int initialCount = 1 );
29 bool Create();
30
31 virtual int GetImageCount() const;
32 virtual bool GetSize( int index, int &width, int &height ) const;
33
34 int Add( const wxBitmap& bitmap );
35 int Add( const wxBitmap& bitmap, const wxBitmap& mask );
36 int Add( const wxBitmap& bitmap, const wxColour& maskColour );
37 wxBitmap GetBitmap(int index) const;
38 wxIcon GetIcon(int index) const;
39 bool Replace( int index, const wxBitmap &bitmap );
40 bool Replace( int index, const wxBitmap &bitmap, const wxBitmap& mask );
41 bool Remove( int index );
42 bool RemoveAll();
43
44 virtual bool Draw(int index, wxDC& dc, int x, int y,
45 int flags = wxIMAGELIST_DRAW_NORMAL,
46 bool solidBackground = false);
47
48 // Internal use only
49 const wxBitmap *GetBitmapPtr(int index) const;
50 private:
51 wxObjectList m_images;
52
53 int m_width;
54 int m_height;
55
56 DECLARE_DYNAMIC_CLASS_NO_COPY(wxGenericImageList)
57 };
58
59 #ifndef wxHAS_NATIVE_IMAGELIST
60
61 /*
62 * wxImageList has to be a real class or we have problems with
63 * the run-time information.
64 */
65
66 class WXDLLIMPEXP_CORE wxImageList: public wxGenericImageList
67 {
68 DECLARE_DYNAMIC_CLASS(wxImageList)
69
70 public:
71 wxImageList() {}
72
73 wxImageList( int width, int height, bool mask = true, int initialCount = 1 )
74 : wxGenericImageList(width, height, mask, initialCount)
75 {
76 }
77 };
78 #endif // !wxHAS_NATIVE_IMAGELIST
79
80 #endif // _WX_IMAGLISTG_H_