]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/motif/icon.h
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
,
51 int desiredWidth
, int desiredHeight
= -1);
53 // unhide base class LoadFile()
54 virtual bool LoadFile(const wxString
& name
,
55 wxBitmapType type
= wxBITMAP_TYPE_XPM
)
57 return LoadFile(name
, type
, -1, -1);
60 // create from bitmap (which should have a mask unless it's monochrome):
61 // there shouldn't be any implicit bitmap -> icon conversion (i.e. no
62 // ctors, assignment operators...), but it's ok to have such function
63 void CopyFromBitmap(const wxBitmap
& bmp
);
65 wxIcon
& operator = (const wxIcon
& icon
)
66 { if (this != &icon
) Ref(icon
); return *this; }
67 bool operator == (const wxIcon
& icon
) const
68 { return m_refData
== icon
.m_refData
; }
69 bool operator != (const wxIcon
& icon
) const
70 { return !(*this == icon
); }
73 DECLARE_DYNAMIC_CLASS(wxIcon
)