]> git.saurik.com Git - wxWidgets.git/blame - include/wx/motif/icon.h
added wxUSE_PRINTF_POS_PARAMS which can be used to force the use of built-in printf...
[wxWidgets.git] / include / wx / motif / icon.h
CommitLineData
9b6dbb09
JS
1/////////////////////////////////////////////////////////////////////////////
2// Name: icon.h
3// Purpose: wxIcon class
4// Author: Julian Smart
5// Modified by:
6// Created: 17/09/98
7// RCS-ID: $Id$
8// Copyright: (c) Julian Smart
65571936 9// Licence: wxWindows licence
9b6dbb09
JS
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_ICON_H_
13#define _WX_ICON_H_
14
9b6dbb09
JS
15#include "wx/bitmap.h"
16
9b6dbb09 17// Icon
aaf7ab43 18class WXDLLEXPORT wxIcon : public wxBitmap
9b6dbb09 19{
9b6dbb09 20public:
83df96d6 21 wxIcon();
1d54b9d2 22
83df96d6
JS
23 // Initialize with XBM data
24 wxIcon(const char bits[], int width, int height);
1d54b9d2 25
83df96d6
JS
26 // Initialize with XPM data
27 wxIcon(const char **data);
28 wxIcon(char **data);
1d54b9d2 29
1bc822df 30 wxIcon(const wxString& name, wxBitmapType type = wxBITMAP_TYPE_XPM,
aaf7ab43
VZ
31 int desiredWidth = -1, int desiredHeight = -1)
32 {
33 LoadFile(name, type, desiredWidth, desiredHeight);
34 }
35
36 wxIcon(const wxIconLocation& loc)
37 {
6f12c2c9 38 LoadFile(loc.GetFileName(), wxBITMAP_TYPE_ANY);
aaf7ab43
VZ
39 }
40
83df96d6 41 ~wxIcon();
1d54b9d2
VZ
42
43 bool LoadFile(const wxString& name, wxBitmapType type,
44 int desiredWidth, int desiredHeight = -1);
45
46 // unhide base class LoadFile()
47 virtual bool LoadFile(const wxString& name,
48 wxBitmapType type = wxBITMAP_TYPE_XPM)
49 {
50 return LoadFile(name, type, -1, -1);
51 }
329e276a
VS
52
53 // create from bitmap (which should have a mask unless it's monochrome):
54 // there shouldn't be any implicit bitmap -> icon conversion (i.e. no
55 // ctors, assignment operators...), but it's ok to have such function
56 void CopyFromBitmap(const wxBitmap& bmp);
1d54b9d2 57
aaf7ab43 58 bool operator == (const wxIcon& icon) const
59e034c0 59 { return m_refData == icon.m_refData; }
aaf7ab43
VZ
60 bool operator != (const wxIcon& icon) const
61 { return !(*this == icon); }
62
63
777105f2 64 DECLARE_DYNAMIC_CLASS(wxIcon)
9b6dbb09
JS
65};
66
59e034c0 67#endif // _WX_ICON_H_