]> git.saurik.com Git - wxWidgets.git/blame - include/wx/motif/icon.h
1. implemented radio menu items for wxGTK
[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
9// Licence: wxWindows licence
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_ICON_H_
13#define _WX_ICON_H_
14
15#ifdef __GNUG__
16#pragma interface "icon.h"
17#endif
18
19#include "wx/bitmap.h"
20
f97c9854
JS
21#define M_ICONDATA ((wxBitmapRefData *)m_refData)
22#define M_ICONHANDLERDATA ((wxBitmapRefData *)bitmap->GetRefData())
9b6dbb09
JS
23
24// Icon
25class WXDLLEXPORT wxIcon: public wxBitmap
26{
83df96d6
JS
27 DECLARE_DYNAMIC_CLASS(wxIcon)
28
9b6dbb09 29public:
83df96d6
JS
30 wxIcon();
31
32 // Copy constructors
33 inline wxIcon(const wxIcon& icon) { Ref(icon); }
34
35 // Initialize with XBM data
36 wxIcon(const char bits[], int width, int height);
37
38 // Initialize with XPM data
39 wxIcon(const char **data);
40 wxIcon(char **data);
41
42 wxIcon(const wxString& name, long flags = wxBITMAP_TYPE_XPM,
43 int desiredWidth = -1, int desiredHeight = -1);
44 ~wxIcon();
45
46 bool LoadFile(const wxString& name, long flags = wxBITMAP_TYPE_XPM,
47 int desiredWidth = -1, int desiredHeight = -1);
48
49 inline wxIcon& operator = (const wxIcon& icon) { if (*this == icon) return (*this); Ref(icon); return *this; }
50 inline bool operator == (const wxIcon& icon) const { return m_refData == icon.m_refData; }
51 inline bool operator != (const wxIcon& icon) const { return m_refData != icon.m_refData; }
52
53 virtual bool Ok() const { return ((m_refData != NULL) && (M_ICONDATA->m_ok)); }
9b6dbb09
JS
54};
55
9b6dbb09 56#endif
83df96d6 57// _WX_ICON_H_