]>
Commit | Line | Data |
---|---|---|
0dbd6262 SC |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: icon.h | |
3 | // Purpose: wxIcon class | |
4 | // Author: AUTHOR | |
5 | // Modified by: | |
6 | // Created: ??/??/98 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) AUTHOR | |
9 | // Licence: wxWindows licence | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #ifndef _WX_ICON_H_ | |
13 | #define _WX_ICON_H_ | |
14 | ||
15 | #ifdef __GNUG__ | |
16 | #pragma interface "icon.h" | |
17 | #endif | |
18 | ||
19 | #include "wx/bitmap.h" | |
20 | ||
0dbd6262 SC |
21 | // Icon |
22 | class WXDLLEXPORT wxIcon: public wxBitmap | |
23 | { | |
24 | DECLARE_DYNAMIC_CLASS(wxIcon) | |
25 | ||
26 | public: | |
27 | wxIcon(); | |
28 | ||
29 | // Copy constructors | |
30 | inline wxIcon(const wxIcon& icon) { Ref(icon); } | |
31 | ||
d062e17f GD |
32 | wxIcon(const char **data); |
33 | wxIcon(char **data); | |
b729ceb2 | 34 | wxIcon(const char bits[], int width , int height ); |
519cb848 | 35 | wxIcon(const wxString& name, long flags = wxBITMAP_TYPE_ICON_RESOURCE, |
0dbd6262 SC |
36 | int desiredWidth = -1, int desiredHeight = -1); |
37 | ~wxIcon(); | |
38 | ||
519cb848 SC |
39 | bool LoadFile(const wxString& name, long flags /* = wxBITMAP_TYPE_ICON_RESOURCE */ , |
40 | int desiredWidth /* = -1 */ , int desiredHeight = -1); | |
41 | bool LoadFile(const wxString& name ,long flags = wxBITMAP_TYPE_ICON_RESOURCE ) | |
42 | { return LoadFile( name , flags , -1 , -1 ) ; } | |
0dbd6262 SC |
43 | |
44 | inline wxIcon& operator = (const wxIcon& icon) { if (*this == icon) return (*this); Ref(icon); return *this; } | |
45 | inline bool operator == (const wxIcon& icon) { return m_refData == icon.m_refData; } | |
46 | inline bool operator != (const wxIcon& icon) { return m_refData != icon.m_refData; } | |
d062e17f GD |
47 | |
48 | // create from bitmap (which should have a mask unless it's monochrome): | |
49 | // there shouldn't be any implicit bitmap -> icon conversion (i.e. no | |
50 | // ctors, assignment operators...), but it's ok to have such function | |
51 | void CopyFromBitmap(const wxBitmap& bmp); | |
0dbd6262 SC |
52 | }; |
53 | ||
519cb848 SC |
54 | /* |
55 | class WXDLLEXPORT wxICONFileHandler: public wxBitmapHandler | |
0dbd6262 | 56 | { |
519cb848 | 57 | DECLARE_DYNAMIC_CLASS(wxICONFileHandler) |
0dbd6262 | 58 | public: |
519cb848 | 59 | inline wxICONFileHandler() |
0dbd6262 SC |
60 | { |
61 | m_name = "ICO icon file"; | |
62 | m_extension = "ico"; | |
63 | m_type = wxBITMAP_TYPE_ICO; | |
64 | }; | |
65 | ||
66 | virtual bool LoadFile(wxBitmap *bitmap, const wxString& name, long flags, | |
67 | int desiredWidth = -1, int desiredHeight = -1); | |
68 | }; | |
519cb848 | 69 | */ |
0dbd6262 | 70 | |
519cb848 | 71 | class WXDLLEXPORT wxICONResourceHandler: public wxBitmapHandler |
0dbd6262 | 72 | { |
519cb848 | 73 | DECLARE_DYNAMIC_CLASS(wxICONResourceHandler) |
0dbd6262 | 74 | public: |
519cb848 | 75 | inline wxICONResourceHandler() |
0dbd6262 | 76 | { |
519cb848 SC |
77 | m_name = "ICON resource"; |
78 | m_extension = ""; | |
79 | m_type = wxBITMAP_TYPE_ICON_RESOURCE; | |
0dbd6262 SC |
80 | }; |
81 | ||
82 | virtual bool LoadFile(wxBitmap *bitmap, const wxString& name, long flags, | |
83 | int desiredWidth = -1, int desiredHeight = -1); | |
84 | ||
85 | }; | |
86 | ||
0dbd6262 SC |
87 | #endif |
88 | // _WX_ICON_H_ |