]>
git.saurik.com Git - wxWidgets.git/blob - src/motif/icon.cpp
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxIcon class
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 // For compilers that support precompilation, includes "wx.h".
13 #include "wx/wxprec.h"
17 IMPLEMENT_DYNAMIC_CLASS(wxIcon
, wxBitmap
);
19 // ============================================================================
21 // ============================================================================
27 // Create from XBM data
28 wxIcon::wxIcon(const char bits
[], int width
, int height
)
30 (void) Create((void*) bits
, wxBITMAP_TYPE_XBM_DATA
, width
, height
, 1);
33 // Create from XPM data
34 wxIcon::wxIcon(char **data
)
36 (void) Create((void*) data
, wxBITMAP_TYPE_XPM_DATA
, 0, 0, 0);
39 wxIcon::wxIcon(const char **data
)
41 (void) Create((void*) data
, wxBITMAP_TYPE_XPM_DATA
, 0, 0, 0);
44 void wxIcon::CopyFromBitmap(const wxBitmap
& bmp
)
46 wxIcon
*icon
= (wxIcon
*)(&bmp
);
54 bool wxIcon::LoadFile(const wxString
& filename
, wxBitmapType type
,
55 int desiredWidth
, int desiredHeight
)
59 wxBitmapHandler
*handler
= FindHandler(type
);
62 return handler
->LoadFile(this, filename
, type
,
63 desiredWidth
, desiredHeight
);