]>
git.saurik.com Git - wxWidgets.git/blob - src/x11/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"
17 #include "wx/window.h"
20 #pragma message disable nosimpint
24 #pragma message enable nosimpint
27 #include "wx/x11/private.h"
29 IMPLEMENT_DYNAMIC_CLASS(wxIcon
, wxBitmap
)
39 // Create from XBM data
40 wxIcon::wxIcon(const char bits
[], int width
, int height
)
42 (void) Create((void*) bits
, wxBITMAP_TYPE_XBM_DATA
, width
, height
, 1);
45 // Create from XPM data
46 wxIcon::wxIcon(char **data
)
48 (void) Create((void*) data
, wxBITMAP_TYPE_XPM_DATA
, 0, 0, 0);
51 wxIcon::wxIcon(const char **data
)
53 (void) Create((void*) data
, wxBITMAP_TYPE_XPM_DATA
, 0, 0, 0);
56 wxIcon::wxIcon(const wxString
& icon_file
, long flags
,
57 int desiredWidth
, int desiredHeight
)
60 LoadFile(icon_file
, flags
, desiredWidth
, desiredHeight
);
67 bool wxIcon::LoadFile(const wxString
& filename
, long type
,
68 int desiredWidth
, int desiredHeight
)
72 m_refData
= new wxBitmapRefData
;
74 wxBitmapHandler
*handler
= FindHandler(type
);
77 return handler
->LoadFile(this, filename
, type
, desiredWidth
, desiredHeight
);