]>
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 
   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); 
  34 // Create from XPM data 
  35 wxIcon::wxIcon(char **data
) 
  37     (void) Create((void*) data
, wxBITMAP_TYPE_XPM_DATA
, 0, 0, 0); 
  41 wxIcon::wxIcon(const char* const* data
) 
  43     (void) Create((void*) data
, wxBITMAP_TYPE_XPM_DATA
, 0, 0, 0); 
  46 void wxIcon::CopyFromBitmap(const wxBitmap
& bmp
) 
  48     wxIcon 
*icon 
= (wxIcon
*)(&bmp
); 
  56 bool wxIcon::LoadFile(const wxString
& filename
, wxBitmapType type
, 
  57                       int desiredWidth
, int desiredHeight
) 
  61     wxBitmapHandler 
*handler 
= FindHandler(type
); 
  64         return handler
->LoadFile(this, filename
, type
, 
  65                                  desiredWidth
, desiredHeight
);