]>
Commit | Line | Data |
---|---|---|
83df96d6 | 1 | ///////////////////////////////////////////////////////////////////////////// |
71451a6d VS |
2 | // Name: wx/generic/icon.h |
3 | // Purpose: wxIcon implementation for ports where it's same as wxBitmap | |
83df96d6 JS |
4 | // Author: Julian Smart |
5 | // Modified by: | |
6 | // Created: 17/09/98 | |
83df96d6 | 7 | // Copyright: (c) Julian Smart |
71451a6d | 8 | // Licence: wxWindows licence |
83df96d6 JS |
9 | ///////////////////////////////////////////////////////////////////////////// |
10 | ||
71451a6d VS |
11 | #ifndef _WX_GENERIC_ICON_H_ |
12 | #define _WX_GENERIC_ICON_H_ | |
83df96d6 | 13 | |
83df96d6 JS |
14 | #include "wx/bitmap.h" |
15 | ||
a11672a4 RR |
16 | //----------------------------------------------------------------------------- |
17 | // wxIcon | |
18 | //----------------------------------------------------------------------------- | |
83df96d6 | 19 | |
968eb2ef | 20 | class WXDLLIMPEXP_CORE wxIcon: public wxBitmap |
83df96d6 | 21 | { |
83df96d6 JS |
22 | public: |
23 | wxIcon(); | |
71451a6d | 24 | |
e45080c1 PC |
25 | wxIcon(const char* const* bits); |
26 | #ifdef wxNEEDS_CHARPP | |
27 | wxIcon(char **bits); | |
28 | #endif | |
a11672a4 RR |
29 | |
30 | // For compatibility with wxMSW where desired size is sometimes required to | |
31 | // distinguish between multiple icons in a resource. | |
71451a6d | 32 | wxIcon( const wxString& filename, |
cbea3ec6 | 33 | wxBitmapType type = wxICON_DEFAULT_TYPE, |
a11672a4 RR |
34 | int WXUNUSED(desiredWidth)=-1, int WXUNUSED(desiredHeight)=-1 ) : |
35 | wxBitmap(filename, type) | |
36 | { | |
37 | } | |
a11672a4 | 38 | |
aaf7ab43 | 39 | wxIcon(const wxIconLocation& loc) |
6f12c2c9 | 40 | : wxBitmap(loc.GetFileName(), wxBITMAP_TYPE_ANY) |
aaf7ab43 VZ |
41 | { |
42 | } | |
43 | ||
2ffeccb3 | 44 | bool LoadFile(const wxString& name, wxBitmapType flags, |
6f97a0d5 | 45 | int WXUNUSED(desiredWidth), int WXUNUSED(desiredHeight)) |
9b3eb4aa VZ |
46 | { return wxBitmap::LoadFile(name, flags); } |
47 | ||
48 | // unhide the base class version | |
2ffeccb3 VZ |
49 | virtual bool LoadFile(const wxString& name, |
50 | wxBitmapType flags = wxICON_DEFAULT_TYPE) | |
9b3eb4aa | 51 | { return wxBitmap::LoadFile(name, flags); } |
cbea3ec6 | 52 | |
a11672a4 RR |
53 | // create from bitmap (which should have a mask unless it's monochrome): |
54 | // there shouldn't be any implicit bitmap -> icon conversion (i.e. no | |
55 | // ctors, assignment operators...), but it's ok to have such function | |
56 | void CopyFromBitmap(const wxBitmap& bmp); | |
71451a6d | 57 | |
a11672a4 RR |
58 | private: |
59 | DECLARE_DYNAMIC_CLASS(wxIcon) | |
83df96d6 JS |
60 | }; |
61 | ||
71451a6d | 62 | #endif // _WX_GENERIC_ICON_H_ |