]>
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 #include "wx/bitmap.h"
18 class WXDLLEXPORT wxIcon
: public wxBitmap
24 inline wxIcon(const wxIcon
& icon
) { Ref(icon
); }
26 // Initialize with XBM data
27 wxIcon(const char bits
[], int width
, int height
);
29 // Initialize with XPM data
30 wxIcon(const char **data
);
33 wxIcon(const wxString
& name
, wxBitmapType type
= wxBITMAP_TYPE_XPM
,
34 int desiredWidth
= -1, int desiredHeight
= -1)
36 LoadFile(name
, type
, desiredWidth
, desiredHeight
);
39 wxIcon(const wxIconLocation
& loc
)
41 LoadFile(loc
.GetFileName(), wxBITMAP_TYPE_ANY
);
46 bool LoadFile(const wxString
& name
, wxBitmapType type
,
47 int desiredWidth
, int desiredHeight
= -1);
49 // unhide base class LoadFile()
50 virtual bool LoadFile(const wxString
& name
,
51 wxBitmapType type
= wxBITMAP_TYPE_XPM
)
53 return LoadFile(name
, type
, -1, -1);
56 // create from bitmap (which should have a mask unless it's monochrome):
57 // there shouldn't be any implicit bitmap -> icon conversion (i.e. no
58 // ctors, assignment operators...), but it's ok to have such function
59 void CopyFromBitmap(const wxBitmap
& bmp
);
61 wxIcon
& operator = (const wxIcon
& icon
)
62 { if (this != &icon
) Ref(icon
); return *this; }
63 bool operator == (const wxIcon
& icon
) const
64 { return m_refData
== icon
.m_refData
; }
65 bool operator != (const wxIcon
& icon
) const
66 { return !(*this == icon
); }
69 DECLARE_DYNAMIC_CLASS(wxIcon
)