1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxIcon class
8 // Copyright: (c) AUTHOR
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
15 #if defined(__GNUG__) && !defined(__APPLE__)
16 #pragma interface "icon.h"
19 #include "wx/bitmap.h"
22 class WXDLLEXPORT wxIcon
: public wxBitmap
24 DECLARE_DYNAMIC_CLASS(wxIcon
)
30 wxIcon(const wxIcon
& icon
)
34 wxIcon(const char **data
);
36 wxIcon(const char bits
[], int width
, int height
);
37 wxIcon(const wxString
& name
, int flags
= wxBITMAP_TYPE_ICON_RESOURCE
,
38 int desiredWidth
= -1, int desiredHeight
= -1);
41 bool LoadFile(const wxString
& name
, wxBitmapType flags
/* = wxBITMAP_TYPE_ICON_RESOURCE */ ,
42 int desiredWidth
/* = -1 */ , int desiredHeight
= -1);
43 bool LoadFile(const wxString
& name
,wxBitmapType flags
= wxBITMAP_TYPE_ICON_RESOURCE
)
44 { return LoadFile( name
, flags
, -1 , -1 ) ; }
46 inline wxIcon
& operator = (const wxIcon
& icon
) { if (*this == icon
) return (*this); Ref(icon
); return *this; }
47 inline bool operator == (const wxIcon
& icon
) { return m_refData
== icon
.m_refData
; }
48 inline bool operator != (const wxIcon
& icon
) { return m_refData
!= icon
.m_refData
; }
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
);