1998-05-20 14:01:55 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: icon.h
|
|
|
|
// Purpose:
|
|
|
|
// Author: Robert Roebling
|
1998-10-29 18:03:18 +00:00
|
|
|
// Id: $Id$
|
|
|
|
// Copyright: (c) 1998 Robert Roebling
|
1998-12-09 17:30:17 +00:00
|
|
|
// Licence: wxWindows licence
|
1998-05-20 14:01:55 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __GTKICONH__
|
|
|
|
#define __GTKICONH__
|
|
|
|
|
2002-09-07 12:28:46 +00:00
|
|
|
#if defined(__GNUG__) && !defined(__APPLE__)
|
1998-05-20 14:01:55 +00:00
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "wx/defs.h"
|
|
|
|
#include "wx/object.h"
|
|
|
|
#include "wx/bitmap.h"
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// classes
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class wxIcon;
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// wxIcon
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class wxIcon: public wxBitmap
|
|
|
|
{
|
|
|
|
public:
|
1999-11-22 19:44:25 +00:00
|
|
|
wxIcon();
|
|
|
|
wxIcon( const wxIcon& icon);
|
|
|
|
wxIcon( const char **bits, int width=-1, int height=-1 );
|
|
|
|
|
|
|
|
// For compatibility with wxMSW where desired size is sometimes required to
|
|
|
|
// distinguish between multiple icons in a resource.
|
2002-04-20 11:20:49 +00:00
|
|
|
wxIcon( const wxString& filename, int type = wxBITMAP_TYPE_XPM,
|
1999-11-22 19:44:25 +00:00
|
|
|
int WXUNUSED(desiredWidth)=-1, int WXUNUSED(desiredHeight)=-1 ) :
|
|
|
|
wxBitmap(filename, type)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
wxIcon( char **bits, int width=-1, int height=-1 );
|
|
|
|
|
2003-06-21 13:39:40 +00:00
|
|
|
wxIcon(const wxIconLocation& loc)
|
|
|
|
: wxBitmap(loc.GetFileName(), wxBITMAP_TYPE_XPM)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2002-04-20 11:20:49 +00:00
|
|
|
wxIcon& operator=(const wxIcon& icon);
|
|
|
|
bool operator==(const wxIcon& icon) const { return m_refData == icon.m_refData; }
|
|
|
|
bool operator!=(const wxIcon& icon) const { return !(*this == icon); }
|
2000-08-15 21:44:18 +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);
|
2002-04-20 11:20:49 +00:00
|
|
|
|
1999-11-22 19:44:25 +00:00
|
|
|
private:
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxIcon)
|
1998-05-20 14:01:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // __GTKICONH__
|