]> git.saurik.com Git - wxWidgets.git/blame - include/wx/generic/icon.h
Allow OS X Cocoa (or any OS X port) to override GetBestSize and provide a native...
[wxWidgets.git] / include / wx / generic / icon.h
CommitLineData
83df96d6 1/////////////////////////////////////////////////////////////////////////////
71451a6d
VS
2// Name: wx/generic/icon.h
3// Purpose: wxIcon implementation for ports where it's same as wxBitmap
83df96d6
JS
4// Author: Julian Smart
5// Modified by:
6// Created: 17/09/98
7// RCS-ID: $Id$
8// Copyright: (c) Julian Smart
71451a6d 9// Licence: wxWindows licence
83df96d6
JS
10/////////////////////////////////////////////////////////////////////////////
11
71451a6d
VS
12#ifndef _WX_GENERIC_ICON_H_
13#define _WX_GENERIC_ICON_H_
83df96d6 14
83df96d6
JS
15#include "wx/bitmap.h"
16
a11672a4
RR
17//-----------------------------------------------------------------------------
18// wxIcon
19//-----------------------------------------------------------------------------
83df96d6 20
968eb2ef 21class WXDLLIMPEXP_CORE wxIcon: public wxBitmap
83df96d6 22{
83df96d6
JS
23public:
24 wxIcon();
71451a6d 25
e45080c1
PC
26 wxIcon(const char* const* bits);
27#ifdef wxNEEDS_CHARPP
28 wxIcon(char **bits);
29#endif
a11672a4
RR
30
31 // For compatibility with wxMSW where desired size is sometimes required to
32 // distinguish between multiple icons in a resource.
71451a6d 33 wxIcon( const wxString& filename,
cbea3ec6 34 wxBitmapType type = wxICON_DEFAULT_TYPE,
a11672a4
RR
35 int WXUNUSED(desiredWidth)=-1, int WXUNUSED(desiredHeight)=-1 ) :
36 wxBitmap(filename, type)
37 {
38 }
a11672a4 39
aaf7ab43 40 wxIcon(const wxIconLocation& loc)
6f12c2c9 41 : wxBitmap(loc.GetFileName(), wxBITMAP_TYPE_ANY)
aaf7ab43
VZ
42 {
43 }
44
2ffeccb3 45 bool LoadFile(const wxString& name, wxBitmapType flags,
6f97a0d5 46 int WXUNUSED(desiredWidth), int WXUNUSED(desiredHeight))
9b3eb4aa
VZ
47 { return wxBitmap::LoadFile(name, flags); }
48
49 // unhide the base class version
2ffeccb3
VZ
50 virtual bool LoadFile(const wxString& name,
51 wxBitmapType flags = wxICON_DEFAULT_TYPE)
9b3eb4aa 52 { return wxBitmap::LoadFile(name, flags); }
cbea3ec6 53
a11672a4
RR
54 // create from bitmap (which should have a mask unless it's monochrome):
55 // there shouldn't be any implicit bitmap -> icon conversion (i.e. no
56 // ctors, assignment operators...), but it's ok to have such function
57 void CopyFromBitmap(const wxBitmap& bmp);
71451a6d 58
a11672a4
RR
59private:
60 DECLARE_DYNAMIC_CLASS(wxIcon)
83df96d6
JS
61};
62
71451a6d 63#endif // _WX_GENERIC_ICON_H_