]>
Commit | Line | Data |
---|---|---|
83df96d6 JS |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: icon.h | |
3 | // Purpose: wxIcon class | |
4 | // Author: Julian Smart | |
5 | // Modified by: | |
6 | // Created: 17/09/98 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) Julian Smart | |
65571936 | 9 | // Licence: wxWindows licence |
83df96d6 JS |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
12 | #ifndef _WX_ICON_H_ | |
13 | #define _WX_ICON_H_ | |
14 | ||
83df96d6 JS |
15 | #include "wx/bitmap.h" |
16 | ||
a11672a4 RR |
17 | //----------------------------------------------------------------------------- |
18 | // wxIcon | |
19 | //----------------------------------------------------------------------------- | |
83df96d6 | 20 | |
968eb2ef | 21 | class WXDLLIMPEXP_CORE wxIcon: public wxBitmap |
83df96d6 | 22 | { |
83df96d6 JS |
23 | public: |
24 | wxIcon(); | |
a11672a4 RR |
25 | wxIcon( const char **bits, int width=-1, int height=-1 ); |
26 | ||
27 | // For compatibility with wxMSW where desired size is sometimes required to | |
28 | // distinguish between multiple icons in a resource. | |
62ad3cb3 | 29 | wxIcon( const wxString& filename, wxBitmapType type = wxBITMAP_TYPE_XPM, |
a11672a4 RR |
30 | int WXUNUSED(desiredWidth)=-1, int WXUNUSED(desiredHeight)=-1 ) : |
31 | wxBitmap(filename, type) | |
32 | { | |
33 | } | |
34 | wxIcon( char **bits, int width=-1, int height=-1 ); | |
35 | ||
aaf7ab43 | 36 | wxIcon(const wxIconLocation& loc) |
6f12c2c9 | 37 | : wxBitmap(loc.GetFileName(), wxBITMAP_TYPE_ANY) |
aaf7ab43 VZ |
38 | { |
39 | } | |
40 | ||
aaf7ab43 VZ |
41 | bool operator==(const wxIcon& icon) const { return m_refData == icon.m_refData; } |
42 | bool operator!=(const wxIcon& icon) const { return !(*this == icon); } | |
a11672a4 RR |
43 | |
44 | // create from bitmap (which should have a mask unless it's monochrome): | |
45 | // there shouldn't be any implicit bitmap -> icon conversion (i.e. no | |
46 | // ctors, assignment operators...), but it's ok to have such function | |
47 | void CopyFromBitmap(const wxBitmap& bmp); | |
48 | ||
49 | private: | |
50 | DECLARE_DYNAMIC_CLASS(wxIcon) | |
83df96d6 JS |
51 | }; |
52 | ||
a11672a4 | 53 | |
83df96d6 JS |
54 | #endif |
55 | // _WX_ICON_H_ |