1998-09-18 06:19:10 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2006-07-25 10:31:55 -04:00
|
|
|
// Name: wx/motif/icon.h
|
1998-09-18 06:19:10 -04:00
|
|
|
// Purpose: wxIcon class
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 17/09/98
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) Julian Smart
|
2006-07-25 10:31:55 -04:00
|
|
|
// Licence: wxWindows licence
|
1998-09-18 06:19:10 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_ICON_H_
|
|
|
|
#define _WX_ICON_H_
|
|
|
|
|
|
|
|
#include "wx/bitmap.h"
|
|
|
|
|
|
|
|
// Icon
|
2008-03-26 11:06:00 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxIcon : public wxBitmap
|
1998-09-18 06:19:10 -04:00
|
|
|
{
|
|
|
|
public:
|
2002-02-05 11:34:33 -05:00
|
|
|
wxIcon();
|
2005-09-13 12:04:10 -04:00
|
|
|
|
2002-02-05 11:34:33 -05:00
|
|
|
// Initialize with XBM data
|
|
|
|
wxIcon(const char bits[], int width, int height);
|
2005-09-13 12:04:10 -04:00
|
|
|
|
2002-02-05 11:34:33 -05:00
|
|
|
// Initialize with XPM data
|
2008-01-14 13:16:37 -05:00
|
|
|
wxIcon(const char* const* data);
|
|
|
|
#ifdef wxNEEDS_CHARPP
|
2002-02-05 11:34:33 -05:00
|
|
|
wxIcon(char **data);
|
2008-01-14 13:16:37 -05:00
|
|
|
#endif
|
2005-09-13 12:04:10 -04:00
|
|
|
|
2003-01-19 04:52:29 -05:00
|
|
|
wxIcon(const wxString& name, wxBitmapType type = wxBITMAP_TYPE_XPM,
|
2003-06-21 09:39:40 -04:00
|
|
|
int desiredWidth = -1, int desiredHeight = -1)
|
|
|
|
{
|
|
|
|
LoadFile(name, type, desiredWidth, desiredHeight);
|
|
|
|
}
|
|
|
|
|
|
|
|
wxIcon(const wxIconLocation& loc)
|
|
|
|
{
|
2003-07-21 08:21:22 -04:00
|
|
|
LoadFile(loc.GetFileName(), wxBITMAP_TYPE_ANY);
|
2003-06-21 09:39:40 -04:00
|
|
|
}
|
|
|
|
|
2006-09-05 16:47:48 -04:00
|
|
|
virtual ~wxIcon();
|
2005-09-13 12:04:10 -04:00
|
|
|
|
|
|
|
bool LoadFile(const wxString& name, wxBitmapType type,
|
|
|
|
int desiredWidth, int desiredHeight = -1);
|
|
|
|
|
|
|
|
// unhide base class LoadFile()
|
|
|
|
virtual bool LoadFile(const wxString& name,
|
|
|
|
wxBitmapType type = wxBITMAP_TYPE_XPM)
|
|
|
|
{
|
|
|
|
return LoadFile(name, type, -1, -1);
|
|
|
|
}
|
2002-03-22 14:14:33 -05:00
|
|
|
|
|
|
|
// create from bitmap (which should have a mask unless it's monochrome):
|
|
|
|
// there shouldn't be any implicit bitmap -> icon conversion (i.e. no
|
|
|
|
// ctors, assignment operators...), but it's ok to have such function
|
|
|
|
void CopyFromBitmap(const wxBitmap& bmp);
|
2005-09-13 12:04:10 -04:00
|
|
|
|
2003-06-21 09:39:40 -04:00
|
|
|
|
2005-02-09 10:01:49 -05:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxIcon)
|
1998-09-18 06:19:10 -04:00
|
|
|
};
|
|
|
|
|
2003-04-02 15:48:57 -05:00
|
|
|
#endif // _WX_ICON_H_
|