]>
git.saurik.com Git - wxWidgets.git/blob - src/motif/icon.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/motif/icon.cpp
3 // Purpose: wxIcon class
4 // Author: Julian Smart
7 // Copyright: (c) Julian Smart
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 // For compilers that support precompilation, includes "wx.h".
12 #include "wx/wxprec.h"
16 IMPLEMENT_DYNAMIC_CLASS(wxIcon
, wxBitmap
)
18 // ============================================================================
20 // ============================================================================
26 // Create from XBM data
27 wxIcon::wxIcon(const char bits
[], int width
, int height
)
29 (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);
40 wxIcon::wxIcon(const char* const* data
)
42 (void) Create((void*) data
, wxBITMAP_TYPE_XPM_DATA
, 0, 0, 0);
45 void wxIcon::CopyFromBitmap(const wxBitmap
& bmp
)
47 wxIcon
*icon
= (wxIcon
*)(&bmp
);
55 bool wxIcon::LoadFile(const wxString
& filename
, wxBitmapType type
,
56 int desiredWidth
, int desiredHeight
)
60 wxBitmapHandler
*handler
= FindHandler(type
);
63 return handler
->LoadFile(this, filename
, type
,
64 desiredWidth
, desiredHeight
);