]>
Commit | Line | Data |
---|---|---|
9b6dbb09 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 | ||
3399051e | 15 | #if defined(__GNUG__) && !defined(__APPLE__) |
9b6dbb09 JS |
16 | #pragma interface "icon.h" |
17 | #endif | |
18 | ||
19 | #include "wx/bitmap.h" | |
20 | ||
9b6dbb09 JS |
21 | // Icon |
22 | class WXDLLEXPORT wxIcon: public wxBitmap | |
23 | { | |
59e034c0 | 24 | DECLARE_DYNAMIC_CLASS(wxIcon); |
83df96d6 | 25 | |
9b6dbb09 | 26 | public: |
83df96d6 JS |
27 | wxIcon(); |
28 | ||
29 | // Copy constructors | |
30 | inline wxIcon(const wxIcon& icon) { Ref(icon); } | |
31 | ||
32 | // Initialize with XBM data | |
33 | wxIcon(const char bits[], int width, int height); | |
34 | ||
35 | // Initialize with XPM data | |
36 | wxIcon(const char **data); | |
37 | wxIcon(char **data); | |
38 | ||
1bc822df | 39 | wxIcon(const wxString& name, wxBitmapType type = wxBITMAP_TYPE_XPM, |
83df96d6 JS |
40 | int desiredWidth = -1, int desiredHeight = -1); |
41 | ~wxIcon(); | |
42 | ||
1bc822df | 43 | bool LoadFile(const wxString& name, wxBitmapType type = wxBITMAP_TYPE_XPM, |
83df96d6 | 44 | int desiredWidth = -1, int desiredHeight = -1); |
329e276a VS |
45 | |
46 | // create from bitmap (which should have a mask unless it's monochrome): | |
47 | // there shouldn't be any implicit bitmap -> icon conversion (i.e. no | |
48 | // ctors, assignment operators...), but it's ok to have such function | |
49 | void CopyFromBitmap(const wxBitmap& bmp); | |
83df96d6 | 50 | |
59e034c0 MB |
51 | inline wxIcon& operator = (const wxIcon& icon) |
52 | { if (*this == icon) return (*this); Ref(icon); return *this; } | |
53 | inline bool operator == (const wxIcon& icon) const | |
54 | { return m_refData == icon.m_refData; } | |
55 | inline bool operator != (const wxIcon& icon) const | |
56 | { return m_refData != icon.m_refData; } | |
9b6dbb09 JS |
57 | }; |
58 | ||
59e034c0 | 59 | #endif // _WX_ICON_H_ |