]> git.saurik.com Git - wxWidgets.git/blame - include/wx/generic/imaglist.h
got rid of wxWindow::m_lDlgCode - now wxWANTS_CHARS style should work for all windows...
[wxWidgets.git] / include / wx / generic / imaglist.h
CommitLineData
c801d85f 1/////////////////////////////////////////////////////////////////////////////
f6bcfd97 2// Name: wx/generic/imaglist.h
c801d85f
KB
3// Purpose:
4// Author: Robert Roebling
5// Created: 01/02/97
6// Id:
7// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
f6bcfd97 8// Licence: wxWindows licence
c801d85f
KB
9/////////////////////////////////////////////////////////////////////////////
10
11#ifndef __IMAGELISTH_G__
12#define __IMAGELISTH_G__
13
14#ifdef __GNUG__
0d3820b3 15#pragma interface "imaglist.h"
c801d85f
KB
16#endif
17
18#include "wx/defs.h"
19#include "wx/gdicmn.h"
20#include "wx/bitmap.h"
21#include "wx/dc.h"
22
23/*
24 * wxImageList is used for wxListCtrl, wxTreeCtrl. These controls refer to
25 * images for their items by an index into an image list.
26 * A wxImageList is capable of creating images with optional masks from
27 * a variety of sources - a single bitmap plus a colour to indicate the mask,
28 * two bitmaps, or an icon.
29 *
30 * Image lists can also create and draw images used for drag and drop functionality.
31 * This is not yet implemented in wxImageList. We need to discuss a generic API
32 * for doing drag and drop and see whether it ties in with the Win95 view of it.
33 * See below for candidate functions and an explanation of how they might be
34 * used.
35 */
36
37// Flags for Draw
38#define wxIMAGELIST_DRAW_NORMAL 0x0001
39#define wxIMAGELIST_DRAW_TRANSPARENT 0x0002
40#define wxIMAGELIST_DRAW_SELECTED 0x0004
41#define wxIMAGELIST_DRAW_FOCUSED 0x0008
42
e2414cbe
RR
43// Flag values for Set/GetImageList
44enum {
45 wxIMAGE_LIST_NORMAL, // Normal icons
46 wxIMAGE_LIST_SMALL, // Small icons
47 wxIMAGE_LIST_STATE // State icons: unimplemented (see WIN32 documentation)
48};
49
0887f88e 50class WXDLLEXPORT wxImageList: public wxObject
c801d85f 51{
f6bcfd97 52public:
8dad2ab3 53 wxImageList() { }
219f895a 54 wxImageList( int width, int height, bool mask = TRUE, int initialCount = 1 );
0423b685 55 ~wxImageList();
f6bcfd97 56 bool Create( int width, int height, bool mask = TRUE, int initialCount = 1 );
0423b685 57 bool Create();
f6bcfd97 58
0423b685 59 int GetImageCount() const;
f6bcfd97
BP
60 bool GetSize( int index, int &width, int &height ) const;
61
4d449473
VS
62 int Add( const wxBitmap& bitmap );
63 int Add( const wxBitmap& bitmap, const wxBitmap& mask );
64 int Add( const wxBitmap& bitmap, const wxColour& maskColour );
d069d02e 65 const wxBitmap *GetBitmap(int index) const;
0423b685
VZ
66 bool Replace( int index, const wxBitmap &bitmap );
67 bool Remove( int index );
68 bool RemoveAll();
debe6624 69
f6bcfd97
BP
70 bool Draw(int index, wxDC& dc, int x, int y,
71 int flags = wxIMAGELIST_DRAW_NORMAL,
72 bool solidBackground = FALSE);
c801d85f 73
f6bcfd97 74private:
c801d85f 75 wxList m_images;
f6bcfd97 76
219f895a
RR
77 int m_width;
78 int m_height;
f6bcfd97
BP
79
80 DECLARE_DYNAMIC_CLASS(wxImageList)
c801d85f
KB
81};
82
83#endif // __IMAGELISTH_G__
84