1998-05-20 10:01:55 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2000-07-15 15:51:35 -04:00
|
|
|
// Name: wx/generic/imaglist.h
|
1998-05-20 10:01:55 -04:00
|
|
|
// Purpose:
|
|
|
|
// Author: Robert Roebling
|
|
|
|
// Created: 01/02/97
|
|
|
|
// Id:
|
2003-03-17 05:34:04 -05:00
|
|
|
// Copyright: (c) 1998 Robert Roebling and Julian Smart
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
1998-05-20 10:01:55 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef __IMAGELISTH_G__
|
|
|
|
#define __IMAGELISTH_G__
|
|
|
|
|
|
|
|
#include "wx/defs.h"
|
2003-02-03 15:56:40 -05:00
|
|
|
#include "wx/list.h"
|
2005-02-27 05:54:09 -05:00
|
|
|
#include "wx/icon.h"
|
2003-02-03 15:56:40 -05:00
|
|
|
|
2007-07-09 06:09:52 -04:00
|
|
|
class WXDLLIMPEXP_FWD_CORE wxDC;
|
|
|
|
class WXDLLIMPEXP_FWD_CORE wxBitmap;
|
|
|
|
class WXDLLIMPEXP_FWD_CORE wxColour;
|
1998-05-20 10:01:55 -04:00
|
|
|
|
2002-07-22 04:51:49 -04:00
|
|
|
|
|
|
|
class WXDLLEXPORT wxGenericImageList: public wxObject
|
1998-05-20 10:01:55 -04:00
|
|
|
{
|
2000-07-15 15:51:35 -04:00
|
|
|
public:
|
2003-08-03 18:53:55 -04:00
|
|
|
wxGenericImageList() { m_width = m_height = 0; }
|
2004-06-17 12:22:36 -04:00
|
|
|
wxGenericImageList( int width, int height, bool mask = true, int initialCount = 1 );
|
2006-09-05 16:47:48 -04:00
|
|
|
virtual ~wxGenericImageList();
|
2004-06-17 12:22:36 -04:00
|
|
|
bool Create( int width, int height, bool mask = true, int initialCount = 1 );
|
1998-07-01 11:43:03 -04:00
|
|
|
bool Create();
|
2000-07-15 15:51:35 -04:00
|
|
|
|
2002-07-22 04:51:49 -04:00
|
|
|
virtual int GetImageCount() const;
|
|
|
|
virtual bool GetSize( int index, int &width, int &height ) const;
|
2000-07-15 15:51:35 -04:00
|
|
|
|
2000-03-05 09:15:47 -05:00
|
|
|
int Add( const wxBitmap& bitmap );
|
|
|
|
int Add( const wxBitmap& bitmap, const wxBitmap& mask );
|
|
|
|
int Add( const wxBitmap& bitmap, const wxColour& maskColour );
|
2005-02-27 05:36:58 -05:00
|
|
|
wxBitmap GetBitmap(int index) const;
|
|
|
|
wxIcon GetIcon(int index) const;
|
1998-07-01 11:43:03 -04:00
|
|
|
bool Replace( int index, const wxBitmap &bitmap );
|
2006-04-30 06:38:32 -04:00
|
|
|
bool Replace( int index, const wxBitmap &bitmap, const wxBitmap& mask );
|
1998-07-01 11:43:03 -04:00
|
|
|
bool Remove( int index );
|
|
|
|
bool RemoveAll();
|
1998-07-04 11:17:59 -04:00
|
|
|
|
2002-07-22 04:51:49 -04:00
|
|
|
virtual bool Draw(int index, wxDC& dc, int x, int y,
|
2000-07-15 15:51:35 -04:00
|
|
|
int flags = wxIMAGELIST_DRAW_NORMAL,
|
2004-06-17 12:22:36 -04:00
|
|
|
bool solidBackground = false);
|
1998-05-20 10:01:55 -04:00
|
|
|
|
2005-02-27 05:36:58 -05:00
|
|
|
// Internal use only
|
|
|
|
const wxBitmap *GetBitmapPtr(int index) const;
|
2000-07-15 15:51:35 -04:00
|
|
|
private:
|
1998-05-20 10:01:55 -04:00
|
|
|
wxList m_images;
|
2000-07-15 15:51:35 -04:00
|
|
|
|
1998-07-12 16:06:59 -04:00
|
|
|
int m_width;
|
|
|
|
int m_height;
|
2000-07-15 15:51:35 -04:00
|
|
|
|
2002-07-22 04:51:49 -04:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxGenericImageList)
|
1998-05-20 10:01:55 -04:00
|
|
|
};
|
|
|
|
|
2006-09-20 09:15:58 -04:00
|
|
|
#ifndef wxHAS_NATIVE_IMAGELIST
|
|
|
|
|
2002-07-22 19:03:03 -04:00
|
|
|
/*
|
|
|
|
* wxImageList has to be a real class or we have problems with
|
|
|
|
* the run-time information.
|
|
|
|
*/
|
|
|
|
|
|
|
|
class WXDLLEXPORT wxImageList: public wxGenericImageList
|
|
|
|
{
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxImageList)
|
|
|
|
|
|
|
|
public:
|
|
|
|
wxImageList() {}
|
|
|
|
|
2004-06-17 12:22:36 -04:00
|
|
|
wxImageList( int width, int height, bool mask = true, int initialCount = 1 )
|
2002-07-22 19:03:03 -04:00
|
|
|
: wxGenericImageList(width, height, mask, initialCount)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
};
|
2006-09-20 09:15:58 -04:00
|
|
|
#endif // !wxHAS_NATIVE_IMAGELIST
|
2002-07-22 19:03:03 -04:00
|
|
|
|
1998-05-20 10:01:55 -04:00
|
|
|
#endif // __IMAGELISTH_G__
|
|
|
|
|