]> git.saurik.com Git - wxWidgets.git/blame - include/wx/mgl/icon.h
Added compatibility functions for wxUSE_STL = 1:
[wxWidgets.git] / include / wx / mgl / icon.h
CommitLineData
32b8ec41
VZ
1/////////////////////////////////////////////////////////////////////////////
2// Name: icon.h
3// Purpose:
4// Author: Vaclav Slavik
5// Id: $Id$
52750c2e 6// Copyright: (c) 2001-2002 SciTech Software, Inc. (www.scitechsoft.com)
65571936 7// Licence: wxWindows licence
32b8ec41
VZ
8/////////////////////////////////////////////////////////////////////////////
9
10
11#ifndef __WX_ICON_H__
12#define __WX_ICON_H__
13
12028905 14#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
32b8ec41
VZ
15#pragma interface "icon.h"
16#endif
17
18#include "wx/defs.h"
19#include "wx/object.h"
20#include "wx/bitmap.h"
21
22//-----------------------------------------------------------------------------
23// classes
24//-----------------------------------------------------------------------------
25
26class WXDLLEXPORT wxIcon;
27
28//-----------------------------------------------------------------------------
29// wxIcon
30//-----------------------------------------------------------------------------
31
32class WXDLLEXPORT wxIcon: public wxBitmap
33{
34public:
35 wxIcon() : wxBitmap() {}
36 wxIcon(const wxIcon& icon);
37 wxIcon(const char **bits, int width=-1, int height=-1);
38 wxIcon(char **bits, int width=-1, int height=-1);
39
40 // For compatibility with wxMSW where desired size is sometimes required to
41 // distinguish between multiple icons in a resource.
625e74a7 42 wxIcon(const wxString& filename, int type = wxBITMAP_TYPE_ICO_RESOURCE,
32b8ec41 43 int WXUNUSED(desiredWidth)=-1, int WXUNUSED(desiredHeight)=-1 ) :
625e74a7 44 wxBitmap(filename, (wxBitmapType)type) {}
aaf7ab43
VZ
45
46 wxIcon(const wxIconLocation& loc)
6f12c2c9 47 : wxBitmap(loc.GetFileName(), wxBITMAP_TYPE_ANY)
aaf7ab43
VZ
48 {
49 }
50
51 wxIcon& operator=(const wxIcon& icon);
52 bool operator==(const wxIcon& icon) const { return m_refData == icon.m_refData; }
53 bool operator!=(const wxIcon& icon) const { return !(*this == icon); }
32b8ec41
VZ
54
55 // create from bitmap (which should have a mask unless it's monochrome):
56 // there shouldn't be any implicit bitmap -> icon conversion (i.e. no
57 // ctors, assignment operators...), but it's ok to have such function
58 void CopyFromBitmap(const wxBitmap& bmp);
aaf7ab43 59
32b8ec41
VZ
60private:
61 DECLARE_DYNAMIC_CLASS(wxIcon)
62};
63
64
65#endif // __WX_ICON_H__