2002-02-05 11:34:33 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2006-08-09 13:59:30 -04:00
|
|
|
// Name: wx/generic/icon.h
|
|
|
|
// Purpose: wxIcon implementation for ports where it's same as wxBitmap
|
2002-02-05 11:34:33 -05:00
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 17/09/98
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) Julian Smart
|
2006-08-09 13:59:30 -04:00
|
|
|
// Licence: wxWindows licence
|
2002-02-05 11:34:33 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2006-08-09 13:59:30 -04:00
|
|
|
#ifndef _WX_GENERIC_ICON_H_
|
|
|
|
#define _WX_GENERIC_ICON_H_
|
2002-02-05 11:34:33 -05:00
|
|
|
|
|
|
|
#include "wx/bitmap.h"
|
|
|
|
|
2002-02-13 03:38:54 -05:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// wxIcon
|
|
|
|
//-----------------------------------------------------------------------------
|
2002-02-05 11:34:33 -05:00
|
|
|
|
2005-08-02 14:16:51 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxIcon: public wxBitmap
|
2002-02-05 11:34:33 -05:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
wxIcon();
|
2006-08-09 13:59:30 -04:00
|
|
|
|
2008-01-14 13:16:37 -05:00
|
|
|
wxIcon(const char* const* bits);
|
|
|
|
#ifdef wxNEEDS_CHARPP
|
|
|
|
wxIcon(char **bits);
|
|
|
|
#endif
|
2002-02-13 03:38:54 -05:00
|
|
|
|
|
|
|
// For compatibility with wxMSW where desired size is sometimes required to
|
|
|
|
// distinguish between multiple icons in a resource.
|
2006-08-09 13:59:30 -04:00
|
|
|
wxIcon( const wxString& filename,
|
2008-09-21 16:03:14 -04:00
|
|
|
wxBitmapType type = wxICON_DEFAULT_TYPE,
|
2002-02-13 03:38:54 -05:00
|
|
|
int WXUNUSED(desiredWidth)=-1, int WXUNUSED(desiredHeight)=-1 ) :
|
|
|
|
wxBitmap(filename, type)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2003-06-21 09:39:40 -04:00
|
|
|
wxIcon(const wxIconLocation& loc)
|
2003-07-21 08:21:22 -04:00
|
|
|
: wxBitmap(loc.GetFileName(), wxBITMAP_TYPE_ANY)
|
2003-06-21 09:39:40 -04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2008-12-31 10:27:00 -05:00
|
|
|
bool LoadFile(const wxString& name, wxBitmapType flags,
|
2008-12-31 06:50:05 -05:00
|
|
|
int WXUNUSED(desiredWidth), int WXUNUSED(desiredHeight))
|
2008-11-12 09:40:28 -05:00
|
|
|
{ return wxBitmap::LoadFile(name, flags); }
|
|
|
|
|
|
|
|
// unhide the base class version
|
2008-12-31 10:27:00 -05:00
|
|
|
virtual bool LoadFile(const wxString& name,
|
|
|
|
wxBitmapType flags = wxICON_DEFAULT_TYPE)
|
2008-11-12 09:40:28 -05:00
|
|
|
{ return wxBitmap::LoadFile(name, flags); }
|
2008-09-21 16:03:14 -04:00
|
|
|
|
2002-02-13 03:38:54 -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);
|
2006-08-09 13:59:30 -04:00
|
|
|
|
2002-02-13 03:38:54 -05:00
|
|
|
private:
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxIcon)
|
2002-02-05 11:34:33 -05:00
|
|
|
};
|
|
|
|
|
2006-08-09 13:59:30 -04:00
|
|
|
#endif // _WX_GENERIC_ICON_H_
|