1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxIconBundle
4 // Author: wxWidgets team
6 // Licence: wxWindows licence
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.
37 Notice that the @a stream must be seekable, at least if it contains
38 more than one icon. The stream pointer is positioned after the last
39 icon read from the stream when this function returns.
43 wxIconBundle(wxInputStream
& stream
, wxBitmapType type
= wxBITMAP_TYPE_ANY
);
46 Initializes the bundle with a single icon.
48 wxIconBundle(const wxIcon
& icon
);
53 wxIconBundle(const wxIconBundle
& ic
);
58 virtual ~wxIconBundle();
61 Adds all the icons contained in the file to the bundle; if the
62 collection already contains icons with the same width and height, they
63 are replaced by the new ones.
65 void AddIcon(const wxString
& file
, wxBitmapType type
= wxBITMAP_TYPE_ANY
);
68 Adds all the icons contained in the stream to the bundle; if the
69 collection already contains icons with the same width and height, they
70 are replaced by the new ones.
72 Notice that, as well as in the constructor loading the icon bundle from
73 stream, the @a stream must be seekable, at least if more than one icon
74 is to be loaded from it.
78 void AddIcon(wxInputStream
& stream
, wxBitmapType type
= wxBITMAP_TYPE_ANY
);
81 Adds the icon to the collection; if the collection already
82 contains an icon with the same width and height, it is
83 replaced by the new one.
85 void AddIcon(const wxIcon
& icon
);
88 Returns the icon with the given size; if no such icon exists, returns
89 the icon with size @c wxSYS_ICON_X and @c wxSYS_ICON_Y; if no such icon
90 exists, returns the first icon in the bundle.
92 If size = wxDefaultSize, returns the icon with size @c wxSYS_ICON_X and
95 wxIcon
GetIcon(const wxSize
& size
) const;
98 Same as @code GetIcon( wxSize( size, size ) ) @endcode.
100 wxIcon
GetIcon(wxCoord size
= wxDefaultCoord
) const;
103 Returns the icon with exactly the given size or ::wxNullIcon if this
104 size is not available.
106 wxIcon
GetIconOfExactSize(const wxSize
& size
) const;
109 return the number of available icons
111 size_t GetIconCount() const;
114 return the icon at index (must be < GetIconCount())
116 wxIcon
GetIconByIndex(size_t n
) const;
119 Returns @true if the bundle doesn't contain any icons, @false otherwise
120 (in which case a call to GetIcon() with default parameter should return
123 bool IsEmpty() const;
126 Assignment operator, using @ref overview_refcount "reference counting".
128 wxIconBundle
& operator=(const wxIconBundle
& ic
);
134 An empty wxIconBundle.
136 wxIconBundle wxNullIconBundle
;