]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/motif/icon.h
eba9735f4d6a570713b6b63fdaf45e40681b7faa
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxIcon class
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
15 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
16 #pragma interface "icon.h"
19 #include "wx/bitmap.h"
22 class WXDLLEXPORT wxIcon
: public wxBitmap
28 inline wxIcon(const wxIcon
& icon
) { Ref(icon
); }
30 // Initialize with XBM data
31 wxIcon(const char bits
[], int width
, int height
);
33 // Initialize with XPM data
34 wxIcon(const char **data
);
37 wxIcon(const wxString
& name
, wxBitmapType type
= wxBITMAP_TYPE_XPM
,
38 int desiredWidth
= -1, int desiredHeight
= -1)
40 LoadFile(name
, type
, desiredWidth
, desiredHeight
);
43 wxIcon(const wxIconLocation
& loc
)
45 LoadFile(loc
.GetFileName(), wxBITMAP_TYPE_ANY
);
50 bool LoadFile(const wxString
& name
, wxBitmapType type
= wxBITMAP_TYPE_XPM
,
51 int desiredWidth
= -1, int desiredHeight
= -1);
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
);
58 wxIcon
& operator = (const wxIcon
& icon
)
59 { if (this != &icon
) Ref(icon
); return *this; }
60 bool operator == (const wxIcon
& icon
) const
61 { return m_refData
== icon
.m_refData
; }
62 bool operator != (const wxIcon
& icon
) const
63 { return !(*this == icon
); }
66 DECLARE_DYNAMIC_CLASS(wxIcon
);