]>
Commit | Line | Data |
---|---|---|
c801d85f | 1 | ///////////////////////////////////////////////////////////////////////////// |
f6bcfd97 | 2 | // Name: wx/generic/imaglist.h |
c801d85f KB |
3 | // Purpose: |
4 | // Author: Robert Roebling | |
5 | // Created: 01/02/97 | |
6 | // Id: | |
371a5b4e | 7 | // Copyright: (c) 1998 Robert Roebling and Julian Smart |
65571936 | 8 | // Licence: wxWindows licence |
c801d85f KB |
9 | ///////////////////////////////////////////////////////////////////////////// |
10 | ||
11 | #ifndef __IMAGELISTH_G__ | |
12 | #define __IMAGELISTH_G__ | |
13 | ||
c801d85f | 14 | #include "wx/defs.h" |
00dd3b18 | 15 | #include "wx/list.h" |
f45fac95 | 16 | #include "wx/icon.h" |
00dd3b18 MB |
17 | |
18 | class WXDLLEXPORT wxDC; | |
19 | class WXDLLEXPORT wxBitmap; | |
20 | class WXDLLEXPORT wxColour; | |
c801d85f | 21 | |
3cd94a0d JS |
22 | |
23 | class WXDLLEXPORT wxGenericImageList: public wxObject | |
c801d85f | 24 | { |
f6bcfd97 | 25 | public: |
77bf4cef | 26 | wxGenericImageList() { m_width = m_height = 0; } |
ca65c044 | 27 | wxGenericImageList( int width, int height, bool mask = true, int initialCount = 1 ); |
d3c7fc99 | 28 | virtual ~wxGenericImageList(); |
ca65c044 | 29 | bool Create( int width, int height, bool mask = true, int initialCount = 1 ); |
0423b685 | 30 | bool Create(); |
f6bcfd97 | 31 | |
3cd94a0d JS |
32 | virtual int GetImageCount() const; |
33 | virtual bool GetSize( int index, int &width, int &height ) const; | |
f6bcfd97 | 34 | |
4d449473 VS |
35 | int Add( const wxBitmap& bitmap ); |
36 | int Add( const wxBitmap& bitmap, const wxBitmap& mask ); | |
37 | int Add( const wxBitmap& bitmap, const wxColour& maskColour ); | |
49bf4e3e JS |
38 | wxBitmap GetBitmap(int index) const; |
39 | wxIcon GetIcon(int index) const; | |
0423b685 | 40 | bool Replace( int index, const wxBitmap &bitmap ); |
f644bc11 | 41 | bool Replace( int index, const wxBitmap &bitmap, const wxBitmap& mask ); |
0423b685 VZ |
42 | bool Remove( int index ); |
43 | bool RemoveAll(); | |
debe6624 | 44 | |
3cd94a0d | 45 | virtual bool Draw(int index, wxDC& dc, int x, int y, |
f6bcfd97 | 46 | int flags = wxIMAGELIST_DRAW_NORMAL, |
ca65c044 | 47 | bool solidBackground = false); |
c801d85f | 48 | |
49bf4e3e JS |
49 | // Internal use only |
50 | const wxBitmap *GetBitmapPtr(int index) const; | |
f6bcfd97 | 51 | private: |
c801d85f | 52 | wxList m_images; |
f6bcfd97 | 53 | |
219f895a RR |
54 | int m_width; |
55 | int m_height; | |
f6bcfd97 | 56 | |
3cd94a0d | 57 | DECLARE_DYNAMIC_CLASS(wxGenericImageList) |
c801d85f KB |
58 | }; |
59 | ||
1a27de88 VZ |
60 | #ifndef wxHAS_NATIVE_IMAGELIST |
61 | ||
b31989e2 JS |
62 | /* |
63 | * wxImageList has to be a real class or we have problems with | |
64 | * the run-time information. | |
65 | */ | |
66 | ||
67 | class WXDLLEXPORT wxImageList: public wxGenericImageList | |
68 | { | |
69 | DECLARE_DYNAMIC_CLASS(wxImageList) | |
70 | ||
71 | public: | |
72 | wxImageList() {} | |
73 | ||
ca65c044 | 74 | wxImageList( int width, int height, bool mask = true, int initialCount = 1 ) |
b31989e2 JS |
75 | : wxGenericImageList(width, height, mask, initialCount) |
76 | { | |
77 | } | |
78 | }; | |
1a27de88 | 79 | #endif // !wxHAS_NATIVE_IMAGELIST |
b31989e2 | 80 | |
c801d85f KB |
81 | #endif // __IMAGELISTH_G__ |
82 |