]>
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 | |
9 | // Licence: wxWindows licence | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #ifndef _WX_ICON_H_ | |
13 | #define _WX_ICON_H_ | |
14 | ||
edf6a063 | 15 | #if defined(__GNUG__) && !defined(__APPLE__) |
83df96d6 JS |
16 | #pragma interface "icon.h" |
17 | #endif | |
18 | ||
19 | #include "wx/bitmap.h" | |
20 | ||
a11672a4 RR |
21 | //----------------------------------------------------------------------------- |
22 | // wxIcon | |
23 | //----------------------------------------------------------------------------- | |
83df96d6 | 24 | |
a11672a4 | 25 | class wxIcon: public wxBitmap |
83df96d6 | 26 | { |
83df96d6 JS |
27 | public: |
28 | wxIcon(); | |
a11672a4 RR |
29 | wxIcon( const wxIcon& icon); |
30 | wxIcon( const char **bits, int width=-1, int height=-1 ); | |
31 | ||
32 | // For compatibility with wxMSW where desired size is sometimes required to | |
33 | // distinguish between multiple icons in a resource. | |
62ad3cb3 | 34 | wxIcon( const wxString& filename, wxBitmapType type = wxBITMAP_TYPE_XPM, |
a11672a4 RR |
35 | int WXUNUSED(desiredWidth)=-1, int WXUNUSED(desiredHeight)=-1 ) : |
36 | wxBitmap(filename, type) | |
37 | { | |
38 | } | |
39 | wxIcon( char **bits, int width=-1, int height=-1 ); | |
40 | ||
aaf7ab43 | 41 | wxIcon(const wxIconLocation& loc) |
6f12c2c9 | 42 | : wxBitmap(loc.GetFileName(), wxBITMAP_TYPE_ANY) |
aaf7ab43 VZ |
43 | { |
44 | } | |
45 | ||
46 | wxIcon& operator=(const wxIcon& icon); | |
47 | bool operator==(const wxIcon& icon) const { return m_refData == icon.m_refData; } | |
48 | bool operator!=(const wxIcon& icon) const { return !(*this == icon); } | |
a11672a4 RR |
49 | |
50 | // create from bitmap (which should have a mask unless it's monochrome): | |
51 | // there shouldn't be any implicit bitmap -> icon conversion (i.e. no | |
52 | // ctors, assignment operators...), but it's ok to have such function | |
53 | void CopyFromBitmap(const wxBitmap& bmp); | |
54 | ||
55 | private: | |
56 | DECLARE_DYNAMIC_CLASS(wxIcon) | |
83df96d6 JS |
57 | }; |
58 | ||
a11672a4 | 59 | |
83df96d6 JS |
60 | #endif |
61 | // _WX_ICON_H_ |