wxWidgets/include/wx/iconbndl.h
Mattia Barbon f618020a15 wxIconBundle implementation.
wxTLW::SetIcons() properly implemented for wxMotif, wxGTK, wxMSW, wxX11, wxUniversal
Placeholders that just call SetIcon for wxOS2 and wxMac.
Regenerated makefiles.
Added hardwired wxSYS_ICON_X/Y = 32 for wxGTK.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14809 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2002-03-26 21:54:23 +00:00

74 lines
2.2 KiB
C++

///////////////////////////////////////////////////////////////////////////////
// Name: wx/iconbndl.h
// Purpose: wxIconBundle
// Author: Mattia barbon
// Modified by:
// Created: 23.03.02
// RCS-ID: $Id$
// Copyright: (c) Mattia Barbon
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_ICONBNDL_H_
#define _WX_ICONBNDL_H_
#ifdef __GNUG__
#pragma interface "iconbndl.h"
#endif
#include "dynarray.h"
// for wxSize
#include "wx/gdicmn.h"
class WXDLLEXPORT wxIcon;
class WXDLLEXPORT wxString;
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
wxIconBundle() {}
// initializes the bundle with the icon(s) found in the file
wxIconBundle( const wxString& file, long type )
{ AddIcon( file, type ); }
// initializes the bundle with a single icon
wxIconBundle( const wxIcon& icon )
{ AddIcon( icon ); }
const wxIconBundle& operator =( const wxIconBundle& ic );
wxIconBundle( const wxIconBundle& ic )
{ *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 ) )
const wxIcon& GetIcon( wxCoord size = -1 ) const
{ return GetIcon( wxSize( size, size ) ); }
private:
// delete all icons
void DeleteIcons();
public:
wxIconArray m_icons;
};
#endif
// _WX_ICONBNDL_H_