]>
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 /////////////////////////////////////////////////////////////////////////////
13 #pragma implementation "icon.h"
18 IMPLEMENT_DYNAMIC_CLASS(wxIcon
, wxBitmap
);
20 // ============================================================================
22 // ============================================================================
28 // Create from XBM data
29 wxIcon::wxIcon(const char bits
[], int width
, int height
)
31 (void) Create((void*) bits
, wxBITMAP_TYPE_XBM_DATA
, width
, height
, 1);
34 // Create from XPM data
35 wxIcon::wxIcon(char **data
)
37 (void) Create((void*) data
, wxBITMAP_TYPE_XPM_DATA
, 0, 0, 0);
40 wxIcon::wxIcon(const char **data
)
42 (void) Create((void*) data
, wxBITMAP_TYPE_XPM_DATA
, 0, 0, 0);
45 wxIcon::wxIcon(const wxString
& icon_file
, wxBitmapType type
,
46 int desiredWidth
, int desiredHeight
)
49 LoadFile(icon_file
, type
, desiredWidth
, desiredHeight
);
52 void wxIcon::CopyFromBitmap(const wxBitmap
& bmp
)
54 wxIcon
*icon
= (wxIcon
*)(&bmp
);
62 bool wxIcon::LoadFile(const wxString
& filename
, wxBitmapType type
,
63 int desiredWidth
, int desiredHeight
)
67 wxBitmapHandler
*handler
= FindHandler(type
);
70 return handler
->LoadFile(this, filename
, type
,
71 desiredWidth
, desiredHeight
);