]>
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 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
13 #pragma implementation "icon.h"
16 // For compilers that support precompilation, includes "wx.h".
17 #include "wx/wxprec.h"
21 IMPLEMENT_DYNAMIC_CLASS(wxIcon
, wxBitmap
);
23 // ============================================================================
25 // ============================================================================
31 // Create from XBM data
32 wxIcon::wxIcon(const char bits
[], int width
, int height
)
34 (void) Create((void*) bits
, wxBITMAP_TYPE_XBM_DATA
, width
, height
, 1);
37 // Create from XPM data
38 wxIcon::wxIcon(char **data
)
40 (void) Create((void*) data
, wxBITMAP_TYPE_XPM_DATA
, 0, 0, 0);
43 wxIcon::wxIcon(const char **data
)
45 (void) Create((void*) data
, wxBITMAP_TYPE_XPM_DATA
, 0, 0, 0);
48 void wxIcon::CopyFromBitmap(const wxBitmap
& bmp
)
50 wxIcon
*icon
= (wxIcon
*)(&bmp
);
58 bool wxIcon::LoadFile(const wxString
& filename
, wxBitmapType type
,
59 int desiredWidth
, int desiredHeight
)
63 wxBitmapHandler
*handler
= FindHandler(type
);
66 return handler
->LoadFile(this, filename
, type
,
67 desiredWidth
, desiredHeight
);