2002-03-26 21:54:23 +00:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: wx/iconbndl.h
|
|
|
|
// Purpose: wxIconBundle
|
|
|
|
// Author: Mattia barbon
|
|
|
|
// Modified by:
|
|
|
|
// Created: 23.03.02
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) Mattia Barbon
|
2004-05-23 20:53:33 +00:00
|
|
|
// Licence: wxWindows licence
|
2002-03-26 21:54:23 +00:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_ICONBNDL_H_
|
|
|
|
#define _WX_ICONBNDL_H_
|
|
|
|
|
2002-03-28 14:14:00 +00:00
|
|
|
#include "wx/dynarray.h"
|
2002-03-26 21:54:23 +00:00
|
|
|
// for wxSize
|
|
|
|
#include "wx/gdicmn.h"
|
|
|
|
|
2004-06-16 21:02:29 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxIcon;
|
|
|
|
class WXDLLIMPEXP_BASE wxString;
|
2002-03-26 21:54:23 +00:00
|
|
|
|
|
|
|
WX_DECLARE_EXPORTED_OBJARRAY( wxIcon, wxIconArray );
|
|
|
|
|
|
|
|
// this class can't load bitmaps of type wxBITMAP_TYPE_ICO_RESOURCE,
|
|
|
|
// if you need them, you have to load them manually and call
|
|
|
|
// wxIconCollection::AddIcon
|
|
|
|
class WXDLLEXPORT wxIconBundle
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
// default constructor
|
2002-05-07 21:58:27 +00:00
|
|
|
wxIconBundle() : m_icons() {}
|
2002-03-26 21:54:23 +00:00
|
|
|
// initializes the bundle with the icon(s) found in the file
|
2002-05-07 21:58:27 +00:00
|
|
|
wxIconBundle( const wxString& file, long type ) : m_icons()
|
2002-03-26 21:54:23 +00:00
|
|
|
{ AddIcon( file, type ); }
|
|
|
|
// initializes the bundle with a single icon
|
2002-05-07 21:58:27 +00:00
|
|
|
wxIconBundle( const wxIcon& icon ) : m_icons()
|
2002-03-26 21:54:23 +00:00
|
|
|
{ AddIcon( icon ); }
|
|
|
|
|
|
|
|
const wxIconBundle& operator =( const wxIconBundle& ic );
|
2002-05-07 21:58:27 +00:00
|
|
|
wxIconBundle( const wxIconBundle& ic ) : m_icons()
|
2002-03-26 21:54:23 +00:00
|
|
|
{ *this = ic; }
|
|
|
|
|
|
|
|
~wxIconBundle() { DeleteIcons(); }
|
|
|
|
|
|
|
|
// adds all the icons contained in the file to the collection,
|
|
|
|
// if the collection already contains icons with the same
|
|
|
|
// width and height, they are replaced
|
|
|
|
void AddIcon( const wxString& file, long type );
|
|
|
|
// adds the icon to the collection, if the collection already
|
|
|
|
// contains an icon with the same width and height, it is
|
|
|
|
// replaced
|
|
|
|
void AddIcon( const wxIcon& icon );
|
|
|
|
|
|
|
|
// returns the icon with the given size; if no such icon exists,
|
|
|
|
// returns the icon with size wxSYS_ICON_[XY]; if no such icon exists,
|
|
|
|
// returns the first icon in the bundle
|
|
|
|
const wxIcon& GetIcon( const wxSize& size ) const;
|
|
|
|
// equivalent to GetIcon( wxSize( size, size ) )
|
2004-09-16 18:13:32 +00:00
|
|
|
const wxIcon& GetIcon( wxCoord size = wxDefaultCoord ) const
|
2002-03-26 21:54:23 +00:00
|
|
|
{ return GetIcon( wxSize( size, size ) ); }
|
|
|
|
private:
|
|
|
|
// delete all icons
|
|
|
|
void DeleteIcons();
|
|
|
|
public:
|
|
|
|
wxIconArray m_icons;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
// _WX_ICONBNDL_H_
|