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