1998-09-18 10:19:10 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2006-07-25 14:31:55 +00:00
|
|
|
// Name: wx/motif/icon.h
|
1998-09-18 10:19:10 +00:00
|
|
|
// Purpose: wxIcon class
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 17/09/98
|
|
|
|
// Copyright: (c) Julian Smart
|
2006-07-25 14:31:55 +00:00
|
|
|
// Licence: wxWindows licence
|
1998-09-18 10:19:10 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_ICON_H_
|
|
|
|
#define _WX_ICON_H_
|
|
|
|
|
|
|
|
#include "wx/bitmap.h"
|
|
|
|
|
|
|
|
// Icon
|
2008-03-26 15:06:00 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxIcon : public wxBitmap
|
1998-09-18 10:19:10 +00:00
|
|
|
{
|
|
|
|
public:
|
2002-02-05 16:34:33 +00:00
|
|
|
wxIcon();
|
2005-09-13 16:04:10 +00:00
|
|
|
|
2002-02-05 16:34:33 +00:00
|
|
|
// Initialize with XBM data
|
|
|
|
wxIcon(const char bits[], int width, int height);
|
2005-09-13 16:04:10 +00:00
|
|
|
|
2002-02-05 16:34:33 +00:00
|
|
|
// Initialize with XPM data
|
2008-01-14 18:16:37 +00:00
|
|
|
wxIcon(const char* const* data);
|
|
|
|
#ifdef wxNEEDS_CHARPP
|
2002-02-05 16:34:33 +00:00
|
|
|
wxIcon(char **data);
|
2008-01-14 18:16:37 +00:00
|
|
|
#endif
|
2005-09-13 16:04:10 +00:00
|
|
|
|
2008-09-21 21:09:36 +00:00
|
|
|
wxIcon(const wxString& name, wxBitmapType type = wxICON_DEFAULT_TYPE,
|
2003-06-21 13:39:40 +00:00
|
|
|
int desiredWidth = -1, int desiredHeight = -1)
|
|
|
|
{
|
|
|
|
LoadFile(name, type, desiredWidth, desiredHeight);
|
|
|
|
}
|
|
|
|
|
|
|
|
wxIcon(const wxIconLocation& loc)
|
|
|
|
{
|
2003-07-21 12:21:22 +00:00
|
|
|
LoadFile(loc.GetFileName(), wxBITMAP_TYPE_ANY);
|
2003-06-21 13:39:40 +00:00
|
|
|
}
|
|
|
|
|
2006-09-05 20:47:48 +00:00
|
|
|
virtual ~wxIcon();
|
2005-09-13 16:04:10 +00:00
|
|
|
|
2009-03-02 13:45:09 +00:00
|
|
|
bool LoadFile(const wxString& name, wxBitmapType type,
|
|
|
|
int desiredWidth, int desiredHeight);
|
|
|
|
|
|
|
|
// unhide the base class version
|
|
|
|
virtual bool LoadFile(const wxString& name,
|
|
|
|
wxBitmapType flags = wxICON_DEFAULT_TYPE)
|
|
|
|
{ return LoadFile(name, flags); }
|
2002-03-22 19:14:33 +00: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 16:04:10 +00:00
|
|
|
|
2003-06-21 13:39:40 +00:00
|
|
|
|
2015-04-23 11:49:01 +00:00
|
|
|
wxDECLARE_DYNAMIC_CLASS(wxIcon);
|
1998-09-18 10:19:10 +00:00
|
|
|
};
|
|
|
|
|
2003-04-02 20:48:57 +00:00
|
|
|
#endif // _WX_ICON_H_
|