1998-09-18 10:19:10 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: icon.h
|
|
|
|
// Purpose: wxIcon class
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 17/09/98
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) Julian Smart
|
|
|
|
// Licence: wxWindows licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_ICON_H_
|
|
|
|
#define _WX_ICON_H_
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface "icon.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "wx/bitmap.h"
|
|
|
|
|
1998-09-28 15:42:54 +00:00
|
|
|
/*
|
|
|
|
// Same as for wxBitmap
|
1998-09-18 10:19:10 +00:00
|
|
|
class WXDLLEXPORT wxIconRefData: public wxBitmapRefData
|
|
|
|
{
|
|
|
|
friend class WXDLLEXPORT wxBitmap;
|
|
|
|
friend class WXDLLEXPORT wxIcon;
|
|
|
|
public:
|
|
|
|
wxIconRefData();
|
|
|
|
~wxIconRefData();
|
|
|
|
};
|
1998-09-28 15:42:54 +00:00
|
|
|
*/
|
1998-09-18 10:19:10 +00:00
|
|
|
|
1998-09-28 15:42:54 +00:00
|
|
|
#define M_ICONDATA ((wxBitmapRefData *)m_refData)
|
|
|
|
#define M_ICONHANDLERDATA ((wxBitmapRefData *)bitmap->GetRefData())
|
1998-09-18 10:19:10 +00:00
|
|
|
|
|
|
|
// Icon
|
|
|
|
class WXDLLEXPORT wxIcon: public wxBitmap
|
|
|
|
{
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxIcon)
|
|
|
|
|
|
|
|
public:
|
|
|
|
wxIcon();
|
|
|
|
|
|
|
|
// Copy constructors
|
|
|
|
inline wxIcon(const wxIcon& icon) { Ref(icon); }
|
|
|
|
|
1998-09-28 15:42:54 +00:00
|
|
|
// Initialize with XBM data
|
1998-09-18 10:19:10 +00:00
|
|
|
wxIcon(const char bits[], int width, int height);
|
1998-09-28 15:42:54 +00:00
|
|
|
|
|
|
|
// Initialize with XPM data
|
1998-10-18 22:31:48 +00:00
|
|
|
wxIcon(char **data);
|
1998-09-28 15:42:54 +00:00
|
|
|
|
1998-09-18 10:19:10 +00:00
|
|
|
wxIcon(const wxString& name, long flags = wxBITMAP_TYPE_ICO_RESOURCE,
|
|
|
|
int desiredWidth = -1, int desiredHeight = -1);
|
|
|
|
~wxIcon();
|
|
|
|
|
|
|
|
bool LoadFile(const wxString& name, long flags = wxBITMAP_TYPE_ICO_RESOURCE,
|
|
|
|
int desiredWidth = -1, int desiredHeight = -1);
|
1999-01-26 11:51:12 +00:00
|
|
|
bool LoadFile(const wxString& name, long type = wxBITMAP_TYPE_XBM)
|
|
|
|
{ return wxBitmap::LoadFile(name, type); }
|
1998-09-18 10:19:10 +00:00
|
|
|
|
|
|
|
inline wxIcon& operator = (const wxIcon& icon) { if (*this == icon) return (*this); Ref(icon); return *this; }
|
|
|
|
inline bool operator == (const wxIcon& icon) { return m_refData == icon.m_refData; }
|
|
|
|
inline bool operator != (const wxIcon& icon) { return m_refData != icon.m_refData; }
|
|
|
|
|
1998-09-28 15:42:54 +00:00
|
|
|
virtual bool Ok() const { return ((m_refData != NULL) && (M_ICONDATA->m_ok)); }
|
1998-09-18 10:19:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
// _WX_ICON_H_
|