]> git.saurik.com Git - wxWidgets.git/blame - interface/wx/iconbndl.h
Fixed bug: wxPropertyGridInterface::SetPropertyReadOnly() with wxPG_DONT_RECURSE...
[wxWidgets.git] / interface / wx / iconbndl.h
CommitLineData
23324ae1
FM
1/////////////////////////////////////////////////////////////////////////////
2// Name: iconbndl.h
e54c96f1 3// Purpose: interface of wxIconBundle
23324ae1
FM
4// Author: wxWidgets team
5// RCS-ID: $Id$
6// Licence: wxWindows license
7/////////////////////////////////////////////////////////////////////////////
8
9/**
10 @class wxIconBundle
7c913512 11
427c415b
FM
12 This class contains multiple copies of an icon in different sizes.
13 It is typically used in wxDialog::SetIcons and wxTopLevelWindow::SetIcons.
7c913512 14
23324ae1 15 @library{wxcore}
427c415b 16 @category{gdi}
7c913512 17
23324ae1 18 @stdobjects
65874118 19 ::wxNullIconBundle
23324ae1
FM
20*/
21class wxIconBundle : public wxGDIObject
22{
23public:
23324ae1 24 /**
427c415b 25 Default ctor.
23324ae1
FM
26 */
27 wxIconBundle();
427c415b
FM
28
29 /**
30 Initializes the bundle with the icon(s) found in the file.
31 */
cee875e3
VS
32 wxIconBundle(const wxString& file, wxBitmapType type = wxBITMAP_TYPE_ANY);
33
34 /**
35 Initializes the bundle with the icon(s) found in the stream.
36
37 @since 2.9.0
38 */
39 wxIconBundle(wxInputStream& stream, wxBitmapType type = wxBITMAP_TYPE_ANY);
427c415b
FM
40
41 /**
42 Initializes the bundle with a single icon.
43 */
7c913512 44 wxIconBundle(const wxIcon& icon);
427c415b
FM
45
46 /**
47 Copy constructor.
48 */
7c913512 49 wxIconBundle(const wxIconBundle& ic);
23324ae1
FM
50
51 /**
52 Destructor.
53 */
adaaa686 54 virtual ~wxIconBundle();
23324ae1 55
427c415b 56 /**
cee875e3
VS
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.
60 */
61 void AddIcon(const wxString& file, wxBitmapType type = wxBITMAP_TYPE_ANY);
62
63 /**
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.
67
68 @since 2.9.0
427c415b 69 */
cee875e3 70 void AddIcon(wxInputStream& stream, wxBitmapType type = wxBITMAP_TYPE_ANY);
427c415b 71
23324ae1
FM
72 /**
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.
76 */
7c913512 77 void AddIcon(const wxIcon& icon);
23324ae1 78
23324ae1 79 /**
427c415b
FM
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.
83
84 If size = wxDefaultSize, returns the icon with size @c wxSYS_ICON_X and
85 @c wxSYS_ICON_Y.
23324ae1 86 */
328f5751 87 wxIcon GetIcon(const wxSize& size) const;
427c415b
FM
88
89 /**
90 Same as @code GetIcon( wxSize( size, size ) ) @endcode.
91 */
a44f3b5a 92 wxIcon GetIcon(wxCoord size = wxDefaultCoord) const;
23324ae1
FM
93
94 /**
427c415b 95 Returns the icon with exactly the given size or ::wxNullIcon if this
23324ae1
FM
96 size is not available.
97 */
328f5751 98 wxIcon GetIconOfExactSize(const wxSize& size) const;
23324ae1
FM
99
100 /**
427c415b
FM
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
103 a valid icon).
23324ae1 104 */
328f5751 105 bool IsEmpty() const;
23324ae1
FM
106
107 /**
427c415b 108 Assignment operator, using @ref overview_refcount "reference counting".
23324ae1 109 */
43c48e1e 110 wxIconBundle& operator=(const wxIconBundle& ic);
23324ae1
FM
111
112 /**
113 Equality operator. This returns @true if two icon bundles are equal.
114 */
115 bool operator ==(const wxIconBundle& ic);
427c415b
FM
116
117 /**
118 Inequality operator. This returns true if two icon bundles are not equal.
119 */
120 bool operator !=(const wxIconBundle& ic);
23324ae1 121};
e54c96f1
FM
122
123
124/**
65874118 125 An empty wxIconBundle.
e54c96f1
FM
126*/
127wxIconBundle wxNullIconBundle;
128
129