1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxIconBundle
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
12 This class contains multiple copies of an icon in different sizes.
13 It is typically used in wxDialog::SetIcons and wxTopLevelWindow::SetIcons.
21 class wxIconBundle
: public wxGDIObject
30 Initializes the bundle with the icon(s) found in the file.
32 wxIconBundle(const wxString
& file
, wxBitmapType type
= wxBITMAP_TYPE_ANY
);
35 Initializes the bundle with the icon(s) found in the stream.
39 wxIconBundle(wxInputStream
& stream
, wxBitmapType type
= wxBITMAP_TYPE_ANY
);
42 Initializes the bundle with a single icon.
44 wxIconBundle(const wxIcon
& icon
);
49 wxIconBundle(const wxIconBundle
& ic
);
54 virtual ~wxIconBundle();
57 Adds all the icons contained in the file to the bundle; if the
58 collection already contains icons with the same width and height, they
59 are replaced by the new ones.
61 void AddIcon(const wxString
& file
, wxBitmapType type
= wxBITMAP_TYPE_ANY
);
64 Adds all the icons contained in the stream to the bundle; if the
65 collection already contains icons with the same width and height, they
66 are replaced by the new ones.
70 void AddIcon(wxInputStream
& stream
, wxBitmapType type
= wxBITMAP_TYPE_ANY
);
73 Adds the icon to the collection; if the collection already
74 contains an icon with the same width and height, it is
75 replaced by the new one.
77 void AddIcon(const wxIcon
& icon
);
80 Returns the icon with the given size; if no such icon exists, returns
81 the icon with size @c wxSYS_ICON_X and @c wxSYS_ICON_Y; if no such icon
82 exists, returns the first icon in the bundle.
84 If size = wxDefaultSize, returns the icon with size @c wxSYS_ICON_X and
87 wxIcon
GetIcon(const wxSize
& size
) const;
90 Same as @code GetIcon( wxSize( size, size ) ) @endcode.
92 wxIcon
GetIcon(wxCoord size
= wxDefaultCoord
) const;
95 Returns the icon with exactly the given size or ::wxNullIcon if this
96 size is not available.
98 wxIcon
GetIconOfExactSize(const wxSize
& size
) const;
101 Returns @true if the bundle doesn't contain any icons, @false otherwise
102 (in which case a call to GetIcon() with default parameter should return
105 bool IsEmpty() const;
108 Assignment operator, using @ref overview_refcount "reference counting".
110 wxIconBundle
& operator=(const wxIconBundle
& ic
);
113 Equality operator. This returns @true if two icon bundles are equal.
115 bool operator ==(const wxIconBundle
& ic
);
118 Inequality operator. This returns true if two icon bundles are not equal.
120 bool operator !=(const wxIconBundle
& ic
);
125 An empty wxIconBundle.
127 wxIconBundle wxNullIconBundle
;