1998-09-18 06:19:10 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: icon.h
|
|
|
|
// Purpose: wxIcon class
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 17/09/98
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) Julian Smart
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
1998-09-18 06:19:10 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_ICON_H_
|
|
|
|
#define _WX_ICON_H_
|
|
|
|
|
2003-08-09 08:38:21 -04:00
|
|
|
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
1998-09-18 06:19:10 -04:00
|
|
|
#pragma interface "icon.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "wx/bitmap.h"
|
|
|
|
|
|
|
|
// Icon
|
2003-06-21 09:39:40 -04:00
|
|
|
class WXDLLEXPORT wxIcon : public wxBitmap
|
1998-09-18 06:19:10 -04:00
|
|
|
{
|
|
|
|
public:
|
2002-02-05 11:34:33 -05:00
|
|
|
wxIcon();
|
|
|
|
|
|
|
|
// Copy constructors
|
|
|
|
inline wxIcon(const wxIcon& icon) { Ref(icon); }
|
|
|
|
|
|
|
|
// Initialize with XBM data
|
|
|
|
wxIcon(const char bits[], int width, int height);
|
|
|
|
|
|
|
|
// Initialize with XPM data
|
|
|
|
wxIcon(const char **data);
|
|
|
|
wxIcon(char **data);
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
2002-02-05 11:34:33 -05:00
|
|
|
~wxIcon();
|
|
|
|
|
2003-01-19 04:52:29 -05:00
|
|
|
bool LoadFile(const wxString& name, wxBitmapType type = wxBITMAP_TYPE_XPM,
|
2003-06-21 09:39:40 -04:00
|
|
|
int desiredWidth = -1, int desiredHeight = -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);
|
2002-02-05 11:34:33 -05:00
|
|
|
|
2003-06-21 09:39:40 -04:00
|
|
|
wxIcon& operator = (const wxIcon& icon)
|
|
|
|
{ if (this != &icon) Ref(icon); return *this; }
|
|
|
|
bool operator == (const wxIcon& icon) const
|
2003-04-02 15:48:57 -05:00
|
|
|
{ return m_refData == icon.m_refData; }
|
2003-06-21 09:39:40 -04:00
|
|
|
bool operator != (const wxIcon& icon) const
|
|
|
|
{ return !(*this == icon); }
|
|
|
|
|
|
|
|
|
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_
|