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